get_the_guid

The timeline below displays how wordpress function get_the_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 Post Global Unique Identifier (guid).
 *
 * The guid will appear to be a link, but should not be used as an link to the
 * post. The reason you should not use it as a link, is because of moving the
 * blog across domains.
 *
 * @since 1.5.0
 *
 * @param int|WP_Post $post Optional. Post ID or post object. Default is global $post.
 * @return string
 */
function get_the_guid($post = 0)
{
    $post = get_post($post);
    $post_guid = isset($post->guid) ? $post->guid : '';
    $post_id = isset($post->ID) ? $post->ID : 0;
    /**
     * Filters the Global Unique Identifier (guid) of the post.
     *
     * @since 1.5.0
     *
     * @param string $post_guid Global Unique Identifier (guid) of the post.
     * @param int    $post_id   The post ID.
     */
    return apply_filters('get_the_guid', $post_guid, $post_id);
}

WordPress Version: 4.6

/**
 * Retrieve the Post Global Unique Identifier (guid).
 *
 * The guid will appear to be a link, but should not be used as an link to the
 * post. The reason you should not use it as a link, is because of moving the
 * blog across domains.
 *
 * @since 1.5.0
 *
 * @param int|WP_Post $post Optional. Post ID or post object. Default is global $post.
 * @return string
 */
function get_the_guid($post = 0)
{
    $post = get_post($post);
    $guid = isset($post->guid) ? $post->guid : '';
    $id = isset($post->ID) ? $post->ID : 0;
    /**
     * Filters the Global Unique Identifier (guid) of the post.
     *
     * @since 1.5.0
     *
     * @param string $guid Global Unique Identifier (guid) of the post.
     * @param int    $id   The post ID.
     */
    return apply_filters('get_the_guid', $guid, $id);
}

WordPress Version: 4.5

/**
 * Retrieve the Post Global Unique Identifier (guid).
 *
 * The guid will appear to be a link, but should not be used as an link to the
 * post. The reason you should not use it as a link, is because of moving the
 * blog across domains.
 *
 * @since 1.5.0
 *
 * @param int|WP_Post $post Optional. Post ID or post object. Default is global $post.
 * @return string
 */
function get_the_guid($post = 0)
{
    $post = get_post($post);
    $guid = isset($post->guid) ? $post->guid : '';
    $id = isset($post->ID) ? $post->ID : 0;
    /**
     * Filter the Global Unique Identifier (guid) of the post.
     *
     * @since 1.5.0
     *
     * @param string $guid Global Unique Identifier (guid) of the post.
     * @param int    $id   The post ID.
     */
    return apply_filters('get_the_guid', $guid, $id);
}

WordPress Version: 3.9

/**
 * Retrieve the Post Global Unique Identifier (guid).
 *
 * The guid will appear to be a link, but should not be used as an link to the
 * post. The reason you should not use it as a link, is because of moving the
 * blog across domains.
 *
 * @since 1.5.0
 *
 * @param int|WP_Post $id Optional. Post ID or post object.
 * @return string
 */
function get_the_guid($id = 0)
{
    $post = get_post($id);
    /**
     * Filter the Global Unique Identifier (guid) of the post.
     *
     * @since 1.5.0
     *
     * @param string $post_guid Global Unique Identifier (guid) of the post.
     */
    return apply_filters('get_the_guid', $post->guid);
}

WordPress Version: 3.7

/**
 * Retrieve the Post Global Unique Identifier (guid).
 *
 * The guid will appear to be a link, but should not be used as an link to the
 * post. The reason you should not use it as a link, is because of moving the
 * blog across domains.
 *
 * @since 1.5.0
 *
 * @param int $id Optional. Post ID.
 * @return string
 */
function get_the_guid($id = 0)
{
    $post = get_post($id);
    return apply_filters('get_the_guid', $post->guid);
}