Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: pre_determine_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
117      /**
118       * Filters the locale for the current request prior to the default determination process.
119       *
120       * Using this filter allows to override the default logic, effectively short-circuiting the function.
121       *
122       * @since 5.0.0
123       *
124       * @param string|null The locale to return and short-circuit, or null as default.
125       */
126      $determined_locale = apply_filters( 'pre_determine_locale', null );
127      if ( ! empty( $determined_locale ) && is_string( $determined_locale ) ) {
128           return $determined_locale;
129      }
130
131      $determined_locale = get_locale();
132
133      if ( is_admin() ) {
134           $determined_locale = get_user_locale();
135      }