WordPress开发者和主题制作者的搜索引擎



get_comment_guid ›

Since2.5.0
已弃用n/a
get_comment_guid ( $comment_id = null )
参数:
  • (int|WP_Comment) $comment_id Optional comment object or id. Defaults to global comment object.
    Required: No
    默认: null
返回:
  • (false|string) false on failure or guid for comment on success.
定义在:
文档:

Retrieve the feed GUID for the current comment.



源码

function get_comment_guid( $comment_id = null ) {
	$comment = get_comment( $comment_id );

	if ( ! is_object( $comment ) ) {
		return false;
	}

	return get_the_guid( $comment->comment_post_ID ) . '#comment-' . $comment->comment_ID;
}