WordPress.org

Making WordPress.org

Changeset 1445


Ignore:
Timestamp:
03/21/2015 01:48:07 PM (5 years ago)
Author:
Otto42
Message:

Disable core dashicons on the theme directory, as the main header loads them instead from the CDN.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/functions.php

    r1438 r1445  
    142142}
    143143add_action( 'wp_footer', 'wporg_themes_view_templates' );
     144
     145add_action('wp_enqueue_scripts','wporg_themes_disable_dashicons');
     146function wporg_themes_disable_dashicons() {
     147    // Remove it only if the global header is used. (not e.g. chat.wordpress.org)
     148    if ( ! function_exists( 'global_wp_menu' ) ) {
     149        return;
     150    }
     151
     152    // remove it, then reregister it as empty to maintain the dependencies but not load it a second time
     153    wp_deregister_style('dashicons');
     154    wp_register_style('dashicons','');
     155}
     156
Note: See TracChangeset for help on using the changeset viewer.