PHP Класс Capabilities_Command, wp-cli

## EXAMPLES # Add 'spectate' capability to 'author' role. $ wp cap add 'author' 'spectate' Success: Added 1 capability to 'author' role. # Add all caps from 'editor' role to 'author' role. $ wp cap list 'editor' | xargs wp cap add 'author' Success: Added 24 capabilities to 'author' role. # Remove all caps from 'editor' role that also appear in 'author' role. $ wp cap list 'author' | xargs wp cap remove 'editor' Success: Removed 34 capabilities from 'editor' role.
Наследование: extends WP_CLI_Command
Показать файл Открыть проект

Открытые методы

Метод Описание
add ( $args ) Add capabilities to a given role.
list_ ( $args, $assoc_args ) List capabilities for a given role.
remove ( $args ) Remove capabilities from a given role.

Приватные методы

Метод Описание
get_role ( $role )
persistence_check ( )

Описание методов

add() публичный Метод

## OPTIONS : Key for the role. ... : One or more capabilities to add. ## EXAMPLES # Add 'spectate' capability to 'author' role. $ wp cap add author spectate Success: Added 1 capability to 'author' role.
public add ( $args )

list_() публичный Метод

## OPTIONS : Key for the role. [--format=] : Render output in a particular format. --- default: list options: - list - table - csv - json - count - yaml --- ## EXAMPLES # Display alphabetical list of Contributor capabilities. $ wp cap list 'contributor' | sort delete_posts edit_posts level_0 level_1 read
public list_ ( $args, $assoc_args )

remove() публичный Метод

## OPTIONS : Key for the role. ... : One or more capabilities to remove. ## EXAMPLES # Remove 'spectate' capability from 'author' role. $ wp cap remove author spectate Success: Removed 1 capability from 'author' role.
public remove ( $args )