Make WordPress Core


Ignore:
Timestamp:
04/11/2010 08:56:18 AM (15 years ago)
Author:
dd32
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/comment-template.php

    r13991 r14067  
    11321132
    11331133/**
     1134 * Retrieve hidden input HTML for replying to comments.
     1135 *
     1136 * @return string Hidden input HTML for replying to comments
     1137 */
     1138function get_comment_id_fields() {
     1139    global $id;
     1140
     1141    $replytoid = isset($_GET['replytocom']) ? (int) $_GET['replytocom'] : 0;
     1142    $result  = "<input type='hidden' name='comment_post_ID' value='$id' id='comment_post_ID' />\n";
     1143    $result .= "<input type='hidden' name='comment_parent' id='comment_parent' value='$replytoid' />\n";
     1144    return apply_filters('comment_id_fields', $result, $id, $replytoid);
     1145}
     1146
     1147/**
    11341148 * Output hidden input HTML for replying to comments.
    11351149 *
    11361150 * @since 2.7.0
     1151 * @see get_comment_id_fields() Echoes result
    11371152 */
    11381153function comment_id_fields() {
    1139     global $id;
    1140 
    1141     $replytoid = isset($_GET['replytocom']) ? (int) $_GET['replytocom'] : 0;
    1142     echo "<input type='hidden' name='comment_post_ID' value='$id' id='comment_post_ID' />\n";
    1143     echo "<input type='hidden' name='comment_parent' id='comment_parent' value='$replytoid' />\n";
     1154    echo get_comment_id_fields();
    11441155}
    11451156
Note: See TracChangeset for help on using the changeset viewer.