[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

title

Body

[close]

/wp-includes/ -> class.wp-dependencies.php (summary)

Dependencies API: WP_Dependencies base class

File Size: 413 lines (12 kb)
Included or required: 1 time
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

WP_Dependencies:: (12 methods):
  do_items()
  do_item()
  all_deps()
  add()
  add_data()
  get_data()
  remove()
  enqueue()
  dequeue()
  recurse_deps()
  query()
  set_group()


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.

param: mixed $handles Optional. Items to be processed: Process queue (false), process item (string), process items (array of strings).
param: mixed $group   Group level: level (int), no groups (false).
return: array Handles of items that have been processed.

do_item( $handle )   X-Ref
Processes a dependency.

param: string $handle Name of the item. Should be unique.
return: bool True on success, false if not set.

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.

param: mixed     $handles   Item handle and argument (string) or item handles and arguments (array of strings).
param: bool      $recursion Internal flag that function is calling itself.
param: int|false $group     Group level: (int) level, (false) no groups.
return: bool True on success, false on failure.

add( $handle, $src, $deps = array()   X-Ref
Register an item.

Registers the item if no item of that name already exists.

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 to the WordPress root directory.
param: string[]         $deps   Optional. An array of registered item handles this item depends on. Default empty array.
param: string|bool|null $ver    Optional. String specifying item version number, if it has one, which is added to the URL
param: mixed            $args   Optional. Custom property of the item. NOT the class property $args. Examples: $media, $in_footer.
return: bool Whether the item has been registered. True on success, false on failure.

add_data( $handle, $key, $value )   X-Ref
Add extra item data.

Adds data to a registered item.

param: string $handle Name of the item. Should be unique.
param: string $key    The data key.
param: mixed  $value  The data value.
return: bool True on success, false on failure.

get_data( $handle, $key )   X-Ref
Get extra item data.

Gets data associated with a registered item.

param: string $handle Name of the item. Should be unique.
param: string $key    The data key.
return: mixed Extra item data (string), false otherwise.

remove( $handles )   X-Ref
Un-register an item or items.

param: mixed $handles Item handle and argument (string) or item handles and arguments (array of strings).
return: void

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: mixed $handles Item handle and argument (string) or item handles and arguments (array of strings).

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: mixed $handles Item handle and argument (string) or item handles and arguments (array of strings).

recurse_deps( $queue, $handle )   X-Ref
Recursively search the passed dependency tree for $handle

param: string[] $queue  An array of queued _WP_Dependency handles.
param: string   $handle Name of the item. Should be unique.
return: bool Whether the handle is found after recursively searching the dependency tree.

query( $handle, $list = 'registered' )   X-Ref
Query list for an item.

param: string $handle Name of the item. Should be unique.
param: string $list   Property name of list array.
return: bool|_WP_Dependency Found, or object Item data.

set_group( $handle, $recursion, $group )   X-Ref
Set item group, unless already in 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: mixed  $group     Group level.
return: bool Not already in the group or a lower group



Generated: Tue Oct 22 08:20:01 2019 Cross-referenced by PHPXref 0.7