WP_Locale_Switcher::get_switched_user_id()
Returns the user ID related to the currently switched locale.
Method of the class: WP_Locale_Switcher{}
No Hooks.
Return
Int|false
. User ID if set and if the locale has been switched, false otherwise.
Usage
$WP_Locale_Switcher = new WP_Locale_Switcher(); $WP_Locale_Switcher->get_switched_user_id();
Changelog
Since 6.2.0 | Introduced. |
WP_Locale_Switcher::get_switched_user_id() WP Locale Switcher::get switched user id code WP 6.6.2
public function get_switched_user_id() { $entry = end( $this->stack ); if ( $entry ) { return $entry[1]; } return false; }