/** * Remove a previously enqueued CSS stylesheet. * * @see WP_Dependencies::dequeue() * @global WP_Styles $wp_styles The WP_Styles object for printing styles. * * @since 3.1.0 * * @param string $handle Name of the stylesheet to be removed. */ function wp_dequeue_style($handle) { global $wp_styles; if (!is_a($wp_styles, 'WP_Styles')) { if (!did_action('init')) { _doing_it_wrong(__FUNCTION__, sprintf(__('Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.'), '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>'), '3.3'); } $wp_styles = new WP_Styles(); } $wp_styles->dequeue($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); }