
在JavaScript中使用媒体查询的教程
_get_comment_reply_id ( $post = null )
_get_comment_reply_id: 这是一个WordPress的内部函数,用来检索一个给定评论的评论回复ID。它被用来生成显示在每个评论下面的 “回复” 链接的HTML。
function _get_comment_reply_id( $post = null ) { $post = get_post( $post ); if ( ! $post || ! isset( $_GET['replytocom'] ) || ! is_numeric( $_GET['replytocom'] ) ) { return 0; } $reply_to_id = (int) $_GET['replytocom']; /* * Validate the comment. * Bail out if it does not exist, is not approved, or its * `comment_post_ID` does not match the given post ID. */ $comment = get_comment( $reply_to_id ); if ( ! $comment instanceof WP_Comment || 0 === (int) $comment->comment_approved || $post->ID !== (int) $comment->comment_post_ID ) { return 0; } return $reply_to_id; }