get_comment_guid( int|WP_Comment $comment_id = null )

Retrieve the feed GUID for the current comment.


Description Description


Parameters Parameters

$comment_id

(int|WP_Comment) (Optional) comment object or id. Defaults to global comment object.

Default value: null


Top ↑

Return Return

(false|string) false on failure or guid for comment on success.


Top ↑

Source Source

File: wp-includes/feed.php

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;
}

Top ↑

Changelog Changelog

Changelog
Version Description
2.5.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.