Make WordPress Core

Opened 12 months ago

#58284 new defect (bug)

Add in wp_dropdown_languages en_US as selected value when 'explicit_option_en_us' is set to true

Reported by: ekaliva's profile ekaliva Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: I18N Keywords: has-patch needs-testing
Focuses: Cc:

Description

When in the function "wp_dropdown_languages" the option "explicit_option_en_us" is set to true and the locale-value of the User is "en_us" the option is still not selected. The value in the selected function (l10n.php, L. 1591) is empty:

<?php
selected( '', $parsed_args['selected'], false )

This cause problems when the default language of the WMPU network is set from english to another language.

The bugfix could be the following (l10n.php L. 1586 - L.1593):

<?php
if ( $parsed_args['show_option_en_us'] ) {
                $value       = ( $parsed_args['explicit_option_en_us'] ) ? 'en_US' : '';
                $structure[] = sprintf(
                        '<option value="%s" lang="en" data-installed="1"%s>English (United States)</option>',
                        esc_attr( $value ),
                        selected( $value, $parsed_args['selected'], false )
                );
        }

Thank you very much

Change History (0)

Note: See TracTickets for help on using tickets.