首页 WordPress函数大全 add_role()

add_role()

2020-05-01 / 2210阅 / 悠然

如何你看完本文还不知道如何使用该函数,可以联系我定制视频教程,50元/个函数,学不会全额退款

add_role( string $role, string $display_name, bool[] $capabilities = array() )

Add role, if it does not exist.

描述

参数

$role

(string)
(Required)
Role name.

$display_name

(string)
(Required)
Display name for role.

$capabilities

(bool[])
(Optional)
List of capabilities keyed by the capability name, e.g. array( 'edit_posts' => true, 'delete_posts' => false ).

Default value: array()

返回

(WP_Role|null) WP_Role object if role is added, null if already exists.

大家谈论
    我的见解