Skip to content

Instantly share code, notes, and snippets.

@perezdans
Last active May 21, 2017 20:39
Show Gist options
  • Save perezdans/2bc00c4aa1315a890a00ff371b89dc32 to your computer and use it in GitHub Desktop.
Save perezdans/2bc00c4aa1315a890a00ff371b89dc32 to your computer and use it in GitHub Desktop.
Hacer deregister de los estilos CSS de los dashicons para todos los visitantes salvo cuando se muestre la barra de admin para mejorar Google Page Speed Insights
<?php
// Deregister los dashicons si no se muestra la barra de admin
add_action( 'wp_print_styles', function() {
if (!is_admin_bar_showing()) wp_deregister_style( 'dashicons' );
}, 100);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment