wpseek.com
Bazujące na WordPress narzędzie wyszukiwania dla deweloperów i twórców motywów.



wp_ensure_editable_role › WordPress Function

Od6.8.0
Przestarzałyn/a
› wp_ensure_editable_role ( $role )
Parametry:
  • (string) $role Role the user is attempting to assign.
    Wymagane: Tak
Zdefiniowane na:
Codex:

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



Źródło

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