Created
February 20, 2017 12:05
-
-
Save tiborp/af31c36d1d397ebaf8c07608ad93beba to your computer and use it in GitHub Desktop.
Prevent auto indexing
This file contains hidden or 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
/** | |
* See: http://www.wpallimport.com/documentation/advanced/action-reference/ | |
*/ | |
//Prevent auto indexing before first import | |
function drl_before_opleidingen_import($import_id) { | |
if( $import_id === 4) { | |
add_filter( 'searchwp_auto_reindex', '__return_false' ); | |
} | |
} | |
add_action('pmxi_before_xml_import', 'drl_before_opleidingen_import', 10, 1); | |
//Start auto indexing after last import | |
function drl_after_opleidingen_import($import_id) { | |
if( $import_id === 2 ) { | |
add_filter( 'searchwp_auto_reindex', '__return_true' ); | |
} | |
} | |
add_action('pmxi_after_xml_import', 'drl_after_opleidingen_import', 10, 1); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment