WP_Locale_Switcher::filter_locale()
Filters the locale of the WordPress installation.
Method of the class: WP_Locale_Switcher{}
No Hooks.
Return
String
. The locale currently being switched to.
Usage
$WP_Locale_Switcher = new WP_Locale_Switcher(); $WP_Locale_Switcher->filter_locale( $locale );
- $locale(string) (required)
- The locale of the WordPress installation.
Changelog
Since 4.7.0 | Introduced. |
WP_Locale_Switcher::filter_locale() WP Locale Switcher::filter locale code WP 6.7.1
public function filter_locale( $locale ) { $switched_locale = $this->get_switched_locale(); if ( $switched_locale ) { return $switched_locale; } return $locale; }