wpseek.com
WordPress开发者和主题制作者的搜索引擎



wp_ensure_editable_role › WordPress Function

Since6.8.0
已弃用n/a
› wp_ensure_editable_role ( $role )
参数:
  • (string) $role Role the user is attempting to assign.
    Required: Yes
定义在:
文档:

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



源码

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