wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren



wp_ensure_editable_role › WordPress Function

Seit6.8.0
Veraltetn/v
wp_ensure_editable_role ( $role )
Parameter:
  • (string) $role Role the user is attempting to assign.
    Erforderlich: Ja
Definiert in:
Codex:

Stop execution if the role can not be assigned by the current user.



Quellcode

function wp_ensure_editable_role( $role ) {
	$roles = get_editable_roles();
	if ( ! isset( $roles[ $role ] ) ) {
		wp_die( __( 'Sorry, you are not allowed to give users that role.' ), 403 );
	}
}