get_posts() query is modified by the plugin
-
Hi,
Recently one of my plugin’s user reported an issue that, the query for custom post type includes “the events calendar” events.
The plugin does query like below. Note the “hello world” key set to the query to identify it.
Expecting the query to have only “announcer” post type.
Can we please check which
pre_get_posts
filter is modifying the query?$announcement_posts = get_posts(array( 'post_type' => ANCR_POST_TYPE, 'posts_per_page' => -1, 'orderby' => 'menu_order', 'order' => 'asc', 'post_status' => 'publish', 'hello' => 'world' ));
function modify_announcements_query($query) { print_r($query); } add_action('pre_get_posts', 'modify_announcements_query', 1, 999);
WP_Query Object ( [query] => Array ( [numberposts] => 5 [category] => 0 [orderby] => menu_order [order] => asc [include] => Array ( ) [exclude] => Array ( ) [meta_key] => [meta_value] => [post_type] => Array ( [0] => tribe_events [1] => announcer ) [suppress_filters] => 1 [posts_per_page] => -1 [post_status] => publish [hello] => world [ignore_sticky_posts] => 1 [no_found_rows] => 1 )
Thanks
The page I need help with: [log in to see the link]
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘get_posts() query is modified by the plugin’ is closed to new replies.