Updating an existing comment in the database is done by the function wp_update_comment
. As you can see, there is one hook, edit_comment
, which you can use to trigger an action when a comment is updated.
However, this hook fires after the comment has been updated. If you want to store the older version of the comment the hook is no use. Also, there is no obvious way to store older versions op the comment. You would have to modify the datastructure, for instance by creating an additional comment metadata field.
You could then hook into the comment_save_pre
filter in wp_update_comment
to store the old content in that metafield.
Related Posts:
- Hook to edit an column on comments screen?
- Altering the pingback functionality
- An action hook where a comment meta is updated
- On WordPress 4.4, how to get the post id using the comment_post hook
- Auto delete comment if Contains
- Assign author to comment from post edit page
- How to use the ‘comments_number’ filter?
- How to direct user after comment save
- ‘comment_post’ hook doesn’t seem to work? [closed]
- Delete comments function
- Comments closed only for contributors
- db query for retrieving comments without any reply
- What filter or action to replace comments or add new comment system
- Filtering the Admin Comments List to Show Only Comments from the Current User?
- Non-threaded comment replies with link to original comment
- When importing – failed to import: Invalid post type feedback
- How do we remove the H3 tag for the reply-title I.D
- How to display comment form error messages in the same page
- 3 moderators to approve comment
- show number of open comments on custom dashboard
- How to hide “Trackback” on paginated comments
- Is it possible to show custom comment metadata in the admin panel?
- Display all comments or recent comments per user on author page
- Does WordPress Allow Blank/Empty Comment Submissions In WordPress?
- How can comments be submitted when I don’t have a comment box on a page?
- how to have 2 comments_template() in one post
- Can’t get ID of post that relates to the comment
- How to enable visual editor when editing comments on the dashboard?
- Display comment meta data after quick update
- get_comments() where parent is not 0
- How to hide “Comments are disabled”
- Get number of comments per page
- Custom disqus_identifier not properly changing default value
- Edit Comment_Field while using T5 Comment Textarea On Top-Plugin
- Registered but Anonymous comments
- How to import only certain comments from post[s]
- Make wordpress comments work with include templatepath
- Callback function argument which is required for wp_list_comments ()
- The comment login form is visible to me but not to the user
- How to insert a comma to the child comment construction in function.php?
- Custom WP Comments Query with Nested Comments Possible? (Hierarchy/Depth)
- Log file reports SQL Error processing child comments
- how to properly use comments-template.php
- Reply By Email to comment notifications
- Get Post ID within wp_set_comment_status hook
- How to implement comments on specific fields in wordpress?
- wp_list_comments renders incorrectly nested
- Alternative to the filter comment_reply_link
- Number/ Position of a Comment
- get_comments not working consistantly with post_id
- Comments are invisible, what’s the problem with wp_list_comments?
- WP confusing “links to my articles” with “comments”?
- How to check if a comment has replies?
- Can I have Comments open to specific users only?
- Safely editing core files
- Woocommerce comments subscription [closed]
- Way to count the number of people who have commented on a post?
- Batch approve comments
- Disable comments and pingbacks on old custom post types
- Add paragraph tags to comments
- How to tweak comment fields properly from functions.php
- How to allow duplicate comments?
- Advanced Custom Fields comments [closed]
- Two textareas showing up in comments.php
- WordPress comments – delimiter “/” not found
- Give subscribers the option to post anonymously
- Styling Admin comments in WP 3.1.3
- Displaying comment counts in WP Gallery thumbnail view
- Removing comment option
- pre_comment_content filter not working using IntenseDebate Enhanced moderation
- How t Remove Labels from comment Box
- WordPress comment processing . Default unapproved comments detection before posting
- How to rename/change the comment labels in WordPress backend?
- Edit Comments Fields
- Random output of comments using a shortcode
- Allow comments only for custom post type
- Comment author profile image
- Comment Form Fields when user logged in
- How add custom text under comment form
- Can’t hover on Submenu
- Can I allow registered users to comment without being logged in or having to be approved?
- Showing different images depending on user role
- Why the capability ‘activate_plugins’ is needed to allow a role to see all posts/pages/comments?
- How to require users not to be logged in for comments on single page only?
- How can I eliminate all comments going into moderation?
- WordPress shows admin’s avatar after editing a comment
- How to change comment-page-1#comment-25 to any string?
- change text written in english into hindi
- comment-reply.js always focuses on comment textarea
- I need to delete all posts from my homepage & create a static front page [closed]
- Is there a better way to check for a new comment?
- Comments from mobile apps & Disqus
- Commentform – Hightlight invalid fields instead of prompting towards error page
- Why might a comment turn red on approval?
- WordPress comment pagination : newest comments on first page
- member login using photo
- Pagination comments
- Rating based off of number of comments or views
- Preferred method to get comment reply link for comments with a depth of 0
- Easily invalidate form in comment_post hook