Answers for "ultimante member query filters directory"

0

ultimante member query filters directory

add_filter("um_prepare_user_query_args","um_custom_prepare_user_query_args", 9999 );
function um_custom_prepare_user_query_args( $args ) {
	
	$args['meta_query'][ ] = array(
			'relation' => 'OR',
		   	'featured_clause' => array(
				'key' => 'is_featured',
				'value' => '1',
				'compare' => '='
		   	),
		   	array(
				"key" => 'is_featured',
				"compare" => "NOT EXISTS"
		   	)
	);

	$args['orderby'] = array(
		'featured_clause' => 'ASC',
		
	); 
	
	return $args;
}
Posted by: Guest on February-17-2021

Browse Popular Code Answers by Language