Making WordPress.org


Ignore:
Timestamp:
10/17/2019 05:16:38 AM (6 years ago)
Author:
dd32
Message:

WordPress.org: Load Google Tag Manager through an mu-plugin rather than loading it manually in many themes.

See #4625.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-main/page-download-counter.php

    r8277 r9195  
    6666    number_format_i18n( $num )
    6767);
     68
     69// Remove some headers we don't need:
     70remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
     71remove_action( 'wp_head', 'wp_print_styles', 8 );
     72remove_action( 'wp_head', 'wp_print_head_scripts', 9 );
     73remove_action( 'wp_head', '_admin_bar_bump_cb' );
    6874
    6975?>
     
    7682    <meta name="viewport" content="width=device-width,initial-scale=1.0">
    7783    <link rel="canonical" href="<?php echo esc_url( $canonical_url ); ?>">
    78     <link rel="dns-prefetch" href="//www.googletagmanager.com">
    7984    <meta name="description" content="<?php echo esc_attr( $meta_desc_text ); ?>">
    80     <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
    81 new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
    82 j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
    83 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
    84 })(window,document,'script','dataLayer','GTM-P24PF4B');</script>
    8585    <style type="text/css">
    8686        html,
     
    215215        }
    216216    </style>
     217    <?php wp_head(); ?>
    217218</head>
    218219
    219220<body>
    220     <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-P24PF4B" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
     221    <?php wp_body_open(); ?>
    221222    <div class="something-semantic">
    222223        <div class="something-else-semantic">
Note: See TracChangeset for help on using the changeset viewer.