wppaste
WordPress

WP_Scripts

Since
2.1.0
Source
wp-includes/class-wp-scripts.php:18
Core class used to register scripts.

Compatibility

WordPress
since 2.1.0
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in every tracked release (6.7.7 to 7.1.0).

Hooks and filters fired · 5

Every hook that fires from inside WP_Scripts, in the order it appears in the class, grouped by the method that fires it.

Properties · 14

$base_urlstringpublic
Base URL for scripts.
$content_urlstringpublic
URL of the content directory.
$default_versionstringpublic
Default version string for scripts.
$concatstringpublic
Holds a list of script handles which will be concatenated.
$concat_versionstringpublic
Holds a string which contains script handles and their version.
$do_concatboolpublic
Whether to perform concatenation.
$print_htmlstringpublic
Holds HTML markup of scripts and additional data if concatenation is enabled.
$print_codestringpublic
Holds inline code if concatenation is enabled.
$ext_handlesstringpublic
Holds a list of script handles which are not in the default directory if concatenation is enabled.
$ext_versionstringpublic
Holds a string which contains handles and versions of scripts which are not in the default directory if concatenation is enabled.
$default_dirsarraypublic
List of default directories.
$dependents_maparray<string,private
Holds a mapping of dependents (as handles) for a given script handle.
$delayed_strategiesstring[]private
Holds a reference to the delayed (non-blocking) script loading strategies.

Methods · 29

Source code

class WP_Scripts extends WP_Dependencies {	/**	 * Base URL for scripts.	 *	 * Full URL with trailing slash.	 *	 * @since 2.6.0	 * @var string	 */	public $base_url; 	/**	 * URL of the content directory.	 *	 * @since 2.8.0	 * @var string	 */	public $content_url; 	/**	 * Default version string for scripts.	 *	 * @since 2.6.0	 * @var string	 */	public $default_version; 	/**	 * Holds handles of scripts which are enqueued in footer.	 *	 * @since 2.8.0	 * @var array	 */	public $in_footer = array(); 	/**	 * Holds a list of script handles which will be concatenated.	 *	 * @since 2.8.0	 * @var string	 */	public $concat = ''; 	/**	 * Holds a string which contains script handles and their version.	 *	 * @since 2.8.0	 * @deprecated 3.4.0	 * @var string	 */	public $concat_version = ''; 	/**	 * Whether to perform concatenation.	 *	 * @since 2.8.0	 * @var bool	 */	public $do_concat = false; 	/**	 * Holds HTML markup of scripts and additional data if concatenation	 * is enabled.	 *	 * @since 2.8.0	 * @var string	 */	public $print_html = ''; 	/**	 * Holds inline code if concatenation is enabled.	 *	 * @since 2.8.0	 * @var string	 */	public $print_code = ''; 	/**	 * Holds a list of script handles which are not in the default directory	 * if concatenation is enabled.

Changelog

Introduced in 2.1.0. 3 changes between 6.7.7 and 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

6.9.7
Method is_valid_fetchpriority() added.verified against source
6.9.7
Method get_highest_fetchpriority_with_dependents() added.verified against source
6.9.7
Method get_dependency_warning_message() added.verified against source
2.1.0
Introduced.from the docblock

About this page

Parsed data
Generated from the wordpress-develop 6.9.7 tag, from src/wp-includes/class-wp-scripts.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.