All features

Cherry Blossom feature

Frontend Enqueues: Enqueue base

Defines shared asset identity, request-area and source-resolution behavior.

Defines shared asset identity, request-area and source-resolution behavior.

Capabilities and extension points

The handle for the script or style.

  • var string

Dependencies for the script or style.

  • var array

Version of the script or style.

  • var string|null

Whether the asset is for the frontend.

  • var bool

Whether the asset is for the login page.

  • var bool

Whether the asset is for the admin area.

Can be limited to specific areas by passing an array of strings.

  • var array|bool

Url for the unminified file.

  • var string

Url for the minified file.

  • var string

Location of the unminified file.

  • var string|null

Location of the minified file.

  • var string|null

Whether the location is in the parent theme.

  • var bool

Whether the asset is registered.

  • var bool

Priority of the asset.

  • var int

Initializes the asset version from the running parent-theme version.

Assigns the immutable WordPress asset handle during construction.

  • param string $handle Asset handle.

Retrieves the source file url.

  • return string The file url.

Retrieves the file location.

  • return string|null The file location.

Retrieves the source URL of the file location.

  • return string The source URL.

Parses the source URL from the location.

  • param string $location The file location.
  • return string The parsed source URL.

Retrieves the file path of the location.

  • return string The file path.

Parses the file path from the location.

  • param string $location The file location.
  • return string The parsed file path.

Parses the locations into file paths.

Updates the file and file_minified properties based on the locations.

Determines whether to use the unminified file.

  • return bool True if unminified file should be used, false otherwise.

Registers the asset.

  • return self

Enqueues the asset.

  • return self

Deregisters the asset from WordPress.

  • return self Current enqueue object for method chaining.

Replaces the current WordPress registration with this object's state.

  • return self Current enqueue object for method chaining.

Filters the WordPress registration arguments.

Implement handle-specific filtering before generic filtering, returning the resulting registration arguments.

  • param array $args Enqueue arguments.
  • return array Enqueue arguments.

Gets an exposed asset property or its version, dependency, or URL alias.

Initialize file and location properties before reading them; recognized but uninitialized typed properties can raise an Error.

  • param string $param The property name.
  • return mixed The property value or null if not found.

Checks the supported asset properties without reading unset values.

This supports version/ver and dependencies/deps aliases, but does not expose the location or URL names accepted by __get().

  • param string $param The property name.
  • return bool True if the property is set, false otherwise.

Determines if the asset is in the specified area.

  • param string $area The area to check ('frontend', 'login', 'admin').
  • param string $location The location to check.
  • return bool True if the asset is in the area, false otherwise.

Determines whether WordPress requests unminified assets.

  • return bool Value of SCRIPT_DEBUG, or false when undefined.

Source reference

This editable reference page is based on the PHP documentation in frontend/enqueues/abstract-enqueue.php.