Created
April 18, 2024 06:36
-
-
Save digamber89/137f780f2ca4d390096762ebaac8f21b to your computer and use it in GitHub Desktop.
SWT: Stop Indexing on Update
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 | |
function cm_stop_index_on_update_20240418(){ | |
if( class_exists('\Codemanas\Typesense\Main\EventListener')){ | |
$instance = \Codemanas\Typesense\Main\EventListener::getInstance(); | |
remove_action( 'wp_after_insert_post', [$instance, 'postCreatedUpdatedHandler'], 10 ); | |
//The code below stops from deleting posts when it is deleted. | |
// remove_action( 'delete_post', [ $instance, 'postDeletedHandler' ], 10); | |
// remove_action( 'wp_trash_post', [ $instance, 'postDeletedHandler' ], 10 ); | |
} | |
} | |
add_action('init','cm_stop_index_on_update_20240418' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment