From 7c1255e433269d93f03f861805d41618277dfa16 Mon Sep 17 00:00:00 2001 From: nbachiyski Date: Thu, 22 Apr 2010 11:32:50 +0000 Subject: [PATCH] Make the $path argument of load_muplugin_textdomain() functional -- relative to mu-plugins. Props uglyrobot, fixes #12875 git-svn-id: http://svn.automattic.com/wordpress/trunk@14186 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/l10n.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/wp-includes/l10n.php b/wp-includes/l10n.php index fabcfb357..6dedf30bd 100644 --- a/wp-includes/l10n.php +++ b/wp-includes/l10n.php @@ -390,12 +390,13 @@ function load_plugin_textdomain( $domain, $abs_rel_path = false, $plugin_rel_pat * @since 3.0.0 * * @param string $domain Unique identifier for retrieving translated strings + * @param strings $mu_plugin_rel_path Relative to WPMU_PLUGIN_DIR directory in which + * the MO file resides. Defaults is empty string. */ -function load_muplugin_textdomain( $domain, $path = false ) { +function load_muplugin_textdomain( $domain, $mu_plugin_rel_path = '' ) { $locale = apply_filters( 'plugin_locale', get_locale(), $domain ); - - $mofile = WPMU_PLUGIN_DIR . "/$domain-$locale.mo"; - load_textdomain( $domain, $mofile ); + $path = WPMU_PLUGIN_DIR . '/' . ltrim( $mu_plugin_rel_path, '/' ); + load_textdomain( $domain, trailingslashit( $path ) . "$domain-$locale.mo" ); } /**