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.


Top ↑

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


Top ↑

Return

(string[]) Handles of scripts that have been printed.


Top ↑

Source

File: wp-includes/class.wp-scripts.php

	public function print_scripts( $handles = false, $group = false ) {
		return $this->do_items( $handles, $group );
	}

Top ↑

Changelog

Changelog
VersionDescription
2.8.0Added the $group parameter.
2.1.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.