Make WordPress Core

Changeset 14186


Ignore:
Timestamp:
04/22/2010 11:32:50 AM (12 years ago)
Author:
nbachiyski
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/l10n.php

    r13827 r14186  
    391391 *
    392392 * @param string $domain Unique identifier for retrieving translated strings
    393  */
    394 function load_muplugin_textdomain( $domain, $path = false ) {
     393 * @param strings $mu_plugin_rel_path Relative to WPMU_PLUGIN_DIR directory in which
     394 * the MO file resides. Defaults is empty string.
     395 */
     396function load_muplugin_textdomain( $domain, $mu_plugin_rel_path = '' ) {
    395397    $locale = apply_filters( 'plugin_locale', get_locale(), $domain );
    396 
    397     $mofile = WPMU_PLUGIN_DIR . "/$domain-$locale.mo";
    398     load_textdomain( $domain, $mofile );
     398    $path = WPMU_PLUGIN_DIR . '/' . ltrim( $mu_plugin_rel_path, '/' );
     399    load_textdomain( $domain, trailingslashit( $path ) . "$domain-$locale.mo" );
    399400}
    400401
Note: See TracChangeset for help on using the changeset viewer.