wpseek.com
A WordPress-centric search engine for devs and theme authors



get_comment_guid › WordPress Function

Since2.5.0
Deprecatedn/a
get_comment_guid ( $comment_id = null )
Parameters:
  • (int|WP_Comment) $comment_id Optional comment object or ID. Defaults to global comment object.
    Required: No
    Default: null
Returns:
  • (string|false) GUID for comment on success, false on failure.
Defined at:
Codex:

Retrieves the feed GUID for the current comment.



Source

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