wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren



the_guid › WordPress Function

Seit1.5.0
Veraltetn/v
the_guid ( $post = 0 )
Parameter:
  • (int|WP_Post) $post Optional. Post ID or post object. Default is global $post.
    Erforderlich: Nein
    Standard:
Definiert in:
Codex:

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.


Quellcode

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