diff --git a/wp-includes/comment-template.php b/wp-includes/comment-template.php
index 3a27a2b030..616ad70c41 100644
--- a/wp-includes/comment-template.php
+++ b/wp-includes/comment-template.php
@@ -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 "\n";
- echo "\n";
+ $result = "\n";
+ $result .= "\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();
}
/**