WP_Scripts::print_scripts() WordPress Method
The WP_Scripts::print_scripts() method is used to print the scripts that have been enqueued for the current page. This includes the scripts that have been registered with WordPress, as well as any scripts that have been enqueued via the wp_enqueue_script() function.
WP_Scripts::print_scripts( string|string[]|false $handles = false, int|false $group = false ) #
Prints scripts.
Description
Prints the scripts passed to it or the print queue. Also prints all necessary dependencies.
Parameters
- $handles
(string|string[]|false)(Optional) Scripts to be printed: queue (false), single script (string), or multiple scripts (array of strings).
Default value: false
- $group
(int|false)(Optional) Group level: level (int), no groups (false).
Default value: false
Return
(string[]) Handles of scripts that have been printed.
Source
File: wp-includes/class.wp-scripts.php
public function print_scripts( $handles = false, $group = false ) { return $this->do_items( $handles, $group ); }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
2.8.0 | Added the $group parameter. |
2.1.0 | Introduced. |