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

		$value = get_option( $key );

		if ( false === $value ) {
			WP_CLI::halt( 1 );
		}

		$key_path = array_map(
			function( $key ) {
				if ( is_numeric( $key ) && ( (string) intval( $key ) === $key ) ) {
					return (int) $key;
				}
					return $key;
			},
			array_slice( $args, 1 )
		);

		$traverser = new RecursiveDataStructureTraverser( $value );

		try {
			$value = $traverser->get( $key_path );
		} catch ( Exception $exception ) {
			die( 1 );
		}

		WP_CLI::print_value( $value, $assoc_args );
	}
public function pluck( $args, $assoc_args ) {
		list( $key ) = $args;

		$value = get_option( $key );

		if ( false === $value ) {
			WP_CLI::halt( 1 );
		}

		$key_path = array_map(
			function( $key ) {
				if ( is_numeric( $key ) && ( (string) intval( $key ) === $key ) ) {
					return (int) $key;
				}
					return $key;
			},
			array_slice( $args, 1 )
		);

		$traverser = new RecursiveDataStructureTraverser( $value );

		try {
			$value = $traverser->get( $key_path );
		} catch ( Exception $exception ) {
			die( 1 );
		}

		WP_CLI::print_value( $value, $assoc_args );
	}
public function pluck ( $ args , $ assoc_args ) { list ( $ key ) = $ args ; $ value = get_option ( $ key ) ; if ( false === $ value ) { WP_CLI :: halt ( 1 ) ; } $ key_path = array_map ( function ( $ key ) { if ( is_numeric ( $ key ) && ( ( string ) intval ( $ key ) === $ key ) ) { return ( int ) $ key ; } return $ key ; } , array_slice ( $ args , 1 ) ) ; $ traverser = new RecursiveDataStructureTraverser ( $ value ) ; try { $ value = $ traverser -> get ( $ key_path ) ; } catch ( Exception $ exception ) { die ( 1 ) ; } WP_CLI :: print_value ( $ value , $ assoc_args ) ; }
Gets a nested value from an option.

## OPTIONS

<key>
: The option name.

<key-path>...
: The name(s) of the keys within the value to locate the value to pluck.

[--format=<format>]
: The output format of the value.
---
default: plaintext
options:
- plaintext
- json
- yaml
---
Gets a nested value from an option .