Home › Forums › Add-ons › Repeater Field › searching repeater sub field value with WP_User_query › Reply To: searching repeater sub field value with WP_User_query
updated, found the solution!
there is a similar “post_where” filter for WP_User_Query, that you can filter out the repeater sub field values.
function user_meta_callback( $user_query )
{
global $wpdb;
$user_query->query_where = str_replace("meta_key = 'coupons_$", "meta_key LIKE 'coupons_%", $user_query->query_where);
}
add_filter('pre_user_query', 'user_meta_callback');
$q = new WP_User_Query(array(
'numberposts' => -1,
'meta_query' =>
array(
'relation' => 'OR',
array(
'key' => 'coupons_$_date',
'compare' => '>=',
'value' => '2018-11-01',
'type' => 'DATE'
)
)
));
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.