Switches the translations according to the given user’s locale.
Parameters
$user_idintrequired- User ID.
Return
bool True on success, false on failure.Source
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 );
}
Related
| Uses | Description |
|---|---|
WP_Locale_Switcher::switch_to_user_locale()wp-includes/class-wp-locale-switcher.php | Switches the translations according to the given user’s locale. |
| Used by | Description |
|---|---|
wpmu_new_site_admin_notification()wp-includes/ms-functions.php | Notifies the Multisite network administrator that a new site was created. |
WP_Automatic_Updater::send_plugin_theme_email()wp-admin/includes/class-wp-automatic-updater.php | Sends an email upon the completion or failure of a plugin or theme background update. |
_wp_privacy_send_erasure_fulfillment_notification()wp-includes/user.php | Notifies the user when their erasure request is fulfilled. |
wp_send_user_request()wp-includes/user.php | Send a confirmation request email to confirm an action. |
wp_privacy_send_personal_data_export_email()wp-admin/includes/privacy-tools.php | Send an email to the user with a link to the personal data export file |
update_network_option_new_admin_email()wp-includes/ms-functions.php | Sends a confirmation request email when a change of network admin email address is attempted. |
WP_Customize_Selective_Refresh::export_preview_data()wp-includes/customize/class-wp-customize-selective-refresh.php | Exports data in preview after it has finished rendering so that partials can be added at runtime. |
retrieve_password()wp-includes/user.php | Handles sending a password retrieval email to a user. |
WP_Automatic_Updater::send_email()wp-admin/includes/class-wp-automatic-updater.php | Sends an email upon the completion or failure of a background core update. |
WP_Automatic_Updater::send_debug_email()wp-admin/includes/class-wp-automatic-updater.php | Prepares and sends an email of a full log of background update results, useful for debugging and geekery. |
update_option_new_admin_email()wp-admin/includes/misc.php | Sends a confirmation request email when a change of site admin email address is attempted. |
WP_Customize_Manager::customize_preview_settings()wp-includes/class-wp-customize-manager.php | Prints JavaScript settings for preview frame. |
wp_password_change_notification()wp-includes/pluggable.php | Notifies the blog admin of a user changing password, normally via email. |
wp_new_user_notification()wp-includes/pluggable.php | Emails login credentials to a newly-registered user. |
wp_notify_postauthor()wp-includes/pluggable.php | Notifies an author (and/or others) of a comment/trackback/pingback on a post. |
wp_notify_moderator()wp-includes/pluggable.php | Notifies the moderator of the site about a new comment that is awaiting approval. |
wp_update_user()wp-includes/user.php | Updates a user in the database. |
wpmu_welcome_user_notification()wp-includes/ms-functions.php | Notifies a user that their account activation has been successful. |
wpmu_welcome_notification()wp-includes/ms-functions.php | Notifies the site administrator that their site activation was successful. |
wpmu_signup_blog_notification()wp-includes/ms-functions.php | Sends a confirmation request email to a user when they sign up for a new site. The new site will not become active until the confirmation link is clicked. |
wpmu_signup_user_notification()wp-includes/ms-functions.php | Sends a confirmation request email to a user when they sign up for a new user account (without signing up for a site at the same time). The user account will not become active until the confirmation link is clicked. |
WP_Customize_Widgets::export_preview_data()wp-includes/class-wp-customize-widgets.php | Communicates the sidebars that appeared on the page at the very end of the page, and at the very end of the wp_footer, |
Changelog
| Version | Description |
|---|---|
| 6.2.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.