• Home
  • サイトマップ
Blue Orange Green Pink Purple

Comment Notifier カスタマイズ

Posted in WordPress, カスタマイズ, プラグイン. on 火曜日, 4 月 7th, 2009 by 1ch
4 月 07

新規コメント(承認待ち、公開)時のメール通知プラグイン「Comment Notifier」のメール通知の内容をカスタマイズ。

新規コメント通知のメールフォーマットを
From:(コメント投稿者)(コメント投稿者E-mail)
Subject:(ブログ名)返信:(記事タイトル)
Body:(コメント投稿者)さんより
   (記事タイトル)に返信がありました

   返信内容:(コメント内容)
   返信内容を確認:(コメントURL)
にしたいので、

comments-notifier.phpの232〜246行目

$notify_message  = sprintf( __('New comment on your post #%1$s "%2$s"'), $comment->comment_post_ID, $post->post_title ) . "\r\n";
$notify_message .= sprintf( __('Author : %1$s (IP: %2$s , %3$s)'), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "\r\n";

から

$subject = apply_filters('comment_notification_subject', $subject, $comment_id);
$message_headers = "MIME-Version: 1.0\n"
. "$from\n"

までを

$notify_message  = sprintf( __('%1$s さんより'), $comment->comment_author ) . "\r\n";
$notify_message .= sprintf( __('「%1$s」に返信がありました'), $post->post_title ) . "\r\n\r\n";
$notify_message .= __('返信内容:') . "\r\n" . $comment->comment_content . "\r\n\r\n";
$notify_message .= __('返信内容を確認:') . "\r\n";
$subject = sprintf( __('[%1$s] 返信:%2$s'), $blogname, $post->post_title );
$notify_message .= get_permalink($comment->comment_post_ID) . "#comments\r\n\r\n";
$notify_message = apply_filters('comment_notification_text', $notify_message, $comment_id);
$subject = apply_filters('comment_notification_subject', $subject, $comment_id);
$message_headers = "MIME-Version: 1.0\n"
. "From: $comment->comment_author <$comment->comment_author_email> \n"

に差し替え

Leave a Reply

WordPress備忘ログ

  • カテゴリー
    • Mac (1)
    • WordPress (14)
    • WordPress MU (7)
    • カスタマイズ (13)
    • テーマ (1)
    • プラグイン (4)
    • 京都 (1)
  • 最近の投稿
    • Mac OS X環境移行
    • カスタムフィールドの記事内での表示方法
    • Comment Notifier カスタマイズ
    • WordPress(MU) コメント通知のカスタマイズ
    • Quick Comments (コメント投稿強化&コメント通知)
    • Subscribe2 カスタマイズ
    • XREA で WordPress アップロード機能を使う
  • タグ
    新規タグの追加
  • アーカイブ
  • Archives
    • 2010 年 7 月
    • 2009 年 4 月
    • 2009 年 3 月
    • 2009 年 2 月
  • Search






  • Home
  • サイトマップ

© Copyright WordPress備忘ログ. All rights reserved.
Designed by FTL Wordpress Themes brought to you by Smashing Magazine

Back to Top