remove_role() - WordPress 函数参考中文文档

返回介绍

remove_role()

发布于 2017-09-11 字数1397 浏览 810 评论 0

remove_role( string $role )

Remove role, if it exists.


描述


参数

$role

(string)
(Required)
Role name.


源代码

File: wp-includes/capabilities.php

function remove_role( $role ) {
	wp_roles()->remove_role( $role );
}

更新日志

Version 描述
2.0.0 Introduced.

相关函数

Uses

  • wp-includes/capabilities.php:
    wp_roles()
  • wp-includes/class-wp-roles.php:
    WP_Roles::remove_role()

User Contributed Notes

  1. Skip to note content

    You must log in to vote on the helpfulness of this noteVote results for this note: 0You must log in to vote on the helpfulness of this note

    Contributed by Codex

    Example
    Remove the ‘subscriber’ role if it exists.

    
    <?php remove_role( 'subscriber' ); ?>
    
    

上一篇:remove_rewrite_tag()

下一篇:remove_shortcode()

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

目前还没有任何评论,快来抢沙发吧!