BackPress Scripts enqueue class.

package BackPress
uses
since r16
inherited_from \WP_Dependencies

 Methods

WP_Dependencies()

WP_Dependencies() 
Inherited

__construct()

__construct() 
inherited_from \WP_Dependencies::__construct()

__construct()

__construct() 
Inherited

Adds item

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

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
Inherited

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($handles, $recursion = false, $group = false

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

inherited_from \WP_Dependencies::all_deps()

Parameters

$handles

$recursion

$group

Determines dependencies

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

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) 
Inherited

Parameters

$handles

do_head_items()

do_head_items() 

do_item()

do_item($handle, $group = false
inherited_from \WP_Dependencies::do_item()

Parameters

$handle

$group

do_item()

do_item($handle) 
Inherited

Parameters

$handle

Do the dependencies

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

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) 
Inherited

Parameters

$handles

in_default_dir()

in_default_dir($src) 

Parameters

$src

Localizes a script

localize(string $handle, string $object_name, array $l10n) : boolean

Localizes only if script has already been added

Parameters

$handle

string

handle Script name

$object_name

string

object_name Name of JS object to hold l10n info

$l10n

array

l10n Array of JS var name => localized string

Returns

booleanSuccessful localization

Prints scripts

print_scripts(mixed $handles = false, integer $group = false) : array

Prints the scripts passed to it or the print queue. Also prints all necessary dependencies.

Parameters

$handles

mixed

handles (optional) Scripts to be printed. (void) prints queue, (string) prints that script, (array of strings) prints those scripts.

$group

integer

group (optional) If scripts were queued in groups prints this group number.

Returns

arrayScripts that have been printed

print_scripts_l10n()

print_scripts_l10n($handle, $echo = true

Parameters

$handle

$echo

query()

query($handle, $list = 'registered'
Inherited

Parameters

$handle

$list

remove()

remove($handles) 
Inherited

Parameters

$handles

reset()

reset() 

set_group()

set_group($handle, $recursion, $group = false
inherited_from \WP_Dependencies::set_group()

Parameters

$handle

$recursion

$group

set_group()

set_group($handle, $recursion, $group) 
Inherited

Parameters

$handle

$recursion

$group

 Properties

 

$args

$args 

Default

array()
 

$base_url

$base_url 

Default

 

$concat

$concat 

Default

''
 

$concat_version

$concat_version 

Default

''
 

$content_url

$content_url 

Default

 

$default_dirs

$default_dirs 

Default

 

$default_version

$default_version 

Default

 

$do_concat

$do_concat 

Default

false
 

$done

$done 

Default

array()
 

$ext_handles

$ext_handles 

Default

''
 

$ext_version

$ext_version 

Default

''
 

$group

$group 

Default

0
 

$groups

$groups 

Default

array()
   

$print_code

$print_code 

Default

''
 

$print_html

$print_html 

Default

''
 

$queue

$queue 

Default

array()
 

$registered

$registered 

Default

array()
 

$to_do

$to_do 

Default

array()