Skip to content

Commit

Permalink
Revert "PLANET-7183 Fix search password protected content"
Browse files Browse the repository at this point in the history
This reverts commit afdd03d.
  • Loading branch information
mleray committed Jun 26, 2023
1 parent 7630806 commit 2fe3859
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/Search.php
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ function ($args) {
1
);
add_filter(
'pre_get_posts',
'ep_post_query_db_args',
[ self::class, 'hide_password_protected_content' ],
10,
1
Expand Down Expand Up @@ -1091,14 +1091,14 @@ public static function exclude_page_for_posts(WP_Query $query): WP_Query
/**
* Exclude password protected content from ElasticPress sync.
*
* @param WP_Query $query The Query ElasticPress will use to fetch the ids of posts.
* @param mixed[] $args The args ElasticPress will use to fetch the ids of posts that will be synced.
*
* @return WP_Query The query with exclusion of password protected content.
* @return mixed The args with exclusion of password protected content.
*/
public static function hide_password_protected_content(WP_Query $query): WP_QUERY
public static function hide_password_protected_content(array $args)
{
$query->set('has_password', false);
$args['has_password'] = false;

return $query;
return $args;
}
}

0 comments on commit 2fe3859

Please sign in to comment.