Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PLANET-5726 Hide password protected content on post listing & search page #1245

Merged
merged 2 commits into from
Dec 11, 2020

Conversation

sagarsdeshmukh
Copy link
Member

@sagarsdeshmukh sagarsdeshmukh commented Dec 2, 2020

JIRA 5726

Task -

  • Hide password protected content from post listing pages like taxonomy, author, p4 post type pages etc
  • Hide password protected content from search result page

Blocker -

  • The elasticPress plugin won’t provide option/support to hide password protected content from search result(quite surprising)

I found some discussion and open PR which offer the solution , but it will take time to get approval and merging -

Till the time we could consider some temporary solution-

  • We already have a meta field check which skip the posts from search result ( p4_do_not_index meta field)

Any suggestions or if I miss something

The solution suggested by @Inwerpsel works like a charm. Thanks 🚀

@sagarsdeshmukh sagarsdeshmukh requested review from a team, pablocubico and Inwerpsel and removed request for a team December 2, 2020 10:16
@sagarsdeshmukh sagarsdeshmukh self-assigned this Dec 3, 2020
Copy link
Contributor

@Inwerpsel Inwerpsel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need the additional query, which could affect performance, but can directly add post_password = false to the arguments.

src/Search.php Outdated Show resolved Hide resolved
@sagarsdeshmukh
Copy link
Member Author

We don't need the additional query, which could affect performance, but can directly add post_password = false to the arguments.

Yes, make sense. 💯 I updated the PR, please have a look.

Copy link
Contributor

@Inwerpsel Inwerpsel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants