public function add( $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 );

		if ( Utils\get_flag_value( $assoc_args, 'autoload' ) === 'no' ) {
			$autoload = 'no';
		} else {
			$autoload = 'yes';
		}

		if ( ! add_option( $key, $value, '', $autoload ) ) {
			WP_CLI::error( "Could not add option '{$key}'. Does it already exist?" );
		} else {
			WP_CLI::success( "Added '{$key}' option." );
		}
	}
public function add( $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 );

		if ( Utils\get_flag_value( $assoc_args, 'autoload' ) === 'no' ) {
			$autoload = 'no';
		} else {
			$autoload = 'yes';
		}

		if ( ! add_option( $key, $value, '', $autoload ) ) {
			WP_CLI::error( "Could not add option '{$key}'. Does it already exist?" );
		} else {
			WP_CLI::success( "Added '{$key}' option." );
		}
	}
public function add ( $ 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 ) ; if ( Utils \ get_flag_value ( $ assoc_args , 'autoload' ) === 'no' ) { $ autoload = 'no' ; } else { $ autoload = 'yes' ; } if ( ! add_option ( $ key , $ value , '' , $ autoload ) ) { WP_CLI :: error ( "Could not add option '{$key}'. Does it already exist?" ) ; } else { WP_CLI :: success ( "Added '{$key}' option." ) ; } }
Adds a new option value.

Errors if the option already exists.

## OPTIONS

<key>
: The name of the option to add.

[<value>]
: The value of the option to add. If ommited, the value is read from STDIN.

[--format=<format>]
: The serialization format for the value.
---
default: plaintext
options:
- plaintext
- json
---

[--autoload=<autoload>]
: Should this option be automatically loaded.
---
options:
- 'yes'
- 'no'
---

## EXAMPLES

# Create an option by reading a JSON file.
$ wp option add my_option --format=json < config.json
Success: Added 'my_option' option.
Adds a new option value .