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 |
---|---|
553 | $locale = get_locale(); |
554 | /** |
555 | * Filter a plugin's locale. |
556 | * |
557 | * @since 3.0.0 |
558 | * |
559 | * @param string $locale The plugin's current locale. |
560 | * @param string $domain Text domain. Unique identifier for retrieving translated strings. |
561 | */ |
562 | $locale = apply_filters( 'plugin_locale', $locale, $domain ); |
563 |
|
564 | if ( false !== $plugin_rel_path ) { |
565 | $path = WP_PLUGIN_DIR . '/' . trim( $plugin_rel_path, '/' ); |
566 | } else if ( false !== $deprecated ) { |
567 | _deprecated_argument( __FUNCTION__, '2.7' ); |
568 | $path = ABSPATH . trim( $deprecated, '/' ); |
569 | } else { |
570 | $path = WP_PLUGIN_DIR; |
571 | } |
Line | Code |
586 | * @since 3.0.0 |
587 | * |
588 | * @param string $domain Text domain. Unique identifier for retrieving translated strings. |
589 | * @param string $mu_plugin_rel_path Relative to WPMU_PLUGIN_DIR directory in which the .mo file resides. |
590 | * Default empty string. |
591 | * @return bool True when textdomain is successfully loaded, false otherwise. |
592 | */ |
593 | function load_muplugin_textdomain( $domain, $mu_plugin_rel_path = '' ) { |
594 | // duplicate_hook |
595 | $locale = apply_filters( 'plugin_locale', get_locale(), $domain ); |
596 | $path = trailingslashit( WPMU_PLUGIN_DIR . '/' . ltrim( $mu_plugin_rel_path, '/' ) ); |
597 |
|
598 | // Load the textdomain according to the plugin first |
599 | $mofile = $domain . '-' . $locale . '.mo'; |
600 | if ( $loaded = load_textdomain( $domain, $path . $mofile ) ) |
601 | return $loaded; |
602 |
|
603 | // Otherwise, load from the languages directory |
604 | $mofile = WP_LANG_DIR . '/plugins/' . $mofile; |