Making WordPress.org

Changeset 7473


Ignore:
Timestamp:
07/18/2018 05:31:48 PM (6 years ago)
Author:
ocean90
Message:

Main: Serve the latest public release with the correct version on localized download pages.

File:
1 edited

Legend:

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

    r7413 r7473  
    4545];
    4646
    47 $zip_url   = 'https://wordpress.org/latest.zip';
    48 $targz_url = 'https://wordpress.org/latest.tar.gz';
     47$latest_release_version   = WP_CORE_LATEST_RELEASE;
     48$latest_release_zip_url   = 'https://wordpress.org/latest.zip';
     49$latest_release_targz_url = 'https://wordpress.org/latest.tar.gz';
    4950
    5051if ( 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'];
     52    $rosetta_release = $GLOBALS['rosetta']->rosetta->get_latest_public_release();
     53    if ( $rosetta_release ) {
     54        $latest_release_version   = $rosetta_release['version'];
     55        $latest_release_zip_url   = $rosetta_release['zip_url'];
     56        $latest_release_targz_url = $rosetta_release['targz_url'];
     57    }
    5458}
    5559
     
    8791                    <p class="subheading"><?php esc_html_e( 'Download WordPress and use it on your site.', 'wporg' ); ?></p>
    8892                    <div class="call-to-action col-12">
    89                         <a class="button button-primary button-xl" href="<?php echo esc_url( $zip_url ); ?>">
     93                        <a class="button button-primary button-xl" href="<?php echo esc_url( $latest_release_zip_url ); ?>">
    9094                            <span class="dashicons-before dashicons-download">
    9195                                <?php
     
    9397                                    /* translators: WordPress version. */
    9498                                    __( 'Download WordPress %s', 'wporg' ),
    95                                     WP_CORE_LATEST_RELEASE
     99                                    $latest_release_version
    96100                                ) ) );
    97101                                ?>
     
    99103                        </a>
    100104                        <p>
    101                             <a href="<?php echo esc_url( $targz_url ); ?>">
     105                            <a href="<?php echo esc_url( $latest_release_targz_url ); ?>">
    102106                                <?php esc_html_e( 'Download .tar.gz', 'wporg' ); ?>
    103107                            </a>
Note: See TracChangeset for help on using the changeset viewer.