Making WordPress.org


Ignore:
Timestamp:
09/29/2020 06:28:26 AM (6 years ago)
Author:
dd32
Message:

Plugin Directory: Locale Banner: Don't suggest locales which we don't support.

Not all Locales on WordPress.org have valid WordPress locale codes but have a Rosetta site, such as la.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/api/routes/class-locale-banner.php

    r9669 r10313  
    4242                // Retrieve all the WordPress locales.
    4343                $all_locales = wp_list_pluck( $locale_subdomain_assoc, 'locale' );
     44
     45                // Validate that all the locale subdomains have valid WordPress locale values (hint: They don't).
     46                $all_locales = array_filter( $all_locales, function( $locale ) {
     47                        return \GP_Locales::by_field( 'wp_locale', $locale );
     48                } );
    4449
    4550                $is_plugin_request = ! empty( $plugin_slug );
Note: See TracChangeset for help on using the changeset viewer.