Skip to content
Docs
Get RestroPress

Filter

rpress_search_users_args

Updated
On this page

Filters the get_users() arguments used by the admin user search.

Runs in the search_users AJAX handler, available to users with manage_shop_settings. The arguments contain the number (9999), the search pattern built from the typed term, and an exclude list when one was posted. The result feeds get_users() and then rpress_ajax_found_users.

Parameters#

ParameterTypeDescription
$get_users_argsarrayArguments for get_users(): number, search, and optionally exclude.

Return value#

array. Arguments passed to get_users().

Example#

function my_search_users_args( $get_users_args ) {
	$get_users_args['number'] = 20;
	$get_users_args['role__in'] = array( 'customer', 'subscriber' );
	return $get_users_args;
}
add_filter( 'rpress_search_users_args', 'my_search_users_args' );

Source#

Applied in:

  • includes/class-rpress-ajax.php (line 1727), in RP_AJAX::search_users()

See also#

Was this page helpful?