BackPress enqueued dependiences class.

package BackPress
uses
since r74

 Methods

WP_Dependencies()

WP_Dependencies() 

__construct()

__construct() 

Adds item

add(string $handle, string $src, array $deps = array(), string $ver = false, $args = null) : array

Adds the item only if no item of that name already exists

Parameters

$handle

string

handle Script name

$src

string

src Script url

$deps

array

deps (optional) Array of script names on which this script depends

$ver

string

ver (optional) Script version (used for cache busting)

$args

Returns

arrayHierarchical array of dependencies

Adds extra data

add_data(string $handle, string $data_name, array $data) : boolean

Adds data only if script has already been added

Parameters

$handle

string

handle Script name

$data_name

string

data_name Name of object in which to store extra data

$data

array

data Array of extra data

Returns

booleansuccess

Determines dependencies

all_deps(mixed $handles, boolean $recursion = false, $group = false

Recursively builds array of items to process taking dependencies into account. Does NOT catch infinite loops.

Parameters

$handles

mixed

handles Accepts (string) dep name or (array of strings) dep names

$recursion

boolean

recursion Used internally when function calls itself

$group

dequeue()

dequeue($handles) 

Parameters

$handles

do_item()

do_item($handle) 

Parameters

$handle

Do the dependencies

do_items(mixed $handles = false, $group = false) : array

Process the items passed to it or the queue. Processes all dependencies.

Parameters

$handles

mixed

handles (optional) items to be processed. (void) processes queue, (string) process that item, (array of strings) process those items

$group

Returns

arrayItems that have been processed

enqueue()

enqueue($handles) 

Parameters

$handles

query()

query($handle, $list = 'registered'

Parameters

$handle

$list

remove()

remove($handles) 

Parameters

$handles

set_group()

set_group($handle, $recursion, $group) 

Parameters

$handle

$recursion

$group

 Properties

 

$args

$args 

Default

array()
 

$done

$done 

Default

array()
 

$group

$group 

Default

0
 

$groups

$groups 

Default

array()
 

$queue

$queue 

Default

array()
 

$registered

$registered 

Default

array()
 

$to_do

$to_do 

Default

array()