WP_CLI
ContextManager::register_context()
Register a context with WP-CLI.
Method of the class: ContextManager{}
No Hooks.
Return
null
. Nothing (null).
Usage
$ContextManager = new ContextManager(); $ContextManager->register_context( $name, $implementation );
- $name(string) (required)
- Name of the context.
- $implementation(Context) (required)
- Implementation of the context.
ContextManager::register_context() ContextManager::register context code WP-CLI 2.8.0-alpha
public function register_context( $name, Context $implementation ) { $this->contexts[ $name ] = $implementation; }