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 |
|---|---|
| 682 | function load_plugin_textdomain( $domain, $deprecated = false, $plugin_rel_path = false ) { |
| 683 | /** |
| 684 | * Filters a plugin's locale. |
| 685 | * |
| 686 | * @since 3.0.0 |
| 687 | * |
| 688 | * @param string $locale The plugin's current locale. |
| 689 | * @param string $domain Text domain. Unique identifier for retrieving translated strings. |
| 690 | */ |
| 691 | $locale = apply_filters( 'plugin_locale', get_locale(), $domain ); |
| 692 | |
| 693 | $mofile = $domain . '-' . $locale . '.mo'; |
| 694 | |
| 695 | // Try to load from the languages directory first. |
| 696 | if ( load_textdomain( $domain, WP_LANG_DIR . '/plugins/' . $mofile ) ) { |
| 697 | return true; |
| 698 | } |
| 699 | |
| 700 | if ( false !== $plugin_rel_path ) { |
| Line | Code |
| 716 | * @since 4.6.0 The function now tries to load the .mo file from the languages directory first. |
| 717 | * |
| 718 | * @param string $domain Text domain. Unique identifier for retrieving translated strings. |
| 719 | * @param string $mu_plugin_rel_path Optional. Relative to `WPMU_PLUGIN_DIR` directory in which the .mo |
| 720 | * file resides. Default empty string. |
| 721 | * @return bool True when textdomain is successfully loaded, false otherwise. |
| 722 | */ |
| 723 | function load_muplugin_textdomain( $domain, $mu_plugin_rel_path = '' ) { |
| 724 | /** This filter is documented in wp-includes/l10n.php */ |
| 725 | $locale = apply_filters( 'plugin_locale', get_locale(), $domain ); |
| 726 | |
| 727 | $mofile = $domain . '-' . $locale . '.mo'; |
| 728 | |
| 729 | // Try to load from the languages directory first. |
| 730 | if ( load_textdomain( $domain, WP_LANG_DIR . '/plugins/' . $mofile ) ) { |
| 731 | return true; |
| 732 | } |
| 733 | |
| 734 | $path = trailingslashit( WPMU_PLUGIN_DIR . '/' . ltrim( $mu_plugin_rel_path, '/' ) ); |