wpseek.com
Un motore di ricerca WordPress per sviluppatori e autori di temi



switch_to_user_locale › WordPress Function

Da6.2.0
Deprecaton/a
switch_to_user_locale ( $user_id )
Parametri:
  • (int) $user_id User ID.
    Richiesto:
Ritorna:
  • (bool) True on success, false on failure.
Definito a:
Codex:

Switches the translations according to the given user's locale.



Sorgenti

function switch_to_user_locale( $user_id ) {
	/* @var WP_Locale_Switcher $wp_locale_switcher */
	global $wp_locale_switcher;

	if ( ! $wp_locale_switcher ) {
		return false;
	}

	return $wp_locale_switcher->switch_to_user_locale( $user_id );
}