pfeifferNet

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
since
0.0.0

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
since
0.0.0
0.2.0

Improve style dependencies.

2.0.0

Improve asset handling and versioning.

enqueue_assets()

Enqueue the scripts and styles.

enqueue_assets() : void
Tags
since
0.0.0

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
since
2.0.0

dequeue_wp_inline_styles()

Dequeue the WordPress global preset inline styles.

dequeue_wp_inline_styles() : void
Tags
since
3.0.0

dequeue_generatepress_dynamic_styles()

Dequeue the GeneratePress customizer dynamic styles.

dequeue_generatepress_dynamic_styles() : void
Tags
since
3.0.0

get_asset_path()

Return the asset filepath.

get_asset_path(string $asset) : string
Parameters
$asset : string

The target asset - no leading slash.

Tags
since
0.2.0
2.0.0

Improve asset handling and versioning.

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
since
0.2.0
2.0.0

Improve asset handling and versioning.

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
since
0.0.0
Return values
string

The resource version.


        
On this page

Search results