wpseek.com
WordPress开发者和主题制作者的搜索引擎
get_comment_id_fields › WordPress Function
Since3.0.0
已弃用n/a
› get_comment_id_fields ( $post = null )
参数: |
|
返回: |
|
定义在: |
|
文档: | |
Change Log: |
|
Retrieves hidden input HTML for replying to comments.
Related Functions: comment_id_fields, get_comment_id, get_comment_guid, get_comment_date, get_comment_time
源码
function get_comment_id_fields( $post = null ) { $post = get_post( $post ); if ( ! $post ) { return ''; } $post_id = $post->ID; $reply_to_id = _get_comment_reply_id( $post_id ); $comment_id_fields = "<input type='hidden' name='comment_post_ID' value='$post_id' id='comment_post_ID' />\n"; $comment_id_fields .= "<input type='hidden' name='comment_parent' id='comment_parent' value='$reply_to_id' />\n"; /** * Filters the returned comment ID fields. * * @since 3.0.0 * * @param string $comment_id_fields The HTML-formatted hidden ID field comment elements. * @param int $post_id The post ID. * @param int $reply_to_id The ID of the comment being replied to. */ return apply_filters( 'comment_id_fields', $comment_id_fields, $post_id, $reply_to_id ); }