FacetWP – WP User Frontend save handler

mgibbs189

{{gist file=”functions.php” lang=”php”}}
<?php

// Add the following to your (child) theme’s functions.php

add_action( ‘wpuf_add_post_after_insert’, ‘prefix_facetwp_index_post’, 100 );
add_action( ‘wpuf_edit_post_after_update’, ‘prefix_facetwp_index_post’, 100 );

function prefix_facetwp_index_post( $post_id ) {
if ( function_exists( ‘FWP’ ) ) {
FWP()->indexer->index( $post_id );
}
}

{{/gist}}