wpseek.com
Un motore di ricerca WordPress per sviluppatori e autori di temi



wp_ensure_editable_role › WordPress Function

Da6.8.0
Deprecaton/a
› wp_ensure_editable_role ( $role )
Parametri:
  • (string) $role Role the user is attempting to assign.
    Richiesto: Sì
Definito a:
Codex:

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



Sorgenti

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 );
	}
}