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
912
913      /**
914       * Filters a plugin's locale.
915       *
916       * @since 3.0.0
917       *
918       * @param string $locale The plugin's current locale.
919       * @param string $domain Text domain. Unique identifier for retrieving translated strings.
920       */
921      $locale = apply_filters( 'plugin_locale', determine_locale(), $domain );
922
923      $mofile = $domain . '-' . $locale . '.mo';
924
925      // Try to load from the languages directory first.
926      if ( load_textdomain( $domain, WP_LANG_DIR . '/plugins/' . $mofile, $locale ) ) {
927           return true;
928      }
929
930      if ( false !== $plugin_rel_path ) {
 
Line Code
953  * @param string $mu_plugin_rel_path Optional. Relative to `WPMU_PLUGIN_DIR` directory in which the .mo
954  *                                   file resides. Default empty string.
955  * @return bool True when textdomain is successfully loaded, false otherwise.
956  */
957 function load_muplugin_textdomain( $domain, $mu_plugin_rel_path = '' ) {
958      /** @var WP_Textdomain_Registry $wp_textdomain_registry */
959      global $wp_textdomain_registry;
960
961      /** This filter is documented in wp-includes/l10n.php */
962      $locale = apply_filters( 'plugin_locale', determine_locale(), $domain );
963
964      $mofile = $domain . '-' . $locale . '.mo';
965
966      // Try to load from the languages directory first.
967      if ( load_textdomain( $domain, WP_LANG_DIR . '/plugins/' . $mofile, $locale ) ) {
968           return true;
969      }
970
971      $path = WPMU_PLUGIN_DIR . '/' . ltrim( $mu_plugin_rel_path, '/' );