the_guid() - WordPress 函数参考中文文档

返回介绍

the_guid()

发布于 2017-09-11 字数1813 浏览 927 评论 0

the_guid( int|WP_Post $post )

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.


参数

$post

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


源代码

File: wp-includes/post-template.php

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

更新日志

Version 描述
1.5.0 Introduced.

相关函数

Uses

  • wp-includes/post-template.php:
    the_guid
  • wp-includes/plugin.php:
    apply_filters()
  • wp-includes/post-template.php:
    get_the_guid()
  • wp-includes/post.php:
    get_post()

Used By

  • wp-admin/includes/export.php:
    export_wp()

User Contributed Notes

上一篇:the_generator()

下一篇:the_header_image_tag()

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

目前还没有任何评论,快来抢沙发吧!