Make WordPress Core

Ticket #23794: 23794.patch

File 23794.patch, 1.6 KB (added by johnbillion, 11 years ago)
  • wp-includes/l10n.php

     
    409409 * @since 1.5.0
    410410 *
    411411 * @param string $domain Unique identifier for retrieving translated strings
    412  * @param string $abs_rel_path Optional. Relative path to ABSPATH of a folder,
    413  *      where the .mo file resides. Deprecated, but still functional until 2.7
    414  * @param string $plugin_rel_path Optional. Relative path to WP_PLUGIN_DIR. This is the preferred argument to use. It takes precedence over $abs_rel_path
     412 * @param string $deprecated Deprecated.
     413 * @param string $plugin_rel_path Optional. Relative path to WP_PLUGIN_DIR.
     414 * @return bool True on success, false on failure
    415415 */
    416 function load_plugin_textdomain( $domain, $abs_rel_path = false, $plugin_rel_path = false ) {
     416function load_plugin_textdomain( $domain, $deprecated = false, $plugin_rel_path = false ) {
    417417        $locale = apply_filters( 'plugin_locale', get_locale(), $domain );
    418418
    419419        if ( false !== $plugin_rel_path ) {
    420420                $path = WP_PLUGIN_DIR . '/' . trim( $plugin_rel_path, '/' );
    421         } else if ( false !== $abs_rel_path ) {
     421        } else if ( false !== $deprecated ) {
    422422                _deprecated_argument( __FUNCTION__, '2.7' );
    423                 $path = ABSPATH . trim( $abs_rel_path, '/' );
     423                $path = ABSPATH . trim( $deprecated, '/' );
    424424        } else {
    425425                $path = WP_PLUGIN_DIR;
    426426        }
    427427
     428        if ( !is_readable( $path ) )
     429                $path = WPMU_PLUGIN_DIR . '/' . trim( $plugin_rel_path, '/' );
     430
    428431        $mofile = $path . '/'. $domain . '-' . $locale . '.mo';
    429432        return load_textdomain( $domain, $mofile );
    430433}