get_user can’t read variable
Needs double quotes $WhoIsUser = get_users( array( ‘meta_key’ => ‘deviceid’, ‘meta_value’ => “$deviceid” ) );
Needs double quotes $WhoIsUser = get_users( array( ‘meta_key’ => ‘deviceid’, ‘meta_value’ => “$deviceid” ) );
Can you try changing ‘type’ => ‘NUMERIC’ to ‘type’ => ‘DATE’ ? Reference: https://codex.wordpress.org/Class_Reference/WP_Meta_Query
try changing ‘orderby’ => ‘meta_value_num’ to ‘orderby’ => ‘meta_value meta_value_num’
Not sure if it helps you any, but I think splitting this into two simple queries is a simple way to do it but then requires some extra work to be able to display two $query results sequentially. This may also be better for users as you could make it clear that you’re showing them … Read more
How to do WP_User_Query for Nested Array value Inside Nested Array field
Query posts by current ACF meta key value on single page as related posts
This is waaaay after the fact, but maybe it’ll help someone else. You’re looking for an IN comparison here – where the value is IN a group of values. Here’s what it’d look like: $args[‘meta_query’][] = [ ‘key’ => ‘antivirus_antivirus_featured_scaning’, ‘value’ => [‘scheduled_scan’,’anti_spyware’,’anti_worm’], ‘compare’ => ‘IN’ ]; Read more about it here: https://developer.wordpress.org/reference/classes/wp_query/#custom-field-post-meta-parameters =]
Multiple meta_query not returning rows
Generally, no, there is not a good way to achieve this if the sort order doesn’t produce things automatically in the order you need them. This is because WP_Query doesn’t allow for insertion of logic to say ‘order by fieldX except if $some_condition’ Somewhere, you’re going to have to write the logic for the order … Read more
Multiple WP_Query args combinations according to post type