
WordPress高级自定义字段教程
the_guid ( $post = 0 )
the_guid – 这个函数用来输出一个文章或页面的全球唯一标识符(GUID)。GUID是文章或页面的唯一标识符,通常用于RSS馈送。
显示文章的全球唯一标识符(guidfier)。
指南将显示为一个链接,但不应该被用作文章的链接。你不应该把它作为链接使用的原因,是由于跨域移动博客。
URL被转义以使它对XML安全。
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 ); }