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 |
---|---|
591 | $locale = get_locale(); |
592 | /** |
593 | * Filter a plugin's locale. |
594 | * |
595 | * @since 3.0.0 |
596 | * |
597 | * @param string $locale The plugin's current locale. |
598 | * @param string $domain Text domain. Unique identifier for retrieving translated strings. |
599 | */ |
600 | $locale = apply_filters( 'plugin_locale', $locale, $domain ); |
601 |
|
602 | if ( false !== $plugin_rel_path ) { |
603 | $path = WP_PLUGIN_DIR . '/' . trim( $plugin_rel_path, '/' ); |
604 | } elseif ( false !== $deprecated ) { |
605 | _deprecated_argument( __FUNCTION__, '2.7' ); |
606 | $path = ABSPATH . trim( $deprecated, '/' ); |
607 | } else { |
608 | $path = WP_PLUGIN_DIR; |
609 | } |
Line | Code |
624 | * @since 3.0.0 |
625 | * |
626 | * @param string $domain Text domain. Unique identifier for retrieving translated strings. |
627 | * @param string $mu_plugin_rel_path Relative to WPMU_PLUGIN_DIR directory in which the .mo file resides. |
628 | * Default empty string. |
629 | * @return bool True when textdomain is successfully loaded, false otherwise. |
630 | */ |
631 | function load_muplugin_textdomain( $domain, $mu_plugin_rel_path = '' ) { |
632 | /** This filter is documented in wp-includes/l10n.php */ |
633 | $locale = apply_filters( 'plugin_locale', get_locale(), $domain ); |
634 | $path = trailingslashit( WPMU_PLUGIN_DIR . '/' . ltrim( $mu_plugin_rel_path, '/' ) ); |
635 |
|
636 | // Load the textdomain according to the plugin first |
637 | $mofile = $domain . '-' . $locale . '.mo'; |
638 | if ( $loaded = load_textdomain( $domain, $path . $mofile ) ) |
639 | return $loaded; |
640 |
|
641 | // Otherwise, load from the languages directory |
642 | $mofile = WP_LANG_DIR . '/plugins/' . $mofile; |