Loads the admin textdomain for Site Health tests.

Description Description

The WP_Site_Health class is defined in WP-Admin, while the REST API operates in a front-end context. This means that the translations for Site Health won’t be loaded by default in load_default_textdomain().

Top ↑

Source Source

File: wp-includes/rest-api/endpoints/class-wp-rest-site-health-controller.php

	protected function load_admin_textdomain() {
		// Accounts for inner REST API requests in the admin.
		if ( ! is_admin() ) {
			$locale = determine_locale();
			load_textdomain( 'default', WP_LANG_DIR . "/admin-$locale.mo" );

Top ↑

Changelog Changelog

Version Description
5.6.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.