mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-17 13:43:38 +09:00
- fixed search query and restricted posts. Avoid parsing posts via the search query
This commit is contained in:
@@ -1423,7 +1423,8 @@ if ( ! class_exists( 'um\core\Access' ) ) {
|
||||
*/
|
||||
function exclude_posts( $query ) {
|
||||
if ( $query->is_main_query() ) {
|
||||
$exclude_posts = $this->exclude_posts_array( is_admin() );
|
||||
$force = is_search() || is_admin();
|
||||
$exclude_posts = $this->exclude_posts_array( $force );
|
||||
if ( ! empty( $exclude_posts ) ) {
|
||||
$post__not_in = $query->get( 'post__not_in', array() );
|
||||
$query->set( 'post__not_in', array_merge( wp_parse_id_list( $post__not_in ), $exclude_posts ) );
|
||||
|
||||
Reference in New Issue
Block a user