default_role_dropdown_excluded_roles filter-hookWP 7.0.0

Filters the roles to be excluded from the default_role option.

Usage

add_filter( 'default_role_dropdown_excluded_roles', 'wp_kama_default_role_dropdown_excluded_roles_filter' );

/**
 * Function for `default_role_dropdown_excluded_roles` filter-hook.
 * 
 * @param string[] $roles_to_exclude Array of roles to exclude from the dropdown.
 *
 * @return string[]
 */
function wp_kama_default_role_dropdown_excluded_roles_filter( $roles_to_exclude ){

	// filter...
	return $roles_to_exclude;
}
$roles_to_exclude(string[])
Array of roles to exclude from the dropdown.
Default: administrator and editor

Changelog

Since 7.0.0 Introduced.

Where the hook is called

In file: /wp-admin/options-general.php
default_role_dropdown_excluded_roles
wp-admin/options-general.php 316
$excluded_roles = (array) apply_filters( 'default_role_dropdown_excluded_roles', array( 'administrator', 'editor' ) );

Where the hook is used in WordPress

Usage not found.