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 |
|---|---|
| 664 | $locale = get_locale(); |
| 665 | /** |
| 666 | * Filter a plugin's locale. |
| 667 | * |
| 668 | * @since 3.0.0 |
| 669 | * |
| 670 | * @param string $locale The plugin's current locale. |
| 671 | * @param string $domain Text domain. Unique identifier for retrieving translated strings. |
| 672 | */ |
| 673 | $locale = apply_filters( 'plugin_locale', $locale, $domain ); |
| 674 | |
| 675 | if ( false !== $plugin_rel_path ) { |
| 676 | $path = WP_PLUGIN_DIR . '/' . trim( $plugin_rel_path, '/' ); |
| 677 | } elseif ( false !== $deprecated ) { |
| 678 | _deprecated_argument( __FUNCTION__, '2.7' ); |
| 679 | $path = ABSPATH . trim( $deprecated, '/' ); |
| 680 | } else { |
| 681 | $path = WP_PLUGIN_DIR; |
| 682 | } |
| Line | Code |
| 697 | * @since 3.0.0 |
| 698 | * |
| 699 | * @param string $domain Text domain. Unique identifier for retrieving translated strings. |
| 700 | * @param string $mu_plugin_rel_path Relative to WPMU_PLUGIN_DIR directory in which the .mo file resides. |
| 701 | * Default empty string. |
| 702 | * @return bool True when textdomain is successfully loaded, false otherwise. |
| 703 | */ |
| 704 | function load_muplugin_textdomain( $domain, $mu_plugin_rel_path = '' ) { |
| 705 | /** This filter is documented in wp-includes/l10n.php */ |
| 706 | $locale = apply_filters( 'plugin_locale', get_locale(), $domain ); |
| 707 | $path = trailingslashit( WPMU_PLUGIN_DIR . '/' . ltrim( $mu_plugin_rel_path, '/' ) ); |
| 708 | |
| 709 | // Load the textdomain according to the plugin first |
| 710 | $mofile = $domain . '-' . $locale . '.mo'; |
| 711 | if ( $loaded = load_textdomain( $domain, $path . $mofile ) ) |
| 712 | return $loaded; |
| 713 | |
| 714 | // Otherwise, load from the languages directory |
| 715 | $mofile = WP_LANG_DIR . '/plugins/' . $mofile; |