WP_Query() posts | WordPress.org

[ad_1]

Plugin Author
Kento

(@proaktion)

Hi,

In your WP_Query make sure that suppress_filters is false (which it is by default so if you don’t pass that parameter it would be ok, using true however would prevent Groups from applying the restrictions).

In most cases, you probably wouldn’t need to use groups_filter_the_posts because it hooks into the posts_where filter to apply restrictions. However, if you still need it, you can enable it using the predefined __return_true() WordPress function with the filter:

add_filter( 'groups_filter_the_posts', '__return_true' );

But you should make sure that this only applies when it is really needed, to avoid any processing overhead it would create otherwise.

Cheers

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer