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