/includes/functions.wp-scripts.php

Description

BackPress script procedural API.

  • since: r16
Functions
wp_deregister_script (line 80)

Remove a registered script.

  • see: WP_Scripts::remove() For parameter information.
  • since: r16
void wp_deregister_script ( $handle)
  • $handle
wp_enqueue_script (line 96)

Enqueues script.

Registers the script if src provided (does NOT overwrite) and enqueues.

  • see: wp_register_script() For parameter information.
  • since: r16
void wp_enqueue_script ( $handle, [ $src = false], [ $deps = array()], [ $ver = false], [ $in_footer = false])
  • $handle
  • $src
  • $deps
  • $ver
  • $in_footer
wp_localize_script (line 66)

Localizes a script.

Localizes only if script has already been added.

void wp_localize_script ( $handle,  $object_name,  $l10n)
  • $handle
  • $object_name
  • $l10n
wp_print_scripts (line 21)

Prints script tags in document head.

Called by admin-header.php and by wp_head hook. Since it is called by wp_head on every page load, the function does not instantiate the WP_Scripts object unless script names are explicitly passed. Does make use of already instantiated $wp_scripts if present. Use provided wp_print_scripts hook to register/enqueue new scripts.

  • see: WP_Dependencies::print_scripts()
  • since: r16
void wp_print_scripts ([ $handles = false])
  • $handles
wp_register_script (line 48)

Register new JavaScript file.

  • since: r16
null wp_register_script (string $handle, string $src, [array $deps = array()], [string|bool $ver = false], [bool $in_footer = false])
  • string $handle: Script name
  • string $src: Script url
  • array $deps: (optional) Array of script names on which this script depends
  • string|bool $ver: (optional) Script version (used for cache busting), set to NULL to disable
  • bool $in_footer: (optional) Wether to enqueue the script before </head> or before </body>
wp_script_is (line 122)

Check whether script has been added to WordPress Scripts.

The values for list defaults to 'queue', which is the same as enqueue for scripts.

  • since: WP unknown; BP unknown
bool wp_script_is (string $handle, [string $list = 'queue'])
  • string $handle: Handle used to add script.
  • string $list: Optional, defaults to 'queue'. Others values are 'registered', 'queue', 'done', 'to_do'

Documentation generated on Fri, 18 May 2012 01:34:01 +0100 by phpDocumentor 1.4.3