WordPress提供了一个本地函数,可以很容易地查询这类内容WP_User_Query
$args = array(
\'meta_query\' => array(
\'relation\' => \'AND\',
array(
\'key\' => $meta_key1,
\'value\' => $search1,
\'compare\' => \'LIKE\'
),
array(
\'key\' => $meta_key2,
\'value\' => $search2,
\'compare\' => \'=\'
)
)
);
$user_query = new WP_User_Query( $args );