Changeset 49716 for trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-site-health-controller.php
- Timestamp:
- 12/01/2020 03:42:31 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-site-health-controller.php
r49334 r49716 172 172 */ 173 173 public function test_background_updates() { 174 $this->load_admin_textdomain(); 174 175 return $this->site_health->get_test_background_updates(); 175 176 } … … 183 184 */ 184 185 public function test_dotorg_communication() { 186 $this->load_admin_textdomain(); 185 187 return $this->site_health->get_test_dotorg_communication(); 186 188 } … … 194 196 */ 195 197 public function test_loopback_requests() { 198 $this->load_admin_textdomain(); 196 199 return $this->site_health->get_test_loopback_requests(); 197 200 } … … 205 208 */ 206 209 public function test_authorization_header() { 210 $this->load_admin_textdomain(); 207 211 return $this->site_health->get_test_authorization_header(); 208 212 } … … 219 223 require_once ABSPATH . 'wp-admin/includes/class-wp-debug-data.php'; 220 224 } 225 226 $this->load_admin_textdomain(); 221 227 222 228 $sizes_data = WP_Debug_Data::get_sizes(); … … 255 261 256 262 return $all_sizes; 263 } 264 265 /** 266 * Loads the admin textdomain for Site Health tests. 267 * 268 * The {@see WP_Site_Health} class is defined in WP-Admin, while the REST API operates in a front-end context. 269 * This means that the translations for Site Health won't be loaded by default in {@see load_default_textdomain()}. 270 * 271 * @since 5.6.0 272 */ 273 protected function load_admin_textdomain() { 274 // Accounts for inner REST API requests in the admin. 275 if ( ! is_admin() ) { 276 $locale = determine_locale(); 277 load_textdomain( 'default', WP_LANG_DIR . "/admin-$locale.mo" ); 278 } 257 279 } 258 280
Note: See TracChangeset
for help on using the changeset viewer.