Bootstrap/Load: Check if the `__()` function is available in `wp_get_environment_type()`.

The function would not exist in `SHORTINIT` mode.

Follow-up to [48894].

See #50992.
Built from https://develop.svn.wordpress.org/trunk@48895


git-svn-id: http://core.svn.wordpress.org/trunk@48657 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2020-08-27 21:39:05 +00:00
parent da19724be9
commit c19f5ae907
2 changed files with 9 additions and 3 deletions

View File

@ -159,11 +159,17 @@ function wp_get_environment_type() {
// Add a note about the deprecated WP_ENVIRONMENT_TYPES constant.
if ( defined( 'WP_ENVIRONMENT_TYPES' ) && function_exists( '_deprecated_argument' ) ) {
if ( function_exists( '__' ) ) {
/* translators: %s: WP_ENVIRONMENT_TYPES */
$message = sprintf( __( 'The %s constant is no longer supported.' ), 'WP_ENVIRONMENT_TYPES' );
} else {
$message = sprintf( 'The %s constant is no longer supported.', 'WP_ENVIRONMENT_TYPES' );
}
_deprecated_argument(
'define()',
'5.5.1',
/* translators: %s: WP_ENVIRONMENT_TYPES */
sprintf( __( 'The %s constant is no longer supported.' ), 'WP_ENVIRONMENT_TYPES' )
$message
);
}

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.6-alpha-48894';
$wp_version = '5.6-alpha-48895';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.