Support

Account

Forum Replies Created

  • 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'
    			)
    		)
    	));
    
  • nevermind, i found the issue.
    in order to return the correct format i need to re-save the post.

    please close the thread,

    thanks

Viewing 2 posts - 1 through 2 (of 2 total)