Skip to content
This repository has been archived by the owner on Jul 23, 2024. It is now read-only.

Added condition to relationships #286

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

matt-antone
Copy link

using get_posts can be dangerous, since it returns the post regardless of wether the post is published or not. This was causing an issue when a related post was in draft or other mode.

I added as status check to the condition that check for instance of WP_Post before the post is added to $relationship. This has fixed the issue for me.

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

Successfully merging this pull request may close these issues.

1 participant