example of wordpress user query with meta key and value

$user_query = new WP_User_Query( array( 'meta_key' => 'round', 'meta_value' => get_the_author_meta('round', $queried_auther->ID) ) );
$args = array(
	'meta_query' => array(
		'relation' => 'AND',
		0 => array(
			'key'     => 'round',
			'value'   => get_the_author_meta('round', $queried_auther->ID),
			'compare' => '='
		),
		1 => array(
			'key'     => 'Time',
			'value'   => 0,
			'type'    => 'numeric',
			'compare' => '>'
		)
	),
	'meta_key' => 'Time',
    'orderby'   => 'meta_value_num',
	'order' => 'DESC',
	'fields' => 'ID'
 );

 

Leave a Reply

Your email address will not be published. Required fields are marked *