WordPress.org

Making WordPress.org

Changeset 7410


Ignore:
Timestamp:
07/10/2018 06:52:35 PM (2 years ago)
Author:
obenland
Message:

Main: Serve localized packages on Rosetta.

Props ocean90.
See #3673.

File:
1 edited

Legend:

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

    r7408 r7410  
    4444    'download/source/'       => _x( 'Source Code', 'Page title', 'wporg' ),
    4545];
     46
     47$zip_url   = 'https://wordpress.org/latest.zip';
     48$targz_url = 'https://wordpress.org/latest.tar.gz';
     49
     50if ( defined( 'IS_ROSETTA_NETWORK' ) && IS_ROSETTA_NETWORK ) {
     51    $rosetta_release = $GLOBALS['rosetta']->rosetta->get_latest_release();
     52    $zip_url         = $rosetta_release['zip_url'];
     53    $targz_url       = $rosetta_release['targz_url'];
     54}
    4655
    4756// Prevent Jetpack from looking for a non-existent featured image.
     
    7887                    <p class="subheading"><?php esc_html_e( 'Download WordPress and use it on your site.', 'wporg' ); ?></p>
    7988                    <div class="call-to-action col-12">
    80                         <a class="button button-primary button-xl" href="<?php echo esc_url( home_url( 'latest.zip' ) ); ?>">
     89                        <a class="button button-primary button-xl" href="<?php echo esc_url( $zip_url ); ?>">
    8190                            <span class="dashicons-before dashicons-download">
    8291                                <?php
     
    9099                        </a>
    91100                        <p>
    92                             <a href="<?php echo esc_url( home_url( 'latest.tar.gz' ) ); ?>">
     101                            <a href="<?php echo esc_url( $targz_url ); ?>">
    93102                                <?php esc_html_e( 'Download .tar.gz', 'wporg' ); ?>
    94103                            </a>
Note: See TracChangeset for help on using the changeset viewer.