wp_deregister_style( string $handle )
Remove a registered stylesheet.
Description Description
See also See also
Parameters Parameters
- $handle
-
(string) (Required) Name of the stylesheet to be removed.
Source Source
File: wp-includes/functions.wp-styles.php
function wp_deregister_style( $handle ) {
_wp_scripts_maybe_doing_it_wrong( __FUNCTION__ );
wp_styles()->remove( $handle );
}
Expand full source code Collapse full source code View on Trac
Changelog Changelog
| Version | Description |
|---|---|
| 2.1.0 | Introduced. |
User Contributed Notes User Contributed Notes
You must log in before being able to contribute a note or feedback.
Example:
add_action( 'wp_enqueue_scripts', 'remove_default_stylesheet', 20 ); function remove_default_stylesheet() { wp_dequeue_style( 'original-enqueue-stylesheet-handle' ); wp_deregister_style( 'original-register-stylesheet-handle' ); wp_register_style( 'new-style', get_stylesheet_directory_uri() . '/new.css', false, '1.0.0' ); wp_enqueue_style( 'new-style' ); }