函数原型
get_comment_guid( int|WP_Comment $comment_id = null ): string|false
函数描述
Retrieves the feed GUID for the current comment.
是否弃用
未弃用
函数参数
-
$comment_id
int|WP_Comment
Optional - comment object or ID. Defaults to global comment object.
Default:
null
函数返回值
string|false GUID for comment on success, false on failure.
函数位置
File: wp-includes/feed.php.
函数源码
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;
}
源码链接
变更日志
| Version | Description |
|---|---|
| 2.5.0 | Introduced. |

