Api
The Api class provides an interface to various asset registration helpers.
Description Description
Contains asset api methods
Source Source
File: packages/woocommerce-blocks/src/Assets/Api.php
Changelog Changelog
Version | Description |
---|---|
2.5.0 | Introduced. |
Methods Methods
- __construct — Constructor for class
- add_inline_script — Adds an inline script, once.
- get_asset_url — Retrieve the url to an asset for this plugin.
- get_block_asset_build_path — Returns the appropriate asset path for loading either legacy builds or current builds.
- get_dependencies — Returns the dependency array for the given asset relative path.
- get_file_version — Get the file modified time as a cache buster if we're in dev mode.
- register_block_script — Queues a block script.
- register_script — Registers a script according to `wp_register_script`, additionally loading the translations for the file.
- register_style — Registers a style according to `wp_register_style`.