PHP Класс Site_Option_Command, wp-cli

## EXAMPLES # Get site registration $ wp site option get registration none # Add site option $ wp site option add my_option foobar Success: Added 'my_option' site option. # Update site option $ wp site option update my_option '{"foo": "bar"}' --format=json Success: Updated 'my_option' site option. # Delete site option $ wp site option delete my_option Success: Deleted 'my_option' site option.
Наследование: extends WP_CLI_Command
Показать файл Открыть проект

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

Метод Описание
add ( $args, $assoc_args ) Add a site option.
delete ( $args ) Delete a site option.
get ( $args, $assoc_args ) Get a site option.
list_ ( $args, $assoc_args ) List site options.
update ( $args, $assoc_args ) Update a site option.

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

Метод Описание
esc_like ( $old )

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

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

## OPTIONS : The name of the site option to add. [] : The value of the site option to add. If ommited, the value is read from STDIN. [--format=] : The serialization format for the value. --- default: plaintext options: - plaintext - json --- ## EXAMPLES # Create a site option by reading a JSON file $ wp site option add my_option --format=json < config.json Success: Added 'my_option' site option.
public add ( $args, $assoc_args )

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

## OPTIONS : Key for the site option. ## EXAMPLES $ wp site option delete my_option Success: Deleted 'my_option' site option.
public delete ( $args )

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

## OPTIONS : Key for the site option. [--format=] : Get value in a particular format. --- default: var_export options: - var_export - json - yaml --- ## EXAMPLES # Get site upload filetypes $ wp site option get upload_filetypes jpg jpeg png gif mov avi mpg
public get ( $args, $assoc_args )

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

## OPTIONS [--search=] : Use wildcards ( * and ? ) to match option name. [--field=] : Prints the value of a single field. [--fields=] : Limit the output to specific object fields. [--format=] : The serialization format for the value. total_bytes displays the total size of matching options in bytes. --- default: table options: - table - json - csv - count - yaml - total_bytes --- ## AVAILABLE FIELDS This field will be displayed by default for each matching option: * meta_key * meta_value These fields are optionally available: * meta_id * site_id * size_bytes ## EXAMPLES # List all site options begining with "i2f_" $ wp site option list --search="i2f_*" +-------------+--------------+ | meta_key | meta_value | +-------------+--------------+ | i2f_version | 0.1.0 | +-------------+--------------+
public list_ ( $args, $assoc_args )

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

## OPTIONS : The name of the site option to update. [] : The new value. If ommited, the value is read from STDIN. [--format=] : The serialization format for the value. --- default: plaintext options: - plaintext - json --- ## EXAMPLES # Update a site option by reading from a file $ wp site option update my_option < value.txt Success: Updated 'my_option' site option.
public update ( $args, $assoc_args )