Introduce get_comment_id_fields() as a Getter for comment_id_fields(). Introduce a filter on the output to add extra fields. Props zoranzaric. Fixes #12893

git-svn-id: http://svn.automattic.com/wordpress/trunk@14067 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
dd32 2010-04-11 08:56:18 +00:00
parent 8d68a04c1f
commit 9cd8dd44c6

View File

@ -1131,16 +1131,27 @@ function cancel_comment_reply_link($text = '') {
}
/**
* Output hidden input HTML for replying to comments.
* Retrieve hidden input HTML for replying to comments.
*
* @since 2.7.0
* @return string Hidden input HTML for replying to comments
*/
function comment_id_fields() {
function get_comment_id_fields() {
global $id;
$replytoid = isset($_GET['replytocom']) ? (int) $_GET['replytocom'] : 0;
echo "<input type='hidden' name='comment_post_ID' value='$id' id='comment_post_ID' />\n";
echo "<input type='hidden' name='comment_parent' id='comment_parent' value='$replytoid' />\n";
$result = "<input type='hidden' name='comment_post_ID' value='$id' id='comment_post_ID' />\n";
$result .= "<input type='hidden' name='comment_parent' id='comment_parent' value='$replytoid' />\n";
return apply_filters('comment_id_fields', $result, $id, $replytoid);
}
/**
* Output hidden input HTML for replying to comments.
*
* @since 2.7.0
* @see get_comment_id_fields() Echoes result
*/
function comment_id_fields() {
echo get_comment_id_fields();
}
/**