Following are the list of functions and hooks of Comment API.
- check_comment() – Check whether a comment passes internal checks to be allowed to add.
- comment_text (filter) – Filters the text of a comment to be displayed.
- comment_max_links_url (filter) – Filters the number of links found in a comment.
- get_approved_comments() – Retrieve the approved comments for post $post_id.
- get_comment() – Retrieves comment data given a comment ID or comment object.
- get_comment (filter) – Fires after a comment is retrieved.
- get_comments() – Retrieve a list of comments.
- get_comment_statuses() – Retrieve all of the WordPress supported comment statuses.
- get_default_comment_status() – Gets the default comment status for a post type.
- get_default_comment_status (filter) – Filters the default comment status for the given post type.
- get_lastcommentmodified() – The date the last comment was modified.
- get_comment_count() – The amount of comments in a post or total comments.
- add_comment_meta() – Add meta data field to a comment.
- delete_comment_meta() – Remove metadata matching criteria from a comment.
- get_comment_meta() – Retrieve comment meta field for a comment.
- update_comment_meta() – Update comment meta field based on comment ID.
- wp_queue_comments_for_comment_meta_lazyload() – Queues comments for metadata lazy-loading.
- wp_allow_comment() – Validates whether this comment is allowed to be made.
- duplicate_comment_id (filter) – Filters the ID, if any, of the duplicate comment found when creating a new comment.
- comment_duplicate_trigger (action) – Fires immediately after a duplicate comment is detected.
- check_comment_flood (action) – Fires immediately before a comment is marked approved. Allows checking for comment flooding.
- wp_is_comment_flood (filter) – Filters whether a comment is part of a comment flood.
- pre_comment_approved (filter) – Filters a comment’s approval status before it is set.
- separate_comments() – Separates an array of comments into an array keyed by comment_type.
- get_comment_pages_count() – Calculate the total number of comment pages.
- get_page_of_comment() – Calculate what page number a comment will appear on for comment paging.
- get_page_of_comment (filter) – Filters the calculated page on which a comment appears.
- wp_get_comment_fields_max_lengths() – Retrieves the maximum character lengths for the comment form fields.
- wp_get_comment_fields_max_lengths (filter) – Filters the lengths for the comment form fields.
- wp_check_comment_data_max_lengths() – Compares the lengths of comment data against the maximum character limits.
- wp_blacklist_check() – Does comment contain blacklisted characters or words.
- wp_blacklist_check (action) – Fires before the comment is tested for blacklisted characters or words.
- wp_count_comments() – Retrieve total comments for blog or single post.
- wp_count_comments (filter) – Filters the comments count for a given post.
- wp_delete_comment() – Trashes or deletes a comment.
- delete_comment (action) – Fires immediately before a comment is deleted from the database.
- deleted_comment (action) – Fires immediately after a comment is deleted from the database.
- wp_set_comment_status (action) – Fires immediately before transitioning a comment’s status from one to another
- wp_trash_comment() – Moves a comment to the Trash
- trash_comment (action) – Fires immediately before a comment is sent to the Trash.
- trashed_comment (action) – Fires immediately after a comment is sent to Trash.
- wp_untrash_comment() – Removes a comment from the Trash
- untrash_comment (action) – Fires immediately before a comment is restored from the Trash.
- untrashed_comment (action) – Fires immediately after a comment is restored from the Trash.
- wp_spam_comment() – Marks a comment as Spam
- spam_comment (action) – Fires immediately before a comment is marked as Spam.
- spammed_comment (action) – Fires immediately after a comment is marked as Spam.
- wp_unspam_comment() – Removes a comment from the Spam
- unspam_comment (action) – Fires immediately before a comment is unmarked as Spam.
- unspammed_comment (action) – Fires immediately after a comment is unmarked as Spam.
- wp_get_comment_status() – The status of a comment by ID.
- wp_transition_comment_status() – Call hooks for when a comment status transition occurs.
- transition_comment_status (action) – Fires when the comment status is in transition.
- comment_{$old_status}_to_{$new_status} (action) – Fires when the comment status is in transition from one specific status to another.
- comment_{$new_status}_{$comment->comment_type} (action) – Fires when the status of a specific comment type is in transition.
- wp_insert_comment() – Inserts a comment into the database.
- wp_insert_comment (action) – Fires immediately after a comment is inserted into the database.
- wp_new_comment() – Adds a new comment to the database.
- preprocess_comment (filter) – Filters a comment’s data before it is sanitized and inserted into the database.
- comment_post (action) – Fires immediately after a comment is inserted into the database.
- wp_new_comment_notify_moderator() – Send a comment moderation notification to the comment moderator.
- notify_moderator (filter) – Filters whether to send the site moderator email notifications, overriding the site setting.
- wp_new_comment_notify_postauthor() – Send a notification of a new comment to the post author.
- notify_post_author (filter) – Filters whether to send the post author new comment notification emails.
- wp_set_comment_status() – Sets the status of a comment.
- wp_set_comment_status (action) – Fires immediately before transitioning a comment’s status from one to another
- wp_update_comment() – Updates an existing comment in the database.
- comment_save_pre (filter) – Filters the comment content before it is updated in the database.
- wp_update_comment_data (filter) – Filters the comment data immediately before it is updated in the database.
- edit_comment (action) – Fires immediately after a comment is updated in the database.
- wp_defer_comment_counting() – Whether to defer comment counting.
- wp_update_comment_count() – Updates the comment count for post(s).
- wp_update_comment_count_now() – Updates the comment count for the post.
- pre_wp_update_comment_count_now (filter) – Filters a post’s comment count before it is updated in the database.
- wp_update_comment_count (action) – Fires immediately after a post’s comment count is updated in the database.
- wp_handle_comment_submission() – Handles the submission of a comment, usually posted to wp-comments-post.php via a comment form.
- comment_id_not_found (action) – Fires when a comment is attempted on a post that does not exist.
- comment_closed (action) – Fires when a comment is attempted on a post that has comments closed.
- comment_on_trash (action) – Fires when a comment is attempted on a trashed post.
- comment_on_draft (action) – Fires when a comment is attempted on a post in draft mode.
- comment_on_password_protected (action) – Fires when a comment is attempted on a password-protected post.
- pre_comment_on_post (action) – Fires before a comment is posted.
Leave a Reply