the_guid

The timeline below displays how wordpress function 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

/**
 * Displays the Post Global Unique Identifier (guid).
 *
 * The guid will appear to be a link, but should not be used as a link to the
 * post. The reason you should not use it as a link, is because of moving the
 * blog across domains.
 *
 * URL is escaped to make it XML-safe.
 *
 * @since 1.5.0
 *
 * @param int|WP_Post $post Optional. Post ID or post object. Default is global $post.
 */
function the_guid($post = 0)
{
    $post = get_post($post);
    $post_guid = isset($post->guid) ? get_the_guid($post) : '';
    $post_id = isset($post->ID) ? $post->ID : 0;
    /**
     * Filters the escaped Global Unique Identifier (guid) of the post.
     *
     * @since 4.2.0
     *
     * @see get_the_guid()
     *
     * @param string $post_guid Escaped Global Unique Identifier (guid) of the post.
     * @param int    $post_id   The post ID.
     */
    echo apply_filters('the_guid', $post_guid, $post_id);
}

WordPress Version: 4.6

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

WordPress Version: 4.5

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

WordPress Version: 4.2

/**
 * Display 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.
 *
 * Url is escaped to make it xml safe
 *
 * @since 1.5.0
 *
 * @param int|WP_Post $id Optional. Post ID or post object.
 */
function the_guid($id = 0)
{
    /**
     * Filter the escaped Global Unique Identifier (guid) of the post.
     *
     * @since 4.2.0
     *
     * @see get_the_guid()
     *
     * @param string $post_guid Escaped Global Unique Identifier (guid) of the post.
     */
    echo apply_filters('the_guid', get_the_guid($id));
}

WordPress Version: 3.9

/**
 * Display 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.
 *
 * Url is escaped to make it xml safe
 *
 * @since 1.5.0
 *
 * @param int|WP_Post $id Optional. Post ID or post object.
 */
function the_guid($id = 0)
{
    echo esc_url(get_the_guid($id));
}

WordPress Version: 3.7

/**
 * Display 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.
 *
 * Url is escaped to make it xml safe
 *
 * @since 1.5.0
 *
 * @param int $id Optional. Post ID.
 */
function the_guid($id = 0)
{
    echo esc_url(get_the_guid($id));
}