Automattic\WooCommerce\Blocks\Assets
AssetDataRegistry::add() public WC 1.0
Interface for adding data to the registry.
{} It's a method of the class: AssetDataRegistry{}
No Hooks.
Return
Null. Nothing.
Usage
$AssetDataRegistry = new AssetDataRegistry(); $AssetDataRegistry->add( $key, $data );
- $key(string) (required)
- The key used to reference the data being registered. You can only register data that is not already in the registry identified by the given key.
- $data(mixed) (required)
- If not a function, registered to the registry as is. If a function, then the callback is invoked right before output to the screen.
Code of AssetDataRegistry::add() AssetDataRegistry::add WC 5.0.0
public function add( $key, $data ) {
try {
$this->add_data( $key, $data );
} catch ( Exception $e ) {
if ( $this->debug() ) {
// bubble up.
throw $e;
}
wc_caught_exception( $e, __METHOD__, [ $key, $data ] );
}
}