AssetDataRegistry
Class instance for registering data used on the current view session by assets.
Description Description
Holds data registered for output on the current view session when wc-settings
is enqueued( directly or via dependency )
Source Source
File: packages/woocommerce-blocks/src/Assets/AssetDataRegistry.php
Changelog Changelog
Version | Description |
---|---|
2.5.0 | Introduced. |
Methods Methods
- __construct — Constructor
- add — Interface for adding data to the registry.
- add_data — See self::add() for docs.
- debug — Exposes whether the current site is in debug mode or not.
- enqueue_asset_data — Callback for enqueuing asset data via the WP api.
- execute_lazy_data — Loops through each registered lazy data callback and adds the returned value to the data array.
- exists — Allows checking whether a key exists.
- format_page_resource — Format a page object into a standard array of data.
- get — Exposes private registered data to child classes.
- get_core_data — Exposes core data via the wcSettings global. This data is shared throughout the client.
- get_currency_data — Get currency data to include in settings.
- get_locale_data — Get locale data to include in settings.
- get_order_statuses — Returns block-related data for enqueued wc-settings script.
- get_store_pages — Get store pages to include in settings.
- hydrate_api_request — Hydrate from API.
- init — Hook into WP asset registration for enqueueing asset data.
- initialize_core_data — Used for on demand initialization of asset data and registering it with the internal data registry.
- register_data_script — Callback for registering the data script via WordPress API.
- register_page_id — Adds a page permalink to the data registry.