Having a problem with a relational post object field that is also used within a repeater field.
The Back Story
I have two custom post types setup “movie” and “trailer”. I have a the field setup to show on the movie post that relates a trailer to it.
When I add a row to the repeater, and then click on the dropdown to select a trailer, they all show up fine as far as I can tell. But when I start typing in the name of a trailer to dim down the list, it says “no results found” no matter what I type. So if the trailer name is “Movie Trailer 01” and I type in “Movie” I get “no results found”.
Linux Server (cPanel)
(not sure what else you need to know…)
I have attached some screenshots to better display what I’m talking about.
Could you have hooked a function to the
Not that I’m aware of. It was working just fine a few weeks ago, and then this happened. Other fields being used the exact same way on other post types / taxonomies are working just fine as well. Can’t seem to figure out why this one field would be having this problem.
My issue wasn’t fixed in the latest update (5.2.3). So, to explain a little more… On the same page to add a post (movie), there are two tabbed areas, one for Trailers and another for Actors. Each uses the repeater field with relational fields within (as seen in the attached images). The one for Actors works the way it should, but the one for Trailers doesn’t search properly as described in the original post.
Anyone have anything that might help me out?
Alright, so I’m happy to announce I’ve figured out the problem, and embarrassed to say it was all my fault, haha.
In functions.php I had a function set using pre get posts when a user performed a search query, allowing them to only return “movie” post types. I thought this was only affecting the front end, but it was actually affecting the entire site, backend and all. Once, I tweaked that code to basically only pre get posts for front end search queries, everything works as it should.
Stupid mistake on my part. But very happy to have this finally resolved.
Been over 4 years since this was posted, but I ran into the same issue. Had pre_get_posts filter for search without excluding admin (!is_admin()). Thanks JonJansma!
You must be logged in to reply to this topic.
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’re reaching out to our multilingual users to ask for help in translating ACF 6.1. Help make sure the latest features are available in your language here: https://t.co/TkEc2Exd6U— Advanced Custom Fields (@wp_acf) May 22, 2023
© 2023 Advanced Custom Fields.