php 添加自定义用户角色

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了php 添加自定义用户角色相关的知识,希望对你有一定的参考价值。

/**
* Add a custom user role
*/
add_role( 'client_administrator', __(
	'Client Administrator' ),
	array(
		'read' => true, // true allows this capability
		'edit_posts' => true, // Allows user to edit their own posts
		'edit_pages' => true, // Allows user to edit pages
		'edit_others_posts' => true, // Allows user to edit others posts not just their own
		'create_posts' => true, // Allows user to create new posts
		'manage_categories' => true, // Allows user to manage post categories
		'publish_posts' => true, // Allows the user to publish, otherwise posts stays in draft mode
		'edit_themes' => false, // false denies this capability. User can’t edit your theme
		'install_plugins' => false, // User cant add new plugins
		'update_plugin' => false, // User can’t update any plugins
		'update_core' => false // user cant perform core updates
	)
);

以上是关于php 添加自定义用户角色的主要内容,如果未能解决你的问题,请参考以下文章