wp_dequeue_script() WordPress Function

The wp_dequeue_script() function allows you to remove a registered script from the queue. This can be useful if you want to dequeue a script that is not needed on the current page.

wp_dequeue_script( string $handle ) #

Remove a previously enqueued script.


Description

Top ↑

See also


Top ↑

Parameters

$handle

(string)(Required)Name of the script to be removed.


Top ↑

Source

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

function wp_dequeue_script( $handle ) {
	_wp_scripts_maybe_doing_it_wrong( __FUNCTION__, $handle );

	wp_scripts()->dequeue( $handle );
}


Top ↑

Changelog

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