Skip to content

Instantly share code, notes, and snippets.

@mgibbs189
Last active November 8, 2019 13:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mgibbs189/4629c92f236a732f92139e876d5e7047 to your computer and use it in GitHub Desktop.
Save mgibbs189/4629c92f236a732f92139e876d5e7047 to your computer and use it in GitHub Desktop.
FacetWP - WP User Frontend save handler
<?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 );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment