Making WordPress.org

Changeset 10061


Ignore:
Timestamp:
07/11/2020 12:42:22 AM (4 years ago)
Author:
dd32
Message:

Main: Simplify Download Counter canonical.

File:
1 edited

Legend:

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

    r10060 r10061  
    1212$branch = WP_CORE_STABLE_BRANCH;
    1313
    14 $canonical_url = get_permalink();
    15 
    1614if (
    1715    isset( $_GET['branch'] )
     
    2018) {
    2119    $branch = $matches[0];
    22 
    23     $canonical_url = add_query_arg( 'branch', $branch, $canonical_url );
    2420}
    2521
     
    3228
    3329if ( ! empty( $_GET['ajaxupdate'] ) ) {
    34     header( 'Link: <' . $canonical_url  . '>; rel="canonical"' );
     30    header( 'Link: <' . get_permalink()  . '>; rel="canonical"' );
    3531
    3632    die( esc_html( number_format_i18n( $num ) ) );
     
    3935if ( ! empty( $_GET['json'] ) ) {
    4036    header( 'Content-Type: application/json' );
    41     header( 'Link: <' . $canonical_url . '>; rel="canonical"' );
     37    header( 'Link: <' . get_permalink() . '>; rel="canonical"' );
    4238
    4339    ?>
     
    9086    <link href="//fonts.googleapis.com/css?family=Open+Sans:300" rel="stylesheet" type="text/css">
    9187    <meta name="viewport" content="width=device-width,initial-scale=1.0">
    92     <link rel="canonical" href="<?php echo esc_url( $canonical_url ); ?>">
    9388    <meta name="description" content="<?php echo esc_attr( $meta_desc_text ); ?>">
    9489    <style type="text/css">
Note: See TracChangeset for help on using the changeset viewer.