wpseek.com
Un motore di ricerca WordPress per sviluppatori e autori di temi



get_the_guid › WordPress Function

Da1.5.0
Deprecaton/a
get_the_guid ( $post = 0 )
Parametri:
  • (int|WP_Post) $post Optional. Post ID or post object. Default is global $post.
    Richiesto: No
    Default:
Ritorna:
  • (string)
Definito a:
Codex:

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.


Sorgenti

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