Making WordPress.org

Changeset 6098


Ignore:
Timestamp:
11/09/2017 02:21:13 AM (7 years ago)
Author:
dd32
Message:

Main: Determine URLs for main pages which we know exist on Rosetta sites, avoiding the need to translate the URLs.

Ammends r6096.
See #2861.

Location:
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-main
Files:
2 edited

Legend:

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

    r6096 r6098  
    8585                <p><?php
    8686                    /* translators: %s: Link to Plugin Directory. */
    87                     printf( __( 'Extend WordPress with over 45,000 plugins to help your website meet your needs. Add an online store, galleries, mailing lists, forums, analytics, and <a href="%s">much more</a>.', 'wporg' ), esc_url( _x( 'https://wordpress.org/plugins/', 'Link to local plugin directory', 'wporg' ) ) ); ?></p>
     87                    printf( __( 'Extend WordPress with over 45,000 plugins to help your website meet your needs. Add an online store, galleries, mailing lists, forums, analytics, and <a href="%s">much more</a>.', 'wporg' ), esc_url( home_url( '/plugins/' ) ) ); ?></p>
    8888            </section>
    8989
     
    100100                <p class="subheading"><?php _e( 'Over 60 million people have chosen WordPress to power the place on the web they call &ldquo;home&rdquo; &mdash; join the family.', 'wporg' ); ?></p>
    101101                <div class="cta-wrapper">
    102                     <a href="https://wordpress.org/download/" class="button button-primary button-xl"><?php _e( 'Get WordPress', 'wporg' ); ?></a>
     102                    <a href="<?php echo esc_url( get_downloads_url() ); ?>" class="button button-primary button-xl"><?php _e( 'Get WordPress', 'wporg' ); ?></a>
    103103                </div>
    104104            </section>
     
    107107        <div id="home-below" class="home-below row gutters">
    108108            <div class="col-4">
    109                 <h4><a href="<?php echo esc_url( _x( 'https://wordpress.org/news/', 'Link to local news blog', 'wporg' ) ); ?>"><?php _e( 'News From Our Blog', 'wporg' ); ?></a></h4>
     109                <h4><a href="<?php echo get_permalink( get_option( 'page_for_posts' ) ); ?>"><?php _e( 'News From Our Blog', 'wporg' ); ?></a></h4>
    110110
    111111                <?php
     
    125125                <ol class="steps">
    126126                    <li class="one"><span></span><?php printf( __( '<a href="%s">Find a Web Host</a> and get great hosting while supporting WordPress at the same&nbsp;time.', 'wporg' ), esc_url( 'https://wordpress.org/hosting/' ) ); ?></li>
    127                     <li class="two"><span></span><?php printf( __( '<a href="%s">Download &amp; Install WordPress</a> with our famous 5-minute&nbsp;installation. Feel like a rock star.', 'wporg' ),  esc_url( _x( 'https://wordpress.org/downloads/', 'Link to local downloads page', 'wporg' ) ) ); ?></li>
     127                    <li class="two"><span></span><?php printf( __( '<a href="%s">Download &amp; Install WordPress</a> with our famous 5-minute&nbsp;installation. Feel like a rock star.', 'wporg' ),  esc_url( get_downloads_url() ) ); ?></li>
    128128                    <li class="three"><span></span><?php printf( __( '<a href="%s">Read the Documentation</a> and become a WordPress expert yourself, impress your friends.', 'wporg' ), esc_url( 'https://developer.wordpress.org' ) ); ?></li>
    129129                </ol>
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-main/inc/template-tags.php

    r6091 r6098  
    5353    <?php
    5454}
     55
     56/**
     57 * Rerieve the localised downloads link.
     58 *
     59 * Uses the 'releases' page if exists, falling back to the 'txt-download' page for older sites, and finally, the english downloads page.
     60 */
     61function get_downloads_url() {
     62    static $downloads_url = null;
     63    if ( is_null( $downloads_url ) ) {
     64        $releases_page = get_page_by_path( 'releases' );
     65        if ( ! $releases_page ) {
     66            $releases_page = get_page_by_path( 'txt-download' );
     67        }
     68
     69        if ( $releases_page ) {
     70            $downloads_url = get_permalink( $releases_page );
     71        }
     72        if ( ! $downloads_url ) {
     73            $downloads_url = 'https://wordpress.org/downloads/';
     74        }
     75    }
     76    return $downloads_url;
     77}
Note: See TracChangeset for help on using the changeset viewer.