Working with the WordPress user meta query

$args = array(
    'meta_query' => array(
        'relation' => 'AND',
            array(
                'key'     => 'occupation',
                'value'   => 'developer',
                 'compare' => 'LIKE' // any value that contains developer
            ),
            array(
                'key'     => 'billing_country',
                'value'   => 'United States',
                 'compare' => '='
            ),
            array(
                'key'     => 'experience',,
                'value'   => '5',
                 'compare' => '>='
            )
    )
);
 
$user_query = new WP_User_Query( $args );

Visto en https://usersinsights.com/wordpress-user-meta-query/

Deja un comentario

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *

Scroll al inicio

We are using cookies on our website

Please confirm, if you accept our tracking cookies. You can also decline the tracking, so you can continue to visit our website without any data sent to third party services.