How to search usermeta table

This works: $WhoIsUser = get_users( array( ‘meta_key’ => ‘deviceid’, ‘meta_value’ => ‘45545’ ) ); This returns the whole row for that user from the users table. If you print_r it out like so: echo ‘<pre>’ echo print_r($WhoIsUser, TRUE); echo ‘</pre>’ you get: Array ( [0] => WP_User Object ( [data] => stdClass Object ( [ID] … Read more

WP_Query multiple value not working

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 =]

Query custom post type custom meta key

Now i got this code and i works. function get_events( ) { $recurrence_ids = get_post_custom_values( ‘_recurrence_id’ ); $recurrence_id = $recurrence_ids[0]; $the_query_args = array( ‘posts_per_page’ => -1, ‘post_type’ => ‘event’, ‘meta_key’ => ‘_recurrence_id’, ‘meta_value’ => $recurrence_id ); $the_query = new WP_Query( $the_query_args ); if ( $the_query->have_posts() ) { $output=”<div class=”weitere-termine”>”; while ( $the_query->have_posts() ) { $the_query->the_post(); … Read more