Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: plugin_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

This hook occurs 2 times in this file.

Line Code
1001
1002      /**
1003       * Filters a plugin's locale.
1004       *
1005       * @since 3.0.0
1006       *
1007       * @param string $locale The plugin's current locale.
1008       * @param string $domain Text domain. Unique identifier for retrieving translated strings.
1009       */
1010      $locale = apply_filters( 'plugin_locale', determine_locale(), $domain );
1011
1012      $mofile = $domain . '-' . $locale . '.mo';
1013
1014      // Try to load from the languages directory first.
1015      if ( load_textdomain( $domain, WP_LANG_DIR . '/plugins/' . $mofile, $locale ) ) {
1016           return true;
1017      }
1018
1019      if ( false !== $plugin_rel_path ) {
 
Line Code
1046 function load_muplugin_textdomain( $domain, $mu_plugin_rel_path = '' ) {
1047      /** @var WP_Textdomain_Registry $wp_textdomain_registry */
1048      global $wp_textdomain_registry;
1049
1050      if ( ! is_string( $domain ) ) {
1051           return false;
1052      }
1053
1054      /** This filter is documented in wp-includes/l10n.php */
1055      $locale = apply_filters( 'plugin_locale', determine_locale(), $domain );
1056
1057      $mofile = $domain . '-' . $locale . '.mo';
1058
1059      // Try to load from the languages directory first.
1060      if ( load_textdomain( $domain, WP_LANG_DIR . '/plugins/' . $mofile, $locale ) ) {
1061           return true;
1062      }
1063
1064      $path = WPMU_PLUGIN_DIR . '/' . ltrim( $mu_plugin_rel_path, '/' );