A WordPress-centric search engine for devs and theme authors



get_comment_guid ›

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:
  • (false|string) false on failure or guid for comment on success.
Defined at:
Codex:

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