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