Making WordPress.org

Changeset 13715


Ignore:
Timestamp:
05/16/2024 05:49:08 AM (5 months ago)
Author:
akirk
Message:

wporg-gp-customizations: fix wp_enqueue_admin_bar_header_styles notice, remove Jetpack stats as they are loaded already in the global header

Fixes #7640

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/inc/class-plugin.php

    r12985 r13715  
    8787        add_action( 'admin_bar_init', array( $this, 'show_admin_bar' ) );
    8888        add_action( 'add_admin_bar_menus', array( $this, 'remove_admin_bar_menus' ) );
    89 
    90         add_action( 'template_redirect', array( $this, 'jetpack_stats' ), 1 );
    9189
    9290        // Load the API endpoints.
     
    527525
    528526    /**
    529      * Adds support for Jetpack Stats.
    530      */
    531     public function jetpack_stats() {
    532         if ( ! function_exists( 'stats_hide_smile_css' ) ) {
    533             return;
    534         }
    535 
    536         add_action( 'gp_head', 'stats_hide_smile_css' );
    537         add_action( 'gp_head', 'stats_admin_bar_head', 100 );
    538         add_action( 'gp_footer', array( 'Automattic\Jetpack\Stats\Tracking_Pixel', 'add_to_footer' ), 101 );
    539     }
    540 
    541     /**
    542527     * Makes admin bar compatible with GlotPress' custom header
    543528     * and script loader.
    544529     */
    545530    public function show_admin_bar() {
    546         add_action( 'gp_head', 'wp_admin_bar_header' );
     531        add_action( 'gp_head', 'wp_enqueue_admin_bar_header_styles' );
    547532        add_action( 'gp_head', '_admin_bar_bump_cb' );
    548533
Note: See TracChangeset for help on using the changeset viewer.