Created
October 22, 2019 13:33
-
-
Save everaldomatias/573cea7ddcfb209d7eee32ab79918594 to your computer and use it in GitHub Desktop.
Função para remover um stylesheet do WordPress
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* | |
* Função para remover um stylesheet do WordPress. | |
* Por padrão o WordPress imprime o ID do style na tag <link> com um sufixo -css, exemplo 'theme-media-css', nesse caso o ID é apenas 'theme-media' | |
* | |
* @author Everaldo Matias <https://everaldo.dev> | |
* @uses Aplique no functions.php do seu tema (ou plugin) | |
* @since 20191022 | |
* | |
*/ | |
function the_remove_wp_style() { | |
wp_dequeue_style( 'id-of-the-style' ); | |
} | |
add_action( 'wp_print_styles', 'the_remove_wp_style', 999 ); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment