PHP Class WP_CLI\CommandWithMeta

Inheritance: extends WP_CLI_Command
Afficher le fichier Open project: wp-cli/wp-cli Class Usage Examples

Protected Properties

Свойство Type Description
$meta_type

Méthodes publiques

Méthode Description
add ( $args, $assoc_args ) Add a meta field.
delete ( $args, $assoc_args ) Delete a meta field.
get ( $args, $assoc_args ) Get meta field value.
list_ ( $args, $assoc_args ) List all metadata associated with an object.
update ( $args, $assoc_args ) Update a meta field.

Méthodes protégées

Méthode Description
check_object_id ( $object_id ) Check that the object ID exists

Private Methods

Méthode Description
get_fields ( ) : array Get the fields for this object's meta

Method Details

add() public méthode

## OPTIONS : The ID of the object. : The name of the meta field to create. [] : The value of the meta field. If omitted, the value is read from STDIN. [--format=] : The serialization format for the value. --- default: plaintext options: - plaintext - json ---
public add ( $args, $assoc_args )

check_object_id() protected méthode

Check that the object ID exists
protected check_object_id ( $object_id )

delete() public méthode

: The ID of the object. [] : The name of the meta field to delete. [] : The value to delete. If omitted, all rows with key will deleted. [--all] : Delete all meta for the object.
public delete ( $args, $assoc_args )

get() public méthode

: The ID of the object. : The name of the meta field to get. [--format=] : Accepted values: table, json. Default: table
public get ( $args, $assoc_args )

list_() public méthode

: ID for the object. [--keys=] : Limit output to metadata of specific keys. [--fields=] : Limit the output to specific row fields. Defaults to id,meta_key,meta_value. [--format=] : Accepted values: table, csv, json, count. Default: table
public list_ ( $args, $assoc_args )

update() public méthode

## OPTIONS : The ID of the object. : The name of the meta field to update. [] : The new value. If omitted, the value is read from STDIN. [--format=] : The serialization format for the value. --- default: plaintext options: - plaintext - json ---
public update ( $args, $assoc_args )

Property Details

$meta_type protected_oe property

protected $meta_type