Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: switch_locale

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
89           /**
90            * Fires when the locale is switched.
91            *
92            * @since 4.7.0
93            * @since 6.2.0 The `$user_id` parameter was added.
94            *
95            * @param string    $locale  The new locale.
96            * @param false|int $user_id User ID for context if available.
97            */
98           do_action( 'switch_locale', $locale, $user_id );
99
100           return true;
101      }
102
103      /**
104       * Switches the translations according to the given user's locale.
105       *
106       * @since 6.2.0
107       *