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
This commit is contained in:
parent
74c1d4e71d
commit
57749e1d2c
|
@ -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;
|
global $id;
|
||||||
|
|
||||||
$replytoid = isset($_GET['replytocom']) ? (int) $_GET['replytocom'] : 0;
|
$replytoid = isset($_GET['replytocom']) ? (int) $_GET['replytocom'] : 0;
|
||||||
echo "<input type='hidden' name='comment_post_ID' value='$id' id='comment_post_ID' />\n";
|
$result = "<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_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();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue