[Resolved] Unpublished content in a relationship still appearing in views
This support ticket is created 4 years, 10 months ago. There's a good chance that you are reading advice that it now obsolete.
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.
No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.
I have a Content Type called 'Vendors' and a Content Type called 'Promotions'. These content types have a one-to-one relationship, where a Promotion can be assigned to a Vendor. There is then a View that displays all active promotions, showing vendor details, and a short description of the promotion.
When a Promotion Post is Scheduled, in Draft, or Pending review, they appear in the active promotions view as if they are published. Only trashing them removes them from being displayed.
We have over 100 promotions to schedule, so this needs to be corrected. What is the proper way of filtering out related unpublished content? This is not working as expected.
Is there a way to specifically target the post status of a related post?
No there isn't, the post status is really just filtered by that static filter for the status.
Would you mind allowing me to have admin access to the site to see what exactly is happening as your view should only be displaying the status of posts where they are published.
Did you change anything, i'm not seeing your scheduled item of "Purchase 2 meals & get a free side" all i'm seeing for scheduled is "Free drink with purchase of a dinner" and this is not showing up on the frontend search here "hidden link"
I'm also testing to see if the view actually displays scheduled items and it doesn't here hidden link
However I believe I know what is happening here.
With this you are still able to display the information of the post
<div class="wp-block-column is-vertically-aligned-center" style="flex-basis:90%">
<p>[types field='promotion-description' item='@vendor-promotion.child'][/types]</p>
</div>
Even though it has not yet been published.
What you perhaps need to do is to run a check on the post to see if it is published. Like this.
I cannot create a one-to-one relationship anymore between a promotion and vendor anymore. I've disabled the original and have tried many variations. Relationships simply do not work...