WP_Locale_Switcher::get_switched_user_id()publicWP 6.2.0

Returns the user ID related to the currently switched locale.

Метод класса: WP_Locale_Switcher{}

Хуков нет.


int|false. User ID if set and if the locale has been switched, false otherwise.


$WP_Locale_Switcher = new WP_Locale_Switcher();

Список изменений

С версии 6.2.0 Введена.

Код WP_Locale_Switcher::get_switched_user_id() WP 6.2.2

public function get_switched_user_id() {
	$entry = end( $this->stack );

	if ( $entry ) {
		return $entry[1];

	return false;