Skip to content

Instantly share code, notes, and snippets.

@everaldomatias
Created October 22, 2019 13:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save everaldomatias/573cea7ddcfb209d7eee32ab79918594 to your computer and use it in GitHub Desktop.
Save everaldomatias/573cea7ddcfb209d7eee32ab79918594 to your computer and use it in GitHub Desktop.
Função para remover um stylesheet do WordPress
<?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