WordPress.org

Ready to get started?Download WordPress

Codex

Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Class Reference/ WP Dependency


Contents

Description

_WP_Dependency is a class defined in wp-includes/class.wp-dependencies.php that holds information about an items in a WP_Dependencies queue. This class is internal to WP_Dependencies.

Args vs Extra

There are two different properties that hold additional information for an item: $args and $extra. The former is a scalar that holds registration data (data provided when the item was added to the dependency queue). For example, $args for WP_Styles holds the stylesheet media, whereas for WP_Scripts, it's a dependency group. $extra is an array that holds arbitrary data added via add_data(). For example, it can hold the title of a stylesheet or raw style rules.

Methods and Properties

Properties

$handle 
item identifier.
$src 
URL associated with item (in practice, items are web resources).
$deps 
handles of other items that this items depends on.
$ver = FALSE 
version for item
$args = NULL 
extra information provided when item was registered.
$extra 
Array of extra data.

Methods

add_data( $key, $value ) 
Adds extra data to an item.

Examples

Change Log

Since 2.6.

Source File

_WP_Dependency is located in wp-includes/class.wp-dependencies.php.

See also index of Class Reference and index of Function Reference.