Changeset 55161 for trunk/src/wp-includes/l10n.php
- Timestamp:
- 01/30/2023 10:25:53 AM (23 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/l10n.php
r54938 r55161 1666 1666 global $wp_locale_switcher; 1667 1667 1668 if ( ! $wp_locale_switcher ) { 1669 return false; 1670 } 1671 1668 1672 return $wp_locale_switcher->switch_to_locale( $locale ); 1673 } 1674 1675 /** 1676 * Switches the translations according to the given user's locale. 1677 * 1678 * @since 6.2.0 1679 * 1680 * @global WP_Locale_Switcher $wp_locale_switcher WordPress locale switcher object. 1681 * 1682 * @param int $user_id User ID. 1683 * @return bool True on success, false on failure. 1684 */ 1685 function switch_to_user_locale( $user_id ) { 1686 /* @var WP_Locale_Switcher $wp_locale_switcher */ 1687 global $wp_locale_switcher; 1688 1689 if ( ! $wp_locale_switcher ) { 1690 return false; 1691 } 1692 1693 return $wp_locale_switcher->switch_to_user_locale( $user_id ); 1669 1694 } 1670 1695 … … 1682 1707 global $wp_locale_switcher; 1683 1708 1709 if ( ! $wp_locale_switcher ) { 1710 return false; 1711 } 1712 1684 1713 return $wp_locale_switcher->restore_previous_locale(); 1685 1714 } … … 1697 1726 /* @var WP_Locale_Switcher $wp_locale_switcher */ 1698 1727 global $wp_locale_switcher; 1728 1729 if ( ! $wp_locale_switcher ) { 1730 return false; 1731 } 1699 1732 1700 1733 return $wp_locale_switcher->restore_current_locale();
Note: See TracChangeset
for help on using the changeset viewer.