3

I have trouble about the notice shows on the top of the home page as:

Notice: load_plugin_textdomain was called with an argument that is deprecated since version 2.7 with no alternative available. in .../wordpress/wp-includes/functions.php on line 2925

The code of this line is something about $wpsmiliestrans:

';)' => 'icon_wink.gif',

If I delete this code, it will show the problem on line 2924, which is another code about smilies, and there are dozens of these type of code. How can I get rid of this?
I have updated the software to the latest version.

1
  • The second argument of load_plugin_textdomain is deprecated, as is detailed on the codex page for that function.
    – t31os
    May 1 '13 at 15:41
7

';)' => 'icon_wink.gif', is in line 2477 in the current version, you should never just change or delete core files, unless you know how to run a private branch of WordPress.

Line 2925 is the second trigger_error() in this function:

function _deprecated_argument( $function, $version, $message = null ) {

    do_action( 'deprecated_argument_run', $function, $message, $version );

    // Allow plugin to filter the output error trigger
    if ( WP_DEBUG && apply_filters( 'deprecated_argument_trigger_error', true ) ) {
        if ( ! is_null( $message ) )
            trigger_error( sprintf( __('%1$s was called with an argument that is <strong>deprecated</strong> since version %2$s! %3$s'), $function, $version, $message ) );
        else
            trigger_error( sprintf( __('%1$s was called with an argument that is <strong>deprecated</strong> since version %2$s with no alternative available.'), $function, $version ) );
    }
}

That’s just the place where the notice is, not the place of your error.

Let’s look at load_plugin_textdomain(); here is the real problem:

/**
 * Loads the plugin's translated strings.
 *
 * If the path is not given then it will be the root of the plugin directory.
 * The .mo file should be named based on the domain with a dash, and then the locale exactly.
 *
 * @since 1.5.0
 *
 * @param string $domain Unique identifier for retrieving translated strings
 * @param string $abs_rel_path Optional. Relative path to ABSPATH of a folder,
 *  where the .mo file resides. Deprecated, but still functional until 2.7
 * @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
 */
function load_plugin_textdomain( $domain, $abs_rel_path = false, $plugin_rel_path = false ) {
    $locale = apply_filters( 'plugin_locale', get_locale(), $domain );

    if ( false !== $plugin_rel_path ) {
        $path = WP_PLUGIN_DIR . '/' . trim( $plugin_rel_path, '/' );
    } else if ( false !== $abs_rel_path ) {
        _deprecated_argument( __FUNCTION__, '2.7' );
        $path = ABSPATH . trim( $abs_rel_path, '/' );
    } else {
        $path = WP_PLUGIN_DIR;
    }

    $mofile = $path . '/'. $domain . '-' . $locale . '.mo';
    return load_textdomain( $domain, $mofile );
}

The error message you get can be translated as:

A plugin is using load_plugin_textdomain() and it passes not false as a second argument to that function.

The plugin is five years behind the current standard.

Solution

  1. Disable all plugins.
  2. Re-enable each plugin separately, until the error comes back. That’s broken plugin.
  3. Update your question, or write an answer, and name that plugin, so other readers can learn something.
  4. Write a short message to the plugin author, if she is still around, so it can be fixed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.