Home › Forums › Add-ons › Repeater Field › Make a query to a subfield? › Reply To: Make a query to a subfield?
Hello again,
After a while i edit my code now I have a filter with is activate when someone use the subfield:
if($keyword != NULL){
add_filter('posts_where', 'filter_subfield');
}
the filter is the same on the example (except for the field of course) and after the operation, it returns:
AND wp_posts.post_type = 'film' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'private') AND ( ( wp_postmeta.meta_key LIKE 'keyword_1' AND CAST(wp_postmeta.meta_value AS CHAR) LIKE '%%' )
but the query returns 0 posts. Any ideas on how to fix it?
Thanks to anybody who helps me
Danilo
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.