On this page
get_comment_guid( int|WP_Comment $comment_id = null ): string|false
Retrieves the feed GUID for the current comment.
Parameters
$comment_idint|WP_Comment Optional-
comment object or ID. Defaults to global comment object.
Default:
null
Return
string|false GUID for comment on success, false on failure.
Source
File: wp-includes/feed.php. View all references
function get_comment_guid( $comment_id = null ) {
$comment = get_comment( $comment_id );
if ( ! is_object( $comment ) ) {
return false;
}
return get_the_guid( $comment->comment_post_ID ) . '#comment-' . $comment->comment_ID;
}
Related
Uses
| Uses | Description |
|---|---|
| get_the_guid() wp-includes/post-template.php | Retrieves the Post Global Unique Identifier (guid). |
| get_comment() wp-includes/comment.php | Retrieves comment data given a comment ID or comment object. |
Used By
| Used By | Description |
|---|---|
| comment_guid() wp-includes/feed.php | Displays the feed GUID for the current comment. |
Changelog
| Version | Description |
|---|---|
| 2.5.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/get_comment_guid