I am showing all the users by using the get_user()
function. But I need to paginate the results. I tried a lot, but didn’t succeed. Here is the code, which doesn’t work as expected:
$args = array( 'meta_query' => array(
array(
'key' => 'ib_s2member_custom_fields',
'value' => trim($_GET["country"]),
'compare' => 'LIKE'
),
array(
'key' => 'ib_s2member_custom_fields',
'value' => trim($_GET["city"]),
'compare' => 'LIKE'
),
array(
'key' => 'ib_s2member_custom_fields',
'value' => $first_name,
'compare' => 'LIKE'
),
array(
'key' => 'ib_s2member_custom_fields',
'value' => $last_name,
'compare' => 'LIKE'
)
) );
$users = get_users( $args );