Making WordPress.org

Changeset 10898


Ignore:
Timestamp:
04/14/2021 03:12:19 AM (3 years ago)
Author:
dd32
Message:

Login: Use the localised WordPress.org link for when the login is being displayed in a not-english language.

This ensures that any links to privacy policies/etc will be in their preferred language.

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

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/checkemail.php

    r6493 r10898  
    1212
    1313<p id="nav">
    14     <a href="/"><?php _e( '&larr; Back to login', 'wporg' ); ?></a>
     14    <a href="/"><?php _e( '&larr; Back to login', 'wporg' ); ?></a> &nbsp; • &nbsp;
     15    <a href="<?php echo wporg_login_wordpress_url(); ?>"><?php _e( 'WordPress.org', 'wporg' ); ?></a>
    1516</p>
    1617
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/functions.php

    r10850 r10898  
    460460
    461461// This is the login messages, which is displayed on wp-login.php, which does not use wp_login_form() or it's actions.
    462 function wp_login_errors_message( $errors, $redirect_to ) {
     462function wporg_login_errors_message( $errors, $redirect_to ) {
    463463    $errors->add(
    464464        'pre_login_message',
     
    470470    return $errors;
    471471}
    472 add_filter( 'wp_login_errors', 'wp_login_errors_message', 10, 2 );
     472add_filter( 'wp_login_errors', 'wporg_login_errors_message', 10, 2 );
    473473
    474474/**
     
    477477 * See https://core.trac.wordpress.org/ticket/52915
    478478 */
    479 function wp_login_errors_nicify( $errors, $redirect_to ) {
     479function wporg_login_errors_nicify( $errors, $redirect_to ) {
    480480
    481481    $replace_errors = [
     
    499499    return $errors;
    500500}
    501 add_filter( 'wp_login_errors', 'wp_login_errors_nicify', 10, 2 );
     501add_filter( 'wp_login_errors', 'wporg_login_errors_nicify', 10, 2 );
     502
     503/**
     504 * Fetch the URL to the locales WordPress.org site.
     505 */
     506function wporg_login_wordpress_url() {
     507    /* This pulls the translation from the WordPress translations, mimicking wp-login.php */
     508    $url = apply_filters( 'login_headerurl', translate( 'https://wordpress.org/' ) );
     509
     510    if ( ! $url || false === stripos( $url, '.wordpress.org' ) ) {
     511        $url = 'https://wordpress.org/';
     512    }
     513
     514    return esc_url( $url );
     515}
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/header.php

    r10830 r10898  
    2020
    2121<div id="login">
    22     <h1><a href="<?php /* This mimicks the wp-login.php header */ echo apply_filters( 'login_headerurl', __( 'https://wordpress.org/' ) ); ?>" tabindex="-1"><?php /* This mimicks the wp-login.php header */ _e( 'Powered by WordPress' ); ?></a></h1>
     22    <?php /* The following translation pulls from the WordPress translations, mimicking wp-login.php intentionally for consistency. */ ?>
     23    <h1><a href="<?php echo wporg_login_wordpress_url(); ?>" tabindex="-1"><?php echo translate( 'Powered by WordPress' ); ?></a></h1>
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/linkexpired.php

    r10325 r10898  
    3333
    3434<p id="nav">
    35     <a href="/"><?php _e( '&larr; Back to login', 'wporg' ); ?></a>
     35    <a href="/"><?php _e( '&larr; Back to login', 'wporg' ); ?></a>  &nbsp; • &nbsp;
     36    <a href="<?php echo wporg_login_wordpress_url(); ?>"><?php _e( 'WordPress.org', 'wporg' ); ?></a>
    3637</p>
    3738
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/loggedout.php

    r9830 r10898  
    1212
    1313<p id="nav">
    14     <a href="/"><?php _e( '&larr; Back to login', 'wporg' ); ?></a>
     14    <a href="/"><?php _e( '&larr; Back to login', 'wporg' ); ?></a> &nbsp; • &nbsp;
     15    <a href="<?php echo wporg_login_wordpress_url(); ?>"><?php _e( 'WordPress.org', 'wporg' ); ?></a>
    1516</p>
    1617
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/pending-create.php

    r9835 r10898  
    139139
    140140<p id="nav">
    141     <a href="https://wordpress.org/"><?php _e( 'WordPress.org', 'wporg' ); ?></a>
     141    <a href="<?php echo wporg_login_wordpress_url(); ?>"><?php _e( 'WordPress.org', 'wporg' ); ?></a>
    142142</p>
    143143
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/pending-profile.php

    r10029 r10898  
    8686
    8787<p id="nav">
    88     <a href="https://wordpress.org/"><?php _e( 'WordPress.org', 'wporg' ); ?></a>
     88    <a href="<?php echo wporg_login_wordpress_url(); ?>"><?php _e( 'WordPress.org', 'wporg' ); ?></a>
    8989</p>
    9090
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/register.php

    r10288 r10898  
    9999<p id="nav">
    100100    <a href="/" title="<?php esc_attr_e( 'Already have an account?', 'wporg' ); ?>"><?php _e( 'Already have an account?', 'wporg' ); ?></a> &nbsp; • &nbsp;
    101     <a href="https://wordpress.org/"><?php _e( 'WordPress.org', 'wporg' ); ?></a>
    102 
     101    <a href="<?php echo wporg_login_wordpress_url(); ?>"><?php _e( 'WordPress.org', 'wporg' ); ?></a>
    103102</p>
    104103
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/updated-tos.php

    r10889 r10898  
    3737}
    3838
     39// Localised domain for about pages.
     40$localised_domain = parse_url( wporg_login_wordpress_url(), PHP_URL_HOST );
     41
    3942get_header();
    4043?>
     
    5457
    5558<p>
    56     <a href="<?php _eu( 'https://wordpress.org/about/privacy/', 'wporg' ); ?>"><?php _eu( 'Privacy Policy', 'wporg' ); ?></a>
     59    <a href="https://<?php echo $localised_domain; ?>/about/privacy/"><?php _e( 'Privacy Policy', 'wporg' ); ?></a>
    5760</p>
    5861<?php /* ?>
    5962<p>
    60     <a href="<?php _eu( 'https://wordpress.org/about/terms-of-service/', 'wporg' ); ?>"><?php _eu( 'Terms of Service', 'wporg' ); ?></a>
     63    <a href="https://<?php echo $localised_domain; ?>/about/terms-of-service/"><?php _eu( 'Terms of Service', 'wporg' ); ?></a>
    6164</p>
    6265<p>
    63     <a href="<?php _eu( 'https://wordpress.org/about/code-of-conduct/', 'wporg' ); ?>"><?php _eu( 'Code of Conduct', 'wporg' ); ?></a>
     66    <a href="https://<?php echo $localised_domain; ?>/code-of-conduct/"><?php _eu( 'Code of Conduct', 'wporg' ); ?></a>
    6467</p>
    6568<?php //*/ ?>
     
    7679
    7780<p class="center">
    78     <a href="https://wordpress.org/" style="font-style: italic;"><?php _eu( 'I do not agree', 'wporg' ); ?></a>
     81    <a href="<?php echo wporg_login_wordpress_url(); ?>" style="font-style: italic;"><?php _eu( 'I do not agree', 'wporg' ); ?></a>
    7982</p>
    8083
    8184<p id="nav">
    82     <a href="/"><?php _e( '&larr; Back to login', 'wporg' ); ?></a>
     85    <a href="/"><?php _e( '&larr; Back to login', 'wporg' ); ?></a> &nbsp; • &nbsp;
     86    <a href="<?php echo wporg_login_wordpress_url(); ?>"><?php _e( 'WordPress.org', 'wporg' ); ?></a>
    8387</p>
    8488
Note: See TracChangeset for help on using the changeset viewer.