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.

git-svn-id: https://develop.svn.wordpress.org/trunk@48895 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2020-08-27 21:37:33 +00:00
parent a0864835a5
commit 6c395a5f3e
1 changed files with 8 additions and 2 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
);
}