From 6c395a5f3e8cdce593efbf871104c9d39444ee12 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Thu, 27 Aug 2020 21:37:33 +0000 Subject: [PATCH] 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 --- src/wp-includes/load.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/wp-includes/load.php b/src/wp-includes/load.php index e38fdc66c9..8cc14e06db 100644 --- a/src/wp-includes/load.php +++ b/src/wp-includes/load.php @@ -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 ); }