public function update( $args, $assoc_args ) {
		$key = $args[0];

		$value = WP_CLI::get_value_from_arg_or_stdin( $args, 1 );
		$value = WP_CLI::read_value( $value, $assoc_args );

		$value     = sanitize_option( $key, $value );
		$old_value = sanitize_option( $key, get_site_option( $key ) );

		if ( $value === $old_value ) {
			WP_CLI::success( "Value passed for '{$key}' site option is unchanged." );
		} else {
			if ( update_site_option( $key, $value ) ) {
				WP_CLI::success( "Updated '{$key}' site option." );
			} else {
				WP_CLI::error( "Could not update site option '{$key}'." );
			}
		}
	}
public function update( $args, $assoc_args ) {
		$key = $args[0];

		$value = WP_CLI::get_value_from_arg_or_stdin( $args, 1 );
		$value = WP_CLI::read_value( $value, $assoc_args );

		$value     = sanitize_option( $key, $value );
		$old_value = sanitize_option( $key, get_site_option( $key ) );

		if ( $value === $old_value ) {
			WP_CLI::success( "Value passed for '{$key}' site option is unchanged." );
		} else {
			if ( update_site_option( $key, $value ) ) {
				WP_CLI::success( "Updated '{$key}' site option." );
			} else {
				WP_CLI::error( "Could not update site option '{$key}'." );
			}
		}
	}
public function update ( $ args , $ assoc_args ) { $ key = $ args [ 0 ] ; $ value = WP_CLI :: get_value_from_arg_or_stdin ( $ args , 1 ) ; $ value = WP_CLI :: read_value ( $ value , $ assoc_args ) ; $ value = sanitize_option ( $ key , $ value ) ; $ old_value = sanitize_option ( $ key , get_site_option ( $ key ) ) ; if ( $ value === $ old_value ) { WP_CLI :: success ( "Value passed for '{$key}' site option is unchanged." ) ; } else { if ( update_site_option ( $ key , $ value ) ) { WP_CLI :: success ( "Updated '{$key}' site option." ) ; } else { WP_CLI :: error ( "Could not update site option '{$key}'." ) ; } } }
Updates a site option.

## OPTIONS

<key>
: The name of the site option to update.

[<value>]
: The new value. If ommited, the value is read from STDIN.

[--format=<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.

@alias set
Updates a site option .