Deprecated parameter in mailchimp plugin
-
In the mailchimp plugin, on line 60, we call load_plugin_textdomain() with a deprecated parameter (see http://codex.wordpress.org/Function_Reference/load_plugin_textdomain)
It’s an easy fix: Instead of giving it the relative path to language files from ABSPATH as the second parameter, the second parameter should be false. Third parameter should be relative path to language files from WP_PLUGIN_DIR, ie: dirname( plugin_basename( __FILE__ ) ) . ‘/po/’
This is the only place this plugin uses the constant MCSF_LANG_DIR, you should probably just add ‘, false’ as the second parameter and change the constant on line 1158.
Hoping for this to be fixed.
Patch:
diff --git a/wp-content/plugins/mailchimp/mailchimp.php b/wp-content/plugins/mailchimp/mailchimp.php
index 522e5df..145710b 100644
--- a/wp-content/plugins/mailchimp/mailchimp.php
+++ b/wp-content/plugins/mailchimp/mailchimp.php
@@ -57,7 +57,7 @@ include_once('mailchimp_compat.php');
*/
function mailchimpSF_plugin_init() {
// Internationalize the plugin
- load_plugin_textdomain( 'mailchimp_i18n', MCSF_LANG_DIR.'po/');
+ load_plugin_textdomain( 'mailchimp_i18n', false, MCSF_LANG_DIR );// Bring in our appropriate JS and CSS resources
mailchimpSF_load_resources();
@@ -1153,9 +1153,8 @@ function mailchimpSF_where_am_i() {
// Define our complete filesystem path
define('MCSF_DIR', $mscf_dir);- /* Lang location needs to be relative *from* ABSPATH,
- so strip it out of our language dir location */
- define('MCSF_LANG_DIR', str_replace(ABSPATH, '', MCSF_DIR));
+ /* Lang location needs to be relative from WP_PLUGIN_DIR */
+ define('MCSF_LANG_DIR', dirname( plugin_basename( __FILE__ ) ) . '/po/');// Define our complete URL to the plugin folder
define('MCSF_URL', $mscf_url);
- The topic ‘Deprecated parameter in mailchimp plugin’ is closed to new replies.