[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

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

Dependencies API: WP_Scripts class

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

Defines 1 class

WP_Scripts:: (17 methods):
  __construct()
  init()
  print_scripts()
  print_scripts_l10n()
  print_extra_script()
  do_item()
  add_inline_script()
  print_inline_script()
  localize()
  set_group()
  set_translations()
  print_translations()
  all_deps()
  do_head_items()
  do_footer_items()
  in_default_dir()
  reset()


Class: WP_Scripts  - X-Ref

Core class used to register scripts.

__construct()   X-Ref
Constructor.

since: 2.6.0

init()   X-Ref
Initialize the class.

since: 3.4.0

print_scripts( $handles = false, $group = false )   X-Ref
No description

print_scripts_l10n( $handle, $echo = true )   X-Ref
Prints extra scripts of a registered script.

since: 2.1.0
since: 2.8.0 Added the `$echo` parameter.
return: bool|string|void Void if no data exists, extra scripts if `$echo` is true, true otherwise.
param: string $handle The script's registered handle.
param: bool   $echo   Optional. Whether to echo the extra script instead of just returning it.

print_extra_script( $handle, $echo = true )   X-Ref
Prints extra scripts of a registered script.

since: 3.3.0
return: bool|string|void Void if no data exists, extra scripts if `$echo` is true, true otherwise.
param: string $handle The script's registered handle.
param: bool   $echo   Optional. Whether to echo the extra script instead of just returning it.

do_item( $handle, $group = false )   X-Ref
Processes a script dependency.

since: 2.6.0
since: 2.8.0 Added the `$group` parameter.
return: bool True on success, false on failure.
param: string    $handle The script's registered handle.
param: int|false $group  Optional. Group level: (int) level, (false) no groups. Default false.

add_inline_script( $handle, $data, $position = 'after' )   X-Ref
Adds extra code to a registered script.

since: 4.5.0
return: bool True on success, false on failure.
param: string $handle   Name of the script to add the inline script to. Must be lowercase.
param: string $data     String containing the javascript to be added.
param: string $position Optional. Whether to add the inline script before the handle

print_inline_script( $handle, $position = 'after', $echo = true )   X-Ref
Prints inline scripts registered for a specific handle.

since: 4.5.0
return: string|false Script on success, false otherwise.
param: string $handle   Name of the script to add the inline script to. Must be lowercase.
param: string $position Optional. Whether to add the inline script before the handle
param: bool   $echo     Optional. Whether to echo the script instead of just returning it.

localize( $handle, $object_name, $l10n )   X-Ref
Localizes a script, only if the script has already been added.

since: 2.1.0
return: bool True on success, false on failure.
param: string $handle      Name of the script to attach data to.
param: string $object_name Name of the variable that will contain the data.
param: array  $l10n        Array of data to localize.

set_group( $handle, $recursion, $group = false )   X-Ref
Sets handle group.

since: 2.8.0
return: bool Not already in the group or 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: int|false $group     Optional. Group level: (int) level, (false) no groups. Default false.

set_translations( $handle, $domain = 'default', $path = null )   X-Ref
Sets a translation textdomain.

since: 5.0.0
since: 5.1.0 The `$domain` parameter was made optional.
return: bool True if the text domain was registered, false if not.
param: string $handle Name of the script to register a translation domain to.
param: string $domain Optional. Text domain. Default 'default'.
param: string $path   Optional. The full file path to the directory containing translation files.

print_translations( $handle, $echo = true )   X-Ref
Prints translations set for a specific handle.

since: 5.0.0
return: string|false Script on success, false otherwise.
param: string $handle Name of the script to add the inline script to. Must be lowercase.
param: bool   $echo   Optional. Whether to echo the script instead of just returning it.

all_deps( $handles, $recursion = false, $group = false )   X-Ref
Determines script dependencies.

since: 2.1.0
return: bool True on success, false on failure.
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     Optional. Group level: (int) level, (false) no groups. Default false.

do_head_items()   X-Ref
Processes items and dependencies for the head group.

since: 2.8.0
return: string[] Handles of items that have been processed.

do_footer_items()   X-Ref
Processes items and dependencies for the footer group.

since: 2.8.0
return: string[] Handles of items that have been processed.

in_default_dir( $src )   X-Ref
Whether a handle's source is in a default directory.

since: 2.8.0
return: bool True if found, false if not.
param: string $src The source of the enqueued script.

reset()   X-Ref
Resets class properties.

since: 2.8.0



Generated: Mon Dec 16 01:00:04 2019 Cross-referenced by PHPXref 0.7.1