Home › Toolset Professional Support › [Resolved] Hide password protected post in views (blocks)
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | - | - |
13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | - | - |
Supporter timezone: America/New_York (GMT-04:00)
Tagged: Toolset Blocks, Views plugin
This topic contains 7 replies, has 2 voices.
Last updated by Christian Cox 4 years, 1 month ago.
Assisted by: Christian Cox.
As my subject says i need to publish a CPT that is passwordprotected, but what i can se is that if i publish a post with password the post is listed in forntend. is there any way how i can hide password protected post from front end ?
Now they are shown as "Protected: Titel of post"
of course i can make it as a draft, but then external visiters that have the url cant see the post if the is not logged in.
Hello, you can use a bit of custom code to filter out password-protected posts in a View's results. I posted a solution with a custom code example in another ticket: https://toolset.com/forums/topic/filter-out-hidden-posts/#post-1552601
Let me know if you have questions about this approach.
Thank you. I will try this. But i use Blocks. Not views. Can i use this code also in Blocks?
Can you pls remove the site info so its not public?
But i use Blocks. Not views. Can i use this code also in Blocks?
Yes, this custom code will work with Views created in the Blocks plugin. To find the View ID, turn on the legacy Views editor temporarily. Go to Toolset > Settings > General tab, and find the "Editing experience" option. Choose the option to enable both the Blocks editor and the legacy editor. After saving those changes, refresh the page. You will find a new menu item: Toolset > Views. When you go to Toolset > Views you can find the ID of the View you created in Blocks. Use that View ID in the custom code. When you are finished, you can go back to Toolset > Settings > General tab again to deactivate the legacy editing experience if you only want to use the Blocks editor to create Views.
Can you pls remove the site info so its not public?
There is no public site information in this ticket as far as I can tell. You can check in an incognito browser to confirm.
Thank you! it worked! 🙂
We use alot of views and alot of CPT so the komma-list is quite long 🙂
a feature-wish:
there should be a checkbox in every view to hide password protected post. 🙂
Understood! I've submitted your feature request to my 2nd tier support team and I'll update the ticket later when I get some feedback. At least for the near future, the code snippet is required to achieve this filtering behavior.
My second tier support team has submitted your feature request to our developers. I understand the need to filter out password-protected posts from Views results, so I hope this feature will be added soon. Thanks for the report 🙂