Skip to content

Instantly share code, notes, and snippets.

@djrmom
Created April 1, 2020 18:53
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 djrmom/9edd0b90dabd64af10c152a77cd26905 to your computer and use it in GitHub Desktop.
Save djrmom/9edd0b90dabd64af10c152a77cd26905 to your computer and use it in GitHub Desktop.
facetwp schedule index after pmxi_after_xml_import
<?php
/** schedule one time index **/
add_action( 'pmxi_after_xml_import', function() {
wp_schedule_single_event( time(), 'fwp_single_index', array() );
});
/** needs to be availble to cron to run **/
function fwp_single_index() {
FWP()->indexer->index();
}
add_action( 'fwp_single_index', 'fwp_single_index' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment