WP_CLI\Bootstrap

BootstrapState::getValue()publicWP-CLI 1.0

Get the state value for a given key.

Method of the class: BootstrapState{}

No Hooks.

Return

Mixed.

Usage

$BootstrapState = new BootstrapState();
$BootstrapState->getValue( $key, $fallback );
$key(string) (required)
Key to get the state from.
$fallback(mixed)
Fallback value to use if the key is not defined.
Default: null

BootstrapState::getValue() code WP-CLI 2.8.0-alpha

public function getValue( $key, $fallback = null ) {
	return array_key_exists( $key, $this->state )
		? $this->state[ $key ]
		: $fallback;
}