Make the $path argument of load_muplugin_textdomain() functional -- relative to mu-plugins. Props uglyrobot, fixes #12875

git-svn-id: https://develop.svn.wordpress.org/trunk@14186 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Nikolay Bachiyski 2010-04-22 11:32:50 +00:00
parent 2d684e0eb7
commit 0a0ec2ff46
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" );
}
/**