Action: um_user_before_query

do_action( 'um_user_before_query', $args, $member_directory_class )

Fires just before the users query for getting users in member directory.

Parameters:
Name Type Description
$args array

Query arguments.

$member_directory_class object

Member Directory class. Since 2.1.0 version.

Since:
  • 2.1.0 Added `$member_directory_class` variable.
Source:
Example

Add custom arguments for query.

function my_user_before_query( $query_args, $md_class ) {
    $query_args['{custom_key}'] = 'custom_value';
}
add_action( 'um_user_before_query', 'my_user_before_query', 10, 2 );