I think you only want get_comment
and not get_comments
on this line:
$com=get_comments($comment_id);
You are only checking for a single comment, by the ID. get_comments
won’t do that the way you are using it.
There is a check halfway through the update_metadata
function that compares the existing value to new value under some circumstances. That runs before the update_comment_meta
hook and sometimes return
s so that that hook never runs. Admittedly this is a guess, but if you are passing the same value, such as true
every time this may be where it hangs.
The update_{$meta_type}_metadata
hook would fire, but is a filter and not really the best choice for this kind of hook. I am wondering if you shouldn’t be using the edit_comment
hook instead.
Related Posts:
- On WordPress 4.4, how to get the post id using the comment_post hook
- How to direct user after comment save
- Use has_filter on comment_post
- What for is the table “wp_commentmeta” exactly?
- Running a function on comment status change
- Hook to edit an column on comments screen?
- Is it possible to show custom comment metadata in the admin panel?
- Altering the pingback functionality
- Add Comment Custom Field
- count number of user comments with a specific comment meta value
- Upload images with comment
- Add a drop down list to comment form?
- What are the additional fields in wp_comments used for?
- Display comment meta data after quick update
- WordPress Comment. Need some details of wp_comments DB table
- How would I count the number of times a comment meta field’s value is in a post’s entire comments?
- WP 4.4.1 allow empty comments via add_action ‘pre_comment_on_post’
- Get comments from post and sort by commentmeta value
- WordPress custom form action url
- Auto delete comment if Contains
- Do I need to deal with WordPress SQL Injection
- How to sort posts by the average of comment meta values
- Assign author to comment from post edit page
- Comment search plugin
- delete duplicate comments
- Alternative to the filter comment_reply_link
- How to use the ‘comments_number’ filter?
- Get all child comments ids from parent comment id
- custom hooks before a comment is updated/edited in the database
- How to get a value from comment meta
- Name of comment field differs on different sites
- Make every comment go to the spam folder
- How to display comment meta under each comment content
- Update comment meta for all comments of specific post
- How to get Post title by locale with Qtranslate-X
- How can I edit comment meta value before it is saved?
- ‘comment_post’ hook doesn’t seem to work? [closed]
- get_comment_meta not behaving as expected
- What is the point of get_comment_count() if you cannot limit by a comment type?
- count number of all comments by a user on different (non-repeated) posts
- stumped on add_action hook to delete_comment – any ideas?
- How to Trigger comment_form_after action if comment_form() not used
- How to filter comments by comment_meta
- SQL command to delete “pending comments” doesn’t work…?
- Add custom field on admin dashboard comments / reviews
- Top rated posts Average rating issue
- WordPress Commenting System User access and Security
- Comments closed only for contributors
- Add comment meta
- Comment-Meta doesn’t work with latest wordpress update
- add field comment [duplicate]
- What filter or action to replace comments or add new comment system
- Use country flag as user avatar based on comments IP address?
- Nofollow the date/time hyperlink in comment
- Can add_image_size be added earlier
- How to replace anonymous comment form with a registration form on wordpress?
- Change hyperlink to User Registration page instead of WordPress login page
- Necessary to have a comments.php if there are no comments?
- $new_pass always returns null – password_reset hook
- How to add a class to comment submit button?
- Hook inside a hook
- Displaying comment rating stars in carousel
- Enable comments option
- Change Comment Text [duplicate]
- Why can’t I shove an instance of a class into a variable from a do_action hook?
- Comments.php is not getting called on main blog page
- wp_login_form() ignoring login_form action hook
- How do I alter the comments form in several different ways?
- Why does get_post() not return anything?
- How to enable truly anonymous posting in bbPress forums? [closed]
- Showing different images depending on user role
- Why the capability ‘activate_plugins’ is needed to allow a role to see all posts/pages/comments?
- What is wrong with this? [closed]
- Comment moderation
- Comments pagination on author page
- I have tried using Plugins to remove 72K comments with no success
- Change author, disable comments, enable trackbacks for all items in library
- Trying to get property of non-object notices in comment-template.php
- Does WordPress have something like timer hook?
- How to get the 5 most recent comments and each comment 5 most recent replies (children)
- Move jQuery on *top* of footer
- Custom comment action
- Add commentmeta custom field to every published comment with SQL
- js solution to… Commentor can only post one comment BUT can reply to their comment tree unlimited [duplicate]
- ‘Conflict’ with action deleted_post and is_admin()
- How Can I display the Current Logged-In User’s Comment at the Top of the Comments Section in WordPress?
- comment_moderation_subject is not working for me
- Passing a parameter to filter and action functions
- Admin – Dashboard – Unset recent comments
- Allowing comments on author pages
- Run only on plug-in activation instead of wp_head
- Comments closed but enabled on edit screen
- Let user delete comment on front end only
- Converting restricted html in comments to bbcode
- Comments page id wp_list_comments
- How to require users not to be logged in for comments on single page only?
- Comment section not appearing on posts
- Prevent author from editing comments from others in their post
- Display Most Recent Three Comments Per Post
- How can I eliminate all comments going into moderation?