WordPress.org

Making WordPress.org

Changeset 8266


Ignore:
Timestamp:
02/18/2019 08:20:38 AM (8 months ago)
Author:
dd32
Message:

Developer Theme: Remove the removing of dashicons.

The global header no longer enqueues dashicons if the WordPress has enqueued it.

H/t sebastienserre, daveshine.

See #4179.
Fixes #4182.

File:
1 edited

Legend:

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

    r8207 r8266  
    132132add_action( 'init', __NAMESPACE__ . '\\init' );
    133133add_action( 'widgets_init', __NAMESPACE__ . '\\widgets_init' );
    134 add_action( 'wp_default_styles', __NAMESPACE__ . '\\remove_dashicons_styles', 11 );
    135134
    136135function init() {
     
    156155
    157156    add_filter( 'syntaxhighlighter_htmlresult', __NAMESPACE__ . '\\syntaxhighlighter_htmlresult' );
    158 }
    159 
    160 /**
    161  * Makes 'dashicons' a noop script on the frontend to prevent getting enqueued.
    162  *
    163  * The global W.org header already includes the dashicons stylesheet.
    164  *
    165  * @param WP_Scripts $scripts WP_Scripts object.
    166  */
    167 function remove_dashicons_styles( &$scripts ) {
    168     if ( ! is_admin() ) {
    169         $scripts->remove( 'dashicons' );
    170         $scripts->add( 'dashicons', '' );
    171     }
    172157}
    173158
Note: See TracChangeset for help on using the changeset viewer.