From ab8bf0a05e97b6d0147aca45d65d3f1ac53d5a7d Mon Sep 17 00:00:00 2001 From: markjaquith Date: Thu, 9 Sep 2010 04:42:47 +0000 Subject: [PATCH] wp_dequeue_script() and wp_dequeue_style(). fixes #14815. props scribu git-svn-id: http://svn.automattic.com/wordpress/trunk@15601 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/functions.wp-scripts.php | 14 ++++++++++++++ wp-includes/functions.wp-styles.php | 14 ++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/wp-includes/functions.wp-scripts.php b/wp-includes/functions.wp-scripts.php index 90e7a0b020..af2055d37b 100644 --- a/wp-includes/functions.wp-scripts.php +++ b/wp-includes/functions.wp-scripts.php @@ -107,6 +107,20 @@ function wp_enqueue_script( $handle, $src = false, $deps = array(), $ver = false $wp_scripts->enqueue( $handle ); } +/** + * Remove an enqueued script. + * + * @since WP 3.1 + * @see WP_Scripts::dequeue() For parameter information. + */ +function wp_dequeue_script( $handle ) { + global $wp_scripts; + if ( !is_a($wp_scripts, 'WP_Scripts') ) + $wp_scripts = new WP_Scripts(); + + $wp_scripts->dequeue( $handle ); +} + /** * Check whether script has been added to WordPress Scripts. * diff --git a/wp-includes/functions.wp-styles.php b/wp-includes/functions.wp-styles.php index df4bd5ac42..630a112de5 100644 --- a/wp-includes/functions.wp-styles.php +++ b/wp-includes/functions.wp-styles.php @@ -105,6 +105,20 @@ function wp_enqueue_style( $handle, $src = false, $deps = array(), $ver = false, $wp_styles->enqueue( $handle ); } +/** + * Remove an enqueued style. + * + * @since WP 3.1 + * @see WP_Styles::dequeue() For parameter information. + */ +function wp_dequeue_style( $handle ) { + global $wp_styles; + if ( !is_a($wp_styles, 'WP_Styles') ) + $wp_styles = new WP_Styles(); + + $wp_styles->dequeue( $handle ); +} + /** * Check whether style has been added to WordPress Styles. *