get_the_guid( int|WP_Post $post )

Retrieve the Post Global Unique Identifier (guid).

Description Description

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.

Parameters Parameters


(int|WP_Post) (Optional) Post ID or post object. Default is global $post.

Top ↑

Return Return


Top ↑

Source Source

File: wp-includes/post-template.php

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

Top ↑

Changelog Changelog

Version Description
1.5.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.