Making WordPress.org


Ignore:
Timestamp:
09/06/2017 09:00:21 AM (7 years ago)
Author:
ocean90
Message:

Plugin Directory: Include English (US) in the languages popover if there's at least one other language.

Fixes #3103.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/widgets/class-meta.php

    r5872 r5888  
    155155        $languages = [];
    156156
    157         // We assume that the main language is English US, even though this
    158         // is not true for all plugins. Add it the list for localized directories.
    159         if ( 'en_US' !== get_locale() ) {
    160             $languages['English (US)'] = sprintf(
    161                 '<a href="%1$s">%2$s</a>',
    162                 esc_url( "https://wordpress.org/plugins/{$slug}/" ),
    163                 'English (US)'
    164             );
    165         }
    166 
    167157        if ( ! empty( $locales ) ) {
    168158            $locale_names = wp_list_pluck( $locales, 'name', 'wp_locale' );
     
    188178        }
    189179
     180        // We assume that the main language is English US, even though this
     181        // is not true for all plugins.
     182        if ( $languages || 'en_US' !== get_locale() ) {
     183            $languages['English (US)'] = sprintf(
     184                '<a href="%1$s">%2$s</a>',
     185                esc_url( "https://wordpress.org/plugins/{$slug}/" ),
     186                'English (US)'
     187            );
     188        }
     189
    190190        ksort( $languages, SORT_NATURAL );
    191191
Note: See TracChangeset for help on using the changeset viewer.