From 9cd8dd44c6b1103c569926b9321beb6f1b8d21e0 Mon Sep 17 00:00:00 2001 From: dd32 Date: Sun, 11 Apr 2010 08:56:18 +0000 Subject: [PATCH] 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 --- wp-includes/comment-template.php | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/wp-includes/comment-template.php b/wp-includes/comment-template.php index 3a27a2b03..616ad70c4 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(); } /**