WP_CLI remove_all_actions not working
-
I’m using WP_CLI develop the plugin , and using
remove_all_actionsto remove the actions , there are the code below :remove_all_actions('pre_get_posts'); $args = array( 'post_status' => array('publish', 'pending', 'draft', 'future', 'private', 'trash', 'auto-draft'), 'post_per_page' => -1, 'meta_query' => array( array( 'key' => $this->JPost->source, 'value' => $single_url, 'compare' => '=', ), ), ); $the_query = new WP_Query($args); var_dump($the_query->posts);if there’s no search result ,it always return the leatest article , so i used remove_all_actions(‘pre_get_posts’); to remove all hooks .
And it works in the browse , but not working in WP_CLI .
Is this is a debug or something wrong with my code .
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
The topic ‘WP_CLI remove_all_actions not working’ is closed to new replies.