WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )
apply_filters( "hook_name", "what_to_filter" )
.Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
This hook occurs 2 times in this file.
Line | Code |
---|---|
666 | $locale = get_locale(); |
667 | /** |
668 | * Filter a plugin's locale. |
669 | * |
670 | * @since 3.0.0 |
671 | * |
672 | * @param string $locale The plugin's current locale. |
673 | * @param string $domain Text domain. Unique identifier for retrieving translated strings. |
674 | */ |
675 | $locale = apply_filters( 'plugin_locale', $locale, $domain ); |
676 |
|
677 | if ( false !== $plugin_rel_path ) { |
678 | $path = WP_PLUGIN_DIR . '/' . trim( $plugin_rel_path, '/' ); |
679 | } elseif ( false !== $deprecated ) { |
680 | _deprecated_argument( __FUNCTION__, '2.7' ); |
681 | $path = ABSPATH . trim( $deprecated, '/' ); |
682 | } else { |
683 | $path = WP_PLUGIN_DIR; |
684 | } |
Line | Code |
699 | * @since 3.0.0 |
700 | * |
701 | * @param string $domain Text domain. Unique identifier for retrieving translated strings. |
702 | * @param string $mu_plugin_rel_path Relative to WPMU_PLUGIN_DIR directory in which the .mo file resides. |
703 | * Default empty string. |
704 | * @return bool True when textdomain is successfully loaded, false otherwise. |
705 | */ |
706 | function load_muplugin_textdomain( $domain, $mu_plugin_rel_path = '' ) { |
707 | /** This filter is documented in wp-includes/l10n.php */ |
708 | $locale = apply_filters( 'plugin_locale', get_locale(), $domain ); |
709 | $path = trailingslashit( WPMU_PLUGIN_DIR . '/' . ltrim( $mu_plugin_rel_path, '/' ) ); |
710 |
|
711 | // Load the textdomain according to the plugin first |
712 | $mofile = $domain . '-' . $locale . '.mo'; |
713 | if ( $loaded = load_textdomain( $domain, $path . $mofile ) ) |
714 | return $loaded; |
715 |
|
716 | // Otherwise, load from the languages directory |
717 | $mofile = WP_LANG_DIR . '/plugins/' . $mofile; |