WordPress.org

Make WordPress Core

Ticket #12893: get_comment_id_fields.diff

File get_comment_id_fields.diff, 1.3 KB (added by zoranzaric, 10 years ago)
  • wp-includes/comment-template.php

     
    11311131}
    11321132
    11331133/**
    1134  * Output hidden input HTML for replying to comments.
     1134 * Retrieve hidden input HTML for replying to comments.
    11351135 *
    1136  * @since 2.7.0
     1136 * @return string Hidden input HTML for replying to comments
    11371137 */
    1138 function comment_id_fields() {
     1138function get_comment_id_fields() {
    11391139        global $id;
    11401140
    11411141        $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";
     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 $result;
    11441145}
    11451146
    11461147/**
     1148 * Output hidden input HTML for replying to comments.
     1149 *
     1150 * @since 2.7.0
     1151 * @see get_comment_id_fields() Echoes result
     1152 */
     1153function comment_id_fields() {
     1154        echo get_comment_id_fields();
     1155}
     1156
     1157/**
    11471158 * Display text based on comment reply status. Only affects users with Javascript disabled.
    11481159 *
    11491160 * @since 2.7.0