From a595f8a525f7a1c358d32705c1e8019acc7a9dc5 Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Wed, 9 Jan 2019 11:46:50 +0000 Subject: [PATCH] I18N: Add option to hide en_US locale in `wp_dropdown_languages()`. Props danieltj for initial patch. Fixes #44494. Built from https://develop.svn.wordpress.org/trunk@44514 git-svn-id: http://core.svn.wordpress.org/trunk@44345 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/l10n.php | 14 +++++++++----- wp-includes/version.php | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/wp-includes/l10n.php b/wp-includes/l10n.php index 915fa72701..39aa6d498e 100644 --- a/wp-includes/l10n.php +++ b/wp-includes/l10n.php @@ -1364,6 +1364,7 @@ function wp_get_pomo_file_data( $po_file ) { * @since 4.0.0 * @since 4.3.0 Introduced the `echo` argument. * @since 4.7.0 Introduced the `show_option_site_default` argument. + * @since 5.1.0 Introduced the `show_option_en_us` argument. * * @see get_available_languages() * @see wp_get_available_translations() @@ -1382,6 +1383,7 @@ function wp_get_pomo_file_data( $po_file ) { * boolean equivalents. Default 1. * @type bool $show_available_translations Whether to show available translations. Default true. * @type bool $show_option_site_default Whether to show an option to fall back to the site's locale. Default false. + * @type bool $show_option_en_us Whether to show an option for English (United States). Default true. * } * @return string HTML content */ @@ -1398,6 +1400,7 @@ function wp_dropdown_languages( $args = array() ) { 'echo' => 1, 'show_available_translations' => true, 'show_option_site_default' => false, + 'show_option_en_us' => true, ) ); @@ -1461,11 +1464,12 @@ function wp_dropdown_languages( $args = array() ) { ); } - // Always show English. - $structure[] = sprintf( - '', - selected( '', $parsed_args['selected'], false ) - ); + if ( $parsed_args['show_option_en_us'] ) { + $structure[] = sprintf( + '', + selected( '', $parsed_args['selected'], false ) + ); + } // List installed languages. foreach ( $languages as $language ) { diff --git a/wp-includes/version.php b/wp-includes/version.php index 240021a48b..13c970b2ab 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.1-alpha-44513'; +$wp_version = '5.1-alpha-44514'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.