Support

Account

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