Support

Account

Home Forums ACF PRO WP_Query based on a relationship field in a Flexible Content field. Reply To: WP_Query based on a relationship field in a Flexible Content field.

  • I temporary solved the issues by changing % by AAA

    function my_posts_where( $where ){
    $where = str_replace("meta_key = 'courses_AAA_week_day'", "meta_key LIKE 'courses_%_week_day'", $where);
        return $where;
    }
    add_filter('posts_where', 'my_posts_where');
    
    /* my query args */
    $args['meta_query']=array(array(
                    'key'       => 'courses_AAA_week_day',
                    'value'     =>  $day,
                    'compare'   => '=',
                    'type'      => 'NUMERIC'
                ));
    /* ... */