Making WordPress.org


Ignore:
Timestamp:
02/12/2021 04:07:31 AM (6 years ago)
Author:
dd32
Message:

Plugin Directory: Always include the current locale site in the list of hreflang tags.

Fixes #5614.

File:
1 edited

Legend:

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

    r10214 r10668  
    951951                        if ( $post ) {
    952952                                $sites = Plugin_I18n::instance()->get_locales();
     953
     954                                // Always include the current locale, regardless of translation status. #5614
     955                                if ( 'en_US' !== get_locale() ) {
     956                                        if ( ! wp_list_filter( $sites, [ 'wp_locale' => get_locale() ] ) ) {
     957                                                $sites[] = (object) array(
     958                                                        'wp_locale' => get_locale(),
     959                                                );
     960                                        }
     961                                }
     962
    953963                        } else {
    954964                                $sites = array();
    955965                                foreach ( array_keys( $subdomains ) as $locale ) {
    956966                                        $sites[] = (object) array(
    957                                                 'wp_locale'    => $locale
     967                                                'wp_locale' => $locale,
    958968                                        );
    959969                                }
Note: See TracChangeset for help on using the changeset viewer.