Created
April 1, 2020 18:53
-
-
Save djrmom/9edd0b90dabd64af10c152a77cd26905 to your computer and use it in GitHub Desktop.
facetwp schedule index after pmxi_after_xml_import
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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