Comments, Pings (category)

get_comments_number_text()

Gets the localized label for the number of comments on a post. Notifications and pings are included in the count. For use within the WordPress Loop.

Comment meta

add_comment_meta()

Adds metadata (custom field) for the specified comment.

delete_comment_meta()

Deletes additional comment data (also what custom fields for posts).

get_comment_meta()

Gets the metadata of the specified comment.

update_comment_meta()

Updates or adds metadata for the specified comment.

Comments

cancel_comment_reply_link()

Outputs a link for the comment form: "cancel reply".

comment_author_email_link()

Outputs the email address of the commenter as a mailto link.

comment_form()

Displays the ready code for the comment form.

comment_form_title()

Outputs the text for the comment form title, considering whether the commentator is replying to another comment or simply commenting on the post.

comment_id_fields()

Generates 2 hidden fields for the comment form: comment_post_ID and comment_parent. These fields are needed for the correct operation of the comment form.

comment_text()

Outputs the comment text on the screen.

comment_type()

Displays the name of the comment type. The names can be arbitrary.

comments_link()

Outputs the link (URL) to the comment form for the current post.

comments_popup_link()

Outputs a ready <a> link to the comment popup, works when using the script comments_popup_script().

get_avatar()

Retrieve the <img> tag with the avatar of a user who is authorized or provided an email address when commenting. Most commonly used in the comments section.

get_avatar_data()

Gets an array of data about the avatar, by the provided email, ID, user object, post object, or comment object.

get_avatar_url()

Gets the avatar URL based on the provided email, ID, or user object. You can also pass a post or comment object.

get_cancel_comment_reply_link()

Gets the "cancel reply" link for the comment form.

get_comment()

Gets the data of the specified comment from the database. Returns an instance of the WP_Comment class (it can be conditionally said that all fields of the wp_comments table are returned).

get_comment_author_email()

Gets the email of the author of the current comment in the loop. You can specify the comment ID for which you want to get the author's email.

get_comment_pages_count()

Counts the number of comment pages for a post (how many pages comments are split into).

get_comment_reply_link()

Gets the link <a> that allows replying to a comment. Used in the comment loop.

get_comment_text()

Get the text of the specified or current comment in the loop.

get_comment_type()

Gets the type of the specified or current comment in the loop.

get_comments()

Gets comments based on specified parameters, in the form of an array of data.

get_comments_link()

Gets the link (URL) to all comments for the current post.

get_comments_number()

Gets the number of all comments on a post, including notifications and pings.

get_comments_pagenum_link()

Gets the link to the specified comment pagination page of the post.

get_edit_comment_link()

Gets the URL to the edit page of the specified comment.

get_next_comments_link()

Gets a link (A tag) to the next comments page. Should be used on the post page.

get_page_of_comment()

Gets the pagination page of comments on the front-end where the specified comment should be displayed.

get_previous_comments_link()

Gets the link (A tag) to the previous comments page. Should be used on the post page.

get_the_comments_navigation()

Gets links to the previous/next comment pages, if such links exist. Used on post pages in the comments block.

get_the_comments_pagination()

Gets the pagination links for comments: a list of links to the next and previous pages of comments for the post.

is_comment_feed()

Checks if the request is a comment feed page. Conditional tag.

is_trackback()

Checks if the current request is a trackback page request.

next_comments_link()

Outputs a link (A tag) to the next page of comments.

paginate_comments_links()

Outputs a list of links to the comment pages (pagination links) of the current post.

previous_comments_link()

Displays a link to the previous comments page.

sanitize_comment_cookies()

Clears the comment form fields name, email, and website that are in cookies.

the_comments_navigation()

Outputs a navigation block for previous/next comments of a post, if they exist.

the_comments_pagination()

Outputs a block of pagination links for the comments pages of a post.

wp_allow_comment()

Checks whether the comment can be published based on the provided comment data or if it needs to be sent for review or marked as spam.

wp_count_comments()

Gets data about the number of comments on the site or separately for the specified post. Data is collected separately by comment types (all variants of the field comment_approved: approved, spam, etc.).

wp_delete_comment()

Deletes or trashes a comment by the specified ID.

wp_get_current_commenter()

Get current commenter's name, email, URL from cookies. Used for comments form.

wp_handle_comment_submission()

Processes the submission of a comment. It is called in the file wp-comments-post.php when a comment is submitted through the comment form.

wp_insert_comment()

Inserts/adds a comment into the database.

wp_list_comments()

Outputs comments of posts (posts, pages). The function can accept a number of parameters and is used in the template to display a list of comments for a post/page. Some parameters can be configured in the admin panel.

wp_new_comment()

Adds a new comment to the Database. Filters the data.

wp_notify_moderator()

Notifies the administrator and the author of the post by email about the addition of a new comment or ping that is awaiting approval.

wp_notify_postauthor()

Responsible for the email notification to the post author that a comment/ping (comment/trackback/pingback) has been left on their post. Sends an email notification.

wp_set_comment_cookies()

Sets the cookies (name, email, url) that are used to identify an unauthenticated user when commenting.

wp_set_comment_status()

Sets the comment status: hold, approve, spam.

wp_spam_comment()

Moves the specified comment to Spam (marks the comment as spam).

wp_transition_comment_status()

Calls special hooks when the status of a comment changes from one to another: for example, from unapproved to approved.

wp_update_comment()

Updates an existing comment in the Database.

wp_update_comment_count()

Updates the number of comments for the specified post.

Comments Loop

comment_author()

Outputs the name of the comment author.

comment_author_email()

Displays the author's email of the comment on the screen.

comment_author_link()

Outputs the name of the comment author as a link to the URL provided when commenting.

comment_author_url()

Outputs the URL of the commenter, which is specified when commenting. Only the URL is output, not a link.

comment_author_url_link()

Outputs the author's comment URL as a link.

comment_class()

Outputs CSS classes to assist in styling comments.

comment_date()

Outputs the publication date of the comment. You can specify the desired format.

comment_excerpt()

Displays a trimmed comment (maximum 20 words).

comment_ID()

Displays the ID of the current comment. Uses in a comments loop.

comment_link()

Outputs the comment link (URL).

comment_reply_link()

Outputs a link <a> that allows replying to a comment. The tag is used in the comments loop, for each comment.

comment_time()

Outputs the time of the comment publication. Used inside the comment loop.

comments_number()

Displays the number of comments for a post. Notifications and pings are included in the count. For use within the WordPress Loop.

edit_comment_link()

Outputs a link (HTML tag A) for editing the current comment in the loop, if the user has permission to do so.

get_comment_author()

Gets the name of the comment author. If the "author name" (comment_author) field is empty, the function will return: "Anonymous" (__('Anonymous')). The function is intended for use in the comment loop.

get_comment_author_link()

Gets the HTML link (<a>) to the author's site of the current comment. The anchor of the link will be the author's name. If the author did not specify their site when commenting, the function will return just the author's name, without a link.

get_comment_author_url()

Returns the URL of the comment author (usually this is the commentator's website). Returns the URL, not the HTML tag <a>. Used within the comments loop. If the comment author does not have a link specified, it will return an empty string.

get_comment_class()

Gets CSS classes as an array for the DIV tag that wraps each comment in a loop.

get_comment_date()

Gets the date of the specified comment.

get_comment_excerpt()

Gets a trimmed version of the current or specified comment (maximum 20 words).

get_comment_ID()

Outputs the ID of the current comment. Used in the comments loop.

get_comment_time()

Gets the publication time of the current comment. Used inside the comments loop.

have_comments()

Checks if there are comments to display on the current post page. Conditional tag.