get_role_list filter-hookWP 4.4.0

Filters the returned array of translated role names for a user.

Usage

add_filter( 'get_role_list', 'wp_kama_get_role_list_filter', 10, 2 );

/**
 * Function for `get_role_list` filter-hook.
 * 
 * @param string[] $role_list   An array of translated user role names keyed by role.
 * @param WP_User  $user_object A WP_User object.
 *
 * @return string[]
 */
function wp_kama_get_role_list_filter( $role_list, $user_object ){

	// filter...
	return $role_list;
}
$role_list(string[])
An array of translated user role names keyed by role.
$user_object(WP_User)
A WP_User object.

Changelog

Since 4.4.0 Introduced.

Where the hook is called

WP_Users_List_Table::get_role_list()
get_role_list
wp-admin/includes/class-wp-users-list-table.php 671
return apply_filters( 'get_role_list', $role_list, $user_object );

Where the hook is used in WordPress

Usage not found.