get_comment_guid

The timeline below displays how wordpress function get_comment_guid has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.1

/**
 * Retrieves the feed GUID for the current comment.
 *
 * @since 2.5.0
 *
 * @param int|WP_Comment $comment_id Optional comment object or ID. Defaults to global comment object.
 * @return string|false GUID for comment on success, false on failure.
 */
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;
}

WordPress Version: 5.5

/**
 * Retrieve the feed GUID for the current comment.
 *
 * @since 2.5.0
 *
 * @param int|WP_Comment $comment_id Optional comment object or ID. Defaults to global comment object.
 * @return string|false GUID for comment on success, false on failure.
 */
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;
}

WordPress Version: 5.4

/**
 * Retrieve the feed GUID for the current comment.
 *
 * @since 2.5.0
 *
 * @param int|WP_Comment $comment_id Optional comment object or id. Defaults to global comment object.
 * @return string|false GUID for comment on success, false on failure.
 */
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;
}

WordPress Version: 4.4

/**
 * Retrieve the feed GUID for the current comment.
 *
 * @since 2.5.0
 *
 * @param int|WP_Comment $comment_id Optional comment object or id. Defaults to global comment object.
 * @return false|string false on failure or guid for comment on success.
 */
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;
}

WordPress Version: 4.1

/**
 * Retrieve the feed GUID for the current comment.
 *
 * @since 2.5.0
 *
 * @param int|object $comment_id Optional comment object or id. Defaults to global comment object.
 * @return false|string false on failure or guid for comment on success.
 */
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;
}

WordPress Version: 3.9

/**
 * Retrieve the feed GUID for the current comment.
 *
 * @since 2.5.0
 *
 * @param int|object $comment_id Optional comment object or id. Defaults to global comment object.
 * @return bool|string false on failure or guid for comment on success.
 */
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;
}

WordPress Version: 3.7

/**
 * Retrieve the feed GUID for the current comment.
 *
 * @package WordPress
 * @subpackage Feed
 * @since 2.5.0
 *
 * @param int|object $comment_id Optional comment object or id. Defaults to global comment object.
 * @return bool|string false on failure or guid for comment on success.
 */
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;
}