It does not make a difference, the function still returns an error.
echo $post->ID; returns an ID of the current single post i’m viewing.
I had and idea of making a field, true/false maybe, and assign it to post edit page with location rule. As soon as the post is selected in the Relationship field and page is updated, this true/false is getting the “true” value. Then in the widget, i can use this field in WP_Query as meta_key parameter. The schema looks like this:
Relationship fields in Flexible Content (Page) → True/False field (Post) → Widget.
Do you think something like this is possible using Filters?
I just don’t have another ideas how to sort out the situation.
Thanks again for your help.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
© 2022 Advanced Custom Fields.