PHP Class Transient_Command, wp-cli

Inheritance: extends WP_CLI_Command
Mostrar archivo Open project: wp-cli/wp-cli

Public Methods

Method Description
delete ( $args, $assoc_args ) Delete a transient value.
get ( $args, $assoc_args ) Get a transient value.
set ( $args, $assoc_args ) Set a transient value.
type ( ) Determine type of transients implementation.

Private Methods

Method Description
delete_all ( ) Delete all transients.
delete_expired ( ) Delete all expired transients.

Method Details

delete() public method

## OPTIONS [] : Key for the transient. [--network] : Delete the value of a network transient, instead of that on a single site. [--all] : Delete all transients. [--expired] : Delete all expired transients. ## EXAMPLES # Delete transient. $ wp transient delete sample_key Success: Transient deleted. # Delete expired transients. $ wp transient delete --expired Success: 12 expired transients deleted from the database. # Delete all transients. $ wp transient delete --all Success: 14 transients deleted from the database.
public delete ( $args, $assoc_args )

get() public method

## OPTIONS : Key for the transient. [--format=] : Render output in a particular format. --- default: table options: - table - csv - json - yaml --- [--network] : Get the value of the network transient, instead of the single site. ## EXAMPLES $ wp transient get sample_key test data $ wp transient get random_key Warning: Transient with key "random_key" is not set.
public get ( $args, $assoc_args )

set() public method

is the time until expiration, in seconds. ## OPTIONS : Key for the transient. : Value to be set for the transient. [] : Time until expiration, in seconds. [--network] : Set the transient value on the network, instead of single site. ## EXAMPLES $ wp transient set sample_key "test data" 3600 Success: Transient added.
public set ( $args, $assoc_args )

type() public method

Indicates whether the transients API is using an object cache or the options table. ## EXAMPLES $ wp transient type Transients are saved to the wp_options table.
public type ( )