Home › Forums › Front-end Issues › ACF Search in Post Object › Reply To: ACF Search in Post Object
A post object field only stores the post ID of the post object and not the name. Since the name of the post is not associated with the posts you are searching (“events”) you cannot search by the name.
To do this you need to create an acf/save_post filter. In this filter you get the related post object and update some other field to hole the post name and then you search using this other custom field. I usually do not use an ACF field for this and just use update_post_meta() and use a meta key that will not conflict with other field names.
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!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.