get_comment() WP 1.0
Retrieves comment data given a comment ID or comment object.
If an object is passed then the comment data will be cached and then returned after being passed through a filter. If the comment is empty, then the global comment variable will be used, if it is set.
Works based on: WP_Comment()
Basis of: get_comment_text(), get_comment_author()
1 time = 0.000436s = fast | 50000 times = 0.38s = very fast | PHP 7.1.2RC1, WP 4.7.2
Hooks from the function
Return
WP_Comment/Array/null. Depends on $output value.
Usage
get_comment( $comment, $output );
- $comment(WP_Comment/string/int)
- Comment to retrieve.
Default: null - $output(string)
- The required return type. One of OBJECT, ARRAY_A, or ARRAY_N, which correspond to a WP_Comment object, an associative array, or a numeric array, respectively.
Default: OBJECT
Notes
- Global. WP_Comment. $comment Global comment object.
Changelog
Since 2.0.0 | Introduced. |
Code of get_comment() get comment WP 5.6
Related Functions
From category: Comments
- cancel_comment_reply_link()
- comment_author_email_link()
- comment_form()
- comment_form_title()
- comment_id_fields()
- comment_text()
- comment_type()
- comments_link()
- comments_number()
- comments_popup_link()
- get_avatar()
- get_avatar_data()
- get_avatar_url()
- get_cancel_comment_reply_link()
- get_comment_author_email()
- get_comment_pages_count()
- get_comment_reply_link()
- get_comment_text()
- get_comment_type()
- get_comments()
- get_comments_link()
- get_comments_number()
- get_comments_pagenum_link()
- get_edit_comment_link()
- get_next_comments_link()
- get_page_of_comment()
- get_previous_comments_link()
- get_the_comments_navigation()
- get_the_comments_pagination()
- is_comment_feed()
- is_trackback()
- next_comments_link()
- paginate_comments_links()
- previous_comments_link()
- sanitize_comment_cookies()
- the_comments_navigation()
- the_comments_pagination()
- wp_allow_comment()
- wp_count_comments()
- wp_delete_comment()
- wp_get_current_commenter()
- wp_handle_comment_submission()
- wp_insert_comment()
- wp_list_comments()
- wp_new_comment()
- wp_notify_moderator()
- wp_notify_postauthor()
- wp_set_comment_cookies()
- wp_set_comment_status()
- wp_spam_comment()
- wp_transition_comment_status()
- wp_update_comment()
- wp_update_comment_count()