[ Index ] |
PHP Cross Reference of WordPress |
[Source view] [Print] [Project Stats]
Dependencies API: WP_Dependencies base class
File Size: | 493 lines (14 kb) |
Included or required: | 1 time |
Referenced: | 0 times |
Includes or requires: | 0 files |
Class: WP_Dependencies - X-Ref
Core base class extended to register items.do_items( $handles = false, $group = false ) X-Ref |
Processes the items and dependencies. Processes the items passed to it or the queue, and their dependencies. return: string[] Array of handles of items that have been processed. param: string|string[]|false $handles Optional. Items to be processed: queue (false), param: int|false $group Optional. Group level: level (int), no group (false). since: 2.6.0 since: 2.8.0 Added the `$group` parameter. |
do_item( $handle, $group = false ) X-Ref |
Processes a dependency. return: bool True on success, false if not set. param: string $handle Name of the item. Should be unique. param: int|false $group Optional. Group level: level (int), no group (false). since: 2.6.0 since: 5.5.0 Added the `$group` parameter. |
all_deps( $handles, $recursion = false, $group = false ) X-Ref |
Determines dependencies. Recursively builds an array of items to process taking dependencies into account. Does NOT catch infinite loops. return: bool True on success, false on failure. param: string|string[] $handles Item handle (string) or item handles (array of strings). param: bool $recursion Optional. Internal flag that function is calling itself. param: int|false $group Optional. Group level: level (int), no group (false). since: 2.1.0 since: 2.6.0 Moved from `WP_Scripts`. since: 2.8.0 Added the `$group` parameter. |
add( $handle, $src, $deps = array() X-Ref |
Register an item. Registers the item if no item of that name already exists. return: bool Whether the item has been registered. True on success, false on failure. param: string $handle Name of the item. Should be unique. param: string|bool $src Full URL of the item, or path of the item relative param: string[] $deps Optional. An array of registered item handles this item depends on. param: string|bool|null $ver Optional. String specifying item version number, if it has one, param: mixed $args Optional. Custom property of the item. NOT the class property $args. since: 2.1.0 since: 2.6.0 Moved from `WP_Scripts`. |
add_data( $handle, $key, $value ) X-Ref |
Add extra item data. Adds data to a registered item. return: bool True on success, false on failure. param: string $handle Name of the item. Should be unique. param: string $key The data key. param: mixed $value The data value. since: 2.6.0 |
get_data( $handle, $key ) X-Ref |
Get extra item data. Gets data associated with a registered item. return: mixed Extra item data (string), false otherwise. param: string $handle Name of the item. Should be unique. param: string $key The data key. since: 3.3.0 |
remove( $handles ) X-Ref |
Un-register an item or items. param: string|string[] $handles Item handle (string) or item handles (array of strings). since: 2.1.0 since: 2.6.0 Moved from `WP_Scripts`. |
enqueue( $handles ) X-Ref |
Queue an item or items. Decodes handles and arguments, then queues handles and stores arguments in the class property $args. For example in extending classes, $args is appended to the item url as a query string. Note $args is NOT the $args property of items in the $registered array. param: string|string[] $handles Item handle (string) or item handles (array of strings). since: 2.1.0 since: 2.6.0 Moved from `WP_Scripts`. |
dequeue( $handles ) X-Ref |
Dequeue an item or items. Decodes handles and arguments, then dequeues handles and removes arguments from the class property $args. param: string|string[] $handles Item handle (string) or item handles (array of strings). since: 2.1.0 since: 2.6.0 Moved from `WP_Scripts`. |
recurse_deps( $queue, $handle ) X-Ref |
Recursively search the passed dependency tree for a handle. return: bool Whether the handle is found after recursively searching the dependency tree. param: string[] $queue An array of queued _WP_Dependency handles. param: string $handle Name of the item. Should be unique. since: 4.0.0 |
query( $handle, $status = 'registered' ) X-Ref |
Query the list for an item. return: bool|_WP_Dependency Found, or object Item data. param: string $handle Name of the item. Should be unique. param: string $status Optional. Status of the item to query. Default 'registered'. since: 2.1.0 since: 2.6.0 Moved from `WP_Scripts`. |
set_group( $handle, $recursion, $group ) X-Ref |
Set item group, unless already in a lower group. return: bool Not already in the group or a lower group. param: string $handle Name of the item. Should be unique. param: bool $recursion Internal flag that calling function was called recursively. param: int|false $group Group level: level (int), no group (false). since: 2.8.0 |
Generated: Thu Nov 21 01:00:03 2024 | Cross-referenced by PHPXref 0.7.1 |