public function set( $args, $assoc_args ) {
		list( $key, $value, $group, $expiration ) = $args;
		$result = wp_cache_set( $key, $value, $group, $expiration );

		if ( false === $result ) {
			WP_CLI::error( "Could not add object '$key' in group '$group'." );
		}

		WP_CLI::success( "Set object '$key' in group '$group'." );
	}
public function set( $args, $assoc_args ) {
		list( $key, $value, $group, $expiration ) = $args;
		$result = wp_cache_set( $key, $value, $group, $expiration );

		if ( false === $result ) {
			WP_CLI::error( "Could not add object '$key' in group '$group'." );
		}

		WP_CLI::success( "Set object '$key' in group '$group'." );
	}
public function set ( $ args , $ assoc_args ) { list ( $ key , $ value , $ group , $ expiration ) = $ args ; $ result = wp_cache_set ( $ key , $ value , $ group , $ expiration ) ; if ( false === $ result ) { WP_CLI :: error ( "Could not add object '$key' in group '$group'." ) ; } WP_CLI :: success ( "Set object '$key' in group '$group'." ) ; }
Sets a value to the object cache, regardless of whether it already exists.

Errors if the value can't be set.

## OPTIONS

<key>
: Cache key.

<value>
: Value to set on the key.

[<group>]
: Method for grouping data within the cache which allows the same key to be used across groups.
---
default: default
---

[<expiration>]
: Define how long to keep the value, in seconds. `0` means as long as possible.
---
default: 0
---

## EXAMPLES

# Set cache.
$ wp cache set my_key my_value my_group 300
Success: Set object 'my_key' in group 'my_group'.
Sets a value to the object cache regardless of whether it already exists .