assets.php
Register styles and scripts. Enqueue child theme sytylesheet.
- The child theme stylesheet (style.css) is requeued to ensure it is loaded after the parent theme styles.
- the WordPress global preset styles are dequeued to prevent conflicts with the child theme styles.
- The GeneratePress customizer dynamic styles are dequeued to prevent conflicts with the GenerateBlocks design tokens and global styles.
- The asset must NOT start with a leading slash. It is relative to the assets directory.
Tags
Table of Contents
Functions
- register_styles() : void
- Register styles.
- enqueue_assets() : void
- Enqueue the scripts and styles.
- requeue_child_assets() : void
- Dequeue and enqueue the child theme styles.
- dequeue_wp_inline_styles() : void
- Dequeue the WordPress global preset inline styles.
- dequeue_generatepress_dynamic_styles() : void
- Dequeue the GeneratePress customizer dynamic styles.
- get_asset_path() : string
- Return the asset filepath.
- get_asset_uri() : string
- Return the asset URI.
- get_asset_version() : string
- Return the version.
Functions
register_styles()
Register styles.
register_styles() : void
- The asset must NOT start with a leading slash. It is relative to the assets directory.
Tags
enqueue_assets()
Enqueue the scripts and styles.
enqueue_assets() : void
Tags
requeue_child_assets()
Dequeue and enqueue the child theme styles.
requeue_child_assets() : void
- This is necessary to ensure the child theme stylesheet is enqueued after the parent theme styles, and thus can override them.
Tags
dequeue_wp_inline_styles()
Dequeue the WordPress global preset inline styles.
dequeue_wp_inline_styles() : void
Tags
dequeue_generatepress_dynamic_styles()
Dequeue the GeneratePress customizer dynamic styles.
dequeue_generatepress_dynamic_styles() : void
Tags
get_asset_path()
Return the asset filepath.
get_asset_path(string $asset) : string
Parameters
- $asset : string
-
The target asset - no leading slash.
Tags
Return values
string —The resource filesystem path.
get_asset_uri()
Return the asset URI.
get_asset_uri(string $asset) : string
Parameters
- $asset : string
-
The target asset - no leading slash.
Tags
Return values
string —The resource URL.
get_asset_version()
Return the version.
get_asset_version(string $asset) : string
Parameters
- $asset : string
-
The fully qualified server file path of the target asset.
Tags
Return values
string —The resource version.