wppaste
WordPress

apply_filters( 'default_role_dropdown_excluded_roles', string[] $roles_to_exclude )

Since
7.0.0
Filters the roles to be excluded from the default_role option.

Compatibility

WordPress
since 7.0.0
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in 2 of the 5 tracked releases, added in 7.0.0.

Parameters

$roles_to_excludestring[]
Array of roles to exclude from the dropdown.
Defaults to administrator and editor.

Where this hook fires · 1

  • wp-admin/options-general.php:316file scope

Source code

	 *	 * @since 7.0.0	 *	 * @param string[] $roles_to_exclude Array of roles to exclude from the dropdown.	 *                                   Defaults to administrator and editor.	 */	$excluded_roles = (array) apply_filters( 'default_role_dropdown_excluded_roles', array( 'administrator', 'editor' ) ); 	$editable_roles = array_reverse( get_editable_roles() ); 	$selected = get_option( 'default_role' ); 	foreach ( $editable_roles as $role => $details ) {

Changelog

Introduced in 7.0.0. Unchanged from 7.0.4 through 7.1.0.

  1. 7.0.4
  2. 7.1.0

Signature, return type and hooks compared across 2 parsed releases.

About this page

Parsed data
Generated from the wordpress-develop 7.1.0 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.