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
This commit is contained in:
nbachiyski 2010-04-22 11:32:50 +00:00
parent 55446491fa
commit 7c1255e433
1 changed files with 5 additions and 4 deletions

View File

@ -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" );
}
/**