Problem:
The user would like to display draft posts for logged-in users.
Solution:
There are two ways to achieve this:
1. Using two views, that are displayed conditionally based on the logged in users.
One view will be displayed to non logged in users.
Another view will be displayed to logged-in users. In this view, add a query filter on post status to choose the statuses that you want to display. Check this article https://toolset.com/documentation/user-guides/views/filtering-views-query-by-post-status/
2. Using one view, and altering the query filter programmatically. You can use the wpv_filter_query and if the user is logged in, add the other statuses to the view's query arguments.
Relevant Documentation:
https://toolset.com/documentation/programmer-reference/views-filters/#wpv_filter_query
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.
This topic is split from https://toolset.com/forums/topic/how-to-save-post-status-with-forms/
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
9:00 – 13:00 | 9:00 – 13:00 | 9:00 – 13:00 | 9:00 – 13:00 | - | - | 9:00 – 13:00 |
14:00 – 18:00 | 14:00 – 18:00 | 14:00 – 18:00 | 14:00 – 18:00 | - | - | 14:00 – 18:00 |
Supporter timezone: Africa/Casablanca (GMT+01:00)