wp_enqueue_scripts() WordPress Function

The wp_enqueue_scripts function is used to load external scripts onto your WordPress site. This function is typically used to load jQuery, JavaScript files, and CSS stylesheets. The wp_enqueue_scripts function should be called within the wp_head() function.

wp_enqueue_scripts() #

Wrapper for do_action( ‘wp_enqueue_scripts’ ).


Description

Allows plugins to queue scripts for the front end using wp_enqueue_script(). Runs first in wp_head() where all is_home(), is_page(), etc. functions are available.


Top ↑

Source

File: wp-includes/script-loader.php

function wp_enqueue_scripts() {
	/**
	 * Fires when scripts and styles are enqueued.
	 *
	 * @since 2.8.0
	 */
	do_action( 'wp_enqueue_scripts' );
}


Top ↑

Changelog

Changelog
VersionDescription
2.8.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.

Show More