AssetDataRegistry::add( string $key, mixed $data, boolean $check_key_exists = false )

Interface for adding data to the registry.


Description Description

You can only register data that is not already in the registry identified by the given key. If there is a duplicate found, unless $ignore_duplicates is true, an exception will be thrown.


Parameters Parameters

$key

(Required) The key used to reference the data being registered.

$data

(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.

$check_key_exists

(Optional) If set to true, duplicate data will be ignored if the key exists. If false, duplicate data will cause an exception.

Default value: false


Top ↑

Source Source

File: packages/woocommerce-blocks/src/Assets/AssetDataRegistry.php


			


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.