• Hi, thanks for such a brilliant plugin. It’s got so much good stuff in it πŸ™‚

    The nature of the site I run means that when people edit comments, it can be useful for me to know what their original comment was. When AEC emails me, it would be good for it to show the original comment followed by the edited comment.

    I’ve gone through every aspect of the code and from what I can tell, this is impossible with the way the code works. It looks like the edit page is loaded, the comment text etc. is pulled out of the database, and then the script finishes with a die() command. Then, when the person clicks “save” after editing their comment, the code simply knows the ID of the comment and overwrites the database. Therefore at this point, the code doesn’t even know what the original comment was, only the comment number.

    Have I got that right?

    If so, is there any way of storing the original comment in a variable that can remain in memory somehow? The only thing I can think of is that the original comment can be sent as a hidden field when the comment editing window is drawn – so, when the person clicks “save”, the original comment is actually sent back along with the new comment. This presents a slight issue in that the original comment is clearly visible in the page source.

    The other option is to write an update_option() call, with the option name being, say, the comment ID plus the word “original”. When the person clicks “save” and the email notification method fires up, it can read the option from the database, put it in the email, then delete the option from the database. But that seems a bit too much.

    What do people think? I’d be grateful for any guidance πŸ™‚

    http://wordpress.org/extend/plugins/wp-ajax-edit-comments/

  • The topic ‘[Plugin: WP Ajax Edit Comments] Modify code to send original comment with email notification?’ is closed to new replies.