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
string
handle Script name
string
src Script url
array
deps (optional) Array of script names on which this script depends
string
ver (optional) Script version (used for cache busting)
array
Hierarchical array of dependenciesadd_data(string $handle, string $data_name, array $data) : boolean
Adds data only if script has already been added
string
handle Script name
string
data_name Name of object in which to store extra data
array
data Array of extra data
boolean
successall_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.
mixed
handles Accepts (string) dep name or (array of strings) dep names
boolean
recursion 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.
mixed
handles (optional) items to be processed. (void) processes queue, (string) process that item, (array of strings) process those items
array
Items 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
string
handle Script name
string
object_name Name of JS object to hold l10n info
array
l10n Array of JS var name => localized string
boolean
Successful localizationprint_scripts(mixed $handles= false
, integer $group= false
) : array
Prints the scripts passed to it or the print queue. Also prints all necessary dependencies.
mixed
handles (optional) Scripts to be printed. (void) prints queue, (string) prints that script, (array of strings) prints those scripts.
integer
group (optional) If scripts were queued in groups prints this group number.
array
Scripts 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()