WP_CLI\Bootstrap
BootstrapState::getValue
Get the state value for a given key.
Method of the class: BootstrapState{}
No Hooks.
Returns
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() BootstrapState::getValue code WP-CLI 2.13.0-alpha
public function getValue( $key, $fallback = null ) {
return array_key_exists( $key, $this->state )
? $this->state[ $key ]
: $fallback;
}