wp-includes/class-wp-locale-switcher.php:279Changes the site's locale to the given one.
$localestringOne hook fires while WP_Locale_Switcher::change_locale() runs, in this order:
Fires when the locale is switched to or restored.
private function change_locale( $locale ) { global $wp_locale; $this->load_translations( $locale ); $wp_locale = new WP_Locale(); WP_Translation_Controller::get_instance()->set_locale( $locale ); /** * Fires when the locale is switched to or restored. * * @since 4.7.0 * * @param string $locale The new locale. */ do_action( 'change_locale', $locale ); }Introduced in 4.7.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
src/wp-includes/class-wp-locale-switcher.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.