WordPressで相互リンクやYomi-searchのようなリンク集が簡単に作成できる大変便利なプラグイン「wordpress link directory」ですが、こちらの日本語化をしても登録時などに送信されるメールが文字化けしてしまう方もいるようです。(私は文字化けしました。)
簡単ではありますが、文字化けを直した際のメモ書きです。

プラグインの編集からwordpress-link-directory/link-directory.phpの以下の部分を日本語対応することによって文字化けがなくなります。
mail関数に与える引数の文字コードをSJISにしてあげます。
変更前
1 2 3 4 5 6 7 | // Email Admin New Link Details (If Selected) if(get_option('wplinkdir_emailme')=='Yes'){ $BlogName=get_option('blogname'); $SiteURL=get_option('siteurl'); $Subject=sprintf(__('%s - New Link Added',$WPLD_Domain),$BlogName); mail(get_option('admin_email'),$Subject,sprintf(__('This is just a quick message to let you know that someone has added a link to your link directory on %1$s (%2$s).'."\n\n".'Link Name: %3$s (PR %4$s)'."\n".'Site URL: %5$s'."\n\n".'You can edit or delete this link by logging into your admin section. You can turn off email updates by turning the Email Me option in the admin section.',$WPLD_Domain),$BlogName,$SiteURL,$title,$Rank,$url)); } |
変更後
1 2 3 4 5 6 7 8 | // Email Admin New Link Details (If Selected) if(get_option('wplinkdir_emailme')=='Yes'){ $BlogName=get_option('blogname'); $SiteURL=get_option('siteurl'); $Subject=sprintf(__('%s - New Link Added',$WPLD_Domain),$BlogName); //mb_convert_encodingで文字コード変更 mail(get_option('admin_email'),mb_convert_encoding($Subject, "SJIS", "auto"),mb_convert_encoding(sprintf(__('This is just a quick message to let you know that someone has added a link to your link directory on %1$s (%2$s).'."\n\n".'Link Name: %3$s (PR %4$s)'."\n".'Site URL: %5$s'."\n\n".'You can edit or delete this link by logging into your admin section. You can turn off email updates by turning the Email Me option in the admin section.',$WPLD_Domain),$BlogName,$SiteURL,$title,$Rank,$url), "SJIS", "auto")); } |
修正して、PHPを保存すれば日本語でメールが届くはずです。



