public function set( $args, $assoc_args ) {
		list( $key, $value ) = $args;

		$expiration = Utils\get_flag_value( $args, 2, 0 );

		$func = Utils\get_flag_value( $assoc_args, 'network' ) ? 'set_site_transient' : 'set_transient';
		if ( $func( $key, $value, $expiration ) ) {
			WP_CLI::success( 'Transient added.' );
		} else {
			WP_CLI::error( 'Transient could not be set.' );
		}
	}
public function set( $args, $assoc_args ) {
		list( $key, $value ) = $args;

		$expiration = Utils\get_flag_value( $args, 2, 0 );

		$func = Utils\get_flag_value( $assoc_args, 'network' ) ? 'set_site_transient' : 'set_transient';
		if ( $func( $key, $value, $expiration ) ) {
			WP_CLI::success( 'Transient added.' );
		} else {
			WP_CLI::error( 'Transient could not be set.' );
		}
	}
public function set ( $ args , $ assoc_args ) { list ( $ key , $ value ) = $ args ; $ expiration = Utils \ get_flag_value ( $ args , 2 , 0 ) ; $ func = Utils \ get_flag_value ( $ assoc_args , 'network' ) ? 'set_site_transient' : 'set_transient' ; if ( $ func ( $ key , $ value , $ expiration ) ) { WP_CLI :: success ( 'Transient added.' ) ; } else { WP_CLI :: error ( 'Transient could not be set.' ) ; } }
Sets a transient value.

`<expiration>` is the time until expiration, in seconds.

For a more complete explanation of the transient cache, including the
network|site cache, please see docs for `wp transient`.

## OPTIONS

<key>
: Key for the transient.

<value>
: Value to be set for the transient.

[<expiration>]
: Time until expiration, in seconds.

[--network]
: Set the value of a network|site transient. On single site, this is
is a specially-named cache key. On multisite, this is a global cache
(instead of local to the site).

## EXAMPLES

$ wp transient set sample_key "test data" 3600
Success: Transient added.
Sets a transient value .