From 57749e1d2ca0d40f5ca9e00c90edf6948f3ab211 Mon Sep 17 00:00:00 2001 From: Dion Hulse 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: https://develop.svn.wordpress.org/trunk@14067 602fd350-edb4-49c9-b593-d223f7449a82 --- 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 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(); } /**