BackPress Scripts enqueue class.
| package | BackPress |
|---|---|
| uses | |
| since | r16 |
| inherited_from | \WP_Dependencies |
WP_Dependencies()
__construct()
| inherited_from | \WP_Dependencies::__construct() |
|---|
__construct()
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
stringhandle Script name
stringsrc Script url
arraydeps (optional) Array of script names on which this script depends
stringver (optional) Script version (used for cache busting)
arrayHierarchical array of dependenciesadd_data(string $handle, string $data_name, array $data) : boolean
Adds data only if script has already been added
stringhandle Script name
stringdata_name Name of object in which to store extra data
arraydata Array of extra data
booleansuccessall_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() |
|---|
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.
mixedhandles Accepts (string) dep name or (array of strings) dep names
booleanrecursion Used internally when function calls itself
dequeue($handles)
do_head_items()
do_item($handle, $group = false)
| inherited_from | \WP_Dependencies::do_item() |
|---|
do_item($handle)
do_items(mixed $handles= false, $group= false) : array
Process the items passed to it or the queue. Processes all dependencies.
mixedhandles (optional) items to be processed. (void) processes queue, (string) process that item, (array of strings) process those items
arrayItems that have been processedenqueue($handles)
in_default_dir($src)
localize(string $handle, string $object_name, array $l10n) : boolean
Localizes only if script has already been added
stringhandle Script name
stringobject_name Name of JS object to hold l10n info
arrayl10n Array of JS var name => localized string
booleanSuccessful localizationprint_scripts(mixed $handles= false, integer $group= false) : array
Prints the scripts passed to it or the print queue. Also prints all necessary dependencies.
mixedhandles (optional) Scripts to be printed. (void) prints queue, (string) prints that script, (array of strings) prints those scripts.
integergroup (optional) If scripts were queued in groups prints this group number.
arrayScripts that have been printedprint_scripts_l10n($handle, $echo = true)
query($handle, $list = 'registered')
remove($handles)
reset()
set_group($handle, $recursion, $group = false)
| inherited_from | \WP_Dependencies::set_group() |
|---|
set_group($handle, $recursion, $group)
$args
array()$base_url
$concat
''$concat_version
''$content_url
$default_dirs
$default_version
$do_concat
false$done
array()$ext_handles
''$ext_version
''$group
0$groups
array()$print_code
''$print_html
''$queue
array()$registered
array()$to_do
array()