Make WordPress Core

Ticket #26687: comment-template.diff

File comment-template.diff, 27.0 KB (added by Thaicloud, 12 years ago)

Lots of spacing added inside of opening and closing parenthesis

  • wp-includes/comment-template.php

     
    2626                if ( $comment->user_id && $user = get_userdata( $comment->user_id ) )
    2727                        $author = $user->display_name;
    2828                else
    29                         $author = __('Anonymous');
     29                        $author = __( 'Anonymous' );
    3030        } else {
    3131                $author = $comment->comment_author;
    3232        }
     
    158158         * @param string $comment->comment_author_email The comment author's email address.
    159159         */
    160160        $email = apply_filters( 'comment_email', $comment->comment_author_email );
    161         if ((!empty($email)) && ($email != '@')) {
    162         $display = ($linktext != '') ? $linktext : $email;
     161        if ( ( !empty( $email ) ) && ( $email != '@' ) ) {
     162                $display = ( $linktext != '' ) ? $linktext : $email;
    163163                $return  = $before;
    164164                $return .= "<a href='mailto:$email'>$display</a>";
    165                 $return .= $after;
     165                $return .= $after;
    166166                return $return;
    167167        } else {
    168168                return '';
     
    253253 */
    254254function get_comment_author_url( $comment_ID = 0 ) {
    255255        $comment = get_comment( $comment_ID );
    256         $url = ('http://' == $comment->comment_author_url) ? '' : $comment->comment_author_url;
    257         $url = esc_url( $url, array('http', 'https') );
     256        $url = ( 'http://' == $comment->comment_author_url ) ? '' : $comment->comment_author_url;
     257        $url = esc_url( $url, array( 'http', 'https' ) );
    258258        /**
    259259         * Filter the comment author's URL.
    260260         *
     
    303303 */
    304304function get_comment_author_url_link( $linktext = '', $before = '', $after = '' ) {
    305305        $url = get_comment_author_url();
    306         $display = ($linktext != '') ? $linktext : $url;
     306        $display = ( $linktext != '' ) ? $linktext : $url;
    307307        $display = str_replace( 'http://www.', '', $display );
    308308        $display = str_replace( 'http://', '', $display );
    309         if ( '/' == substr($display, -1) )
    310                 $display = substr($display, 0, -1);
     309        if ( '/' == substr( $display, -1 ) )
     310                $display = substr( $display, 0, -1 );
    311311        $return = "$before<a href='$url' rel='external'>$display</a>$after";
    312312
    313313        /**
     
    346346function comment_class( $class = '', $comment_id = null, $post_id = null, $echo = true ) {
    347347        // Separates classes with a single space, collates classes for comment DIV
    348348        $class = 'class="' . join( ' ', get_comment_class( $class, $comment_id, $post_id ) ) . '"';
    349         if ( $echo)
     349        if ( $echo )
    350350                echo $class;
    351351        else
    352352                return $class;
     
    365365function get_comment_class( $class = '', $comment_id = null, $post_id = null ) {
    366366        global $comment_alt, $comment_depth, $comment_thread_alt;
    367367
    368         $comment = get_comment($comment_id);
     368        $comment = get_comment( $comment_id );
    369369
    370370        $classes = array();
    371371
     
    373373        $classes[] = ( empty( $comment->comment_type ) ) ? 'comment' : $comment->comment_type;
    374374
    375375        // If the comment author has an id (registered), then print the log in name
    376         if ( $comment->user_id > 0 && $user = get_userdata($comment->user_id) ) {
     376        if ( $comment->user_id > 0 && $user = get_userdata( $comment->user_id ) ) {
    377377                // For all registered users, 'byuser'
    378378                $classes[] = 'byuser';
    379                 $classes[] = 'comment-author-' . sanitize_html_class($user->user_nicename, $comment->user_id);
     379                $classes[] = 'comment-author-' . sanitize_html_class( $user->user_nicename, $comment->user_id );
    380380                // For comment authors who are the author of the post
    381                 if ( $post = get_post($post_id) ) {
     381                if ( $post = get_post( $post_id ) ) {
    382382                        if ( $comment->user_id === $post->post_author )
    383383                                $classes[] = 'bypostauthor';
    384384                }
    385385        }
    386386
    387         if ( empty($comment_alt) )
     387        if ( empty( $comment_alt ) )
    388388                $comment_alt = 0;
    389         if ( empty($comment_depth) )
     389        if ( empty( $comment_depth ) )
    390390                $comment_depth = 1;
    391         if ( empty($comment_thread_alt) )
     391        if ( empty( $comment_thread_alt ) )
    392392                $comment_thread_alt = 0;
    393393
    394394        if ( $comment_alt % 2 ) {
     
    413413
    414414        $classes[] = "depth-$comment_depth";
    415415
    416         if ( !empty($class) ) {
     416        if ( !empty( $class ) ) {
    417417                if ( !is_array( $class ) )
    418                         $class = preg_split('#\s+#', $class);
    419                 $classes = array_merge($classes, $class);
     418                        $class = preg_split( '#\s+#', $class );
     419                $classes = array_merge( $classes, $class );
    420420        }
    421421
    422         $classes = array_map('esc_attr', $classes);
     422        $classes = array_map( 'esc_attr', $classes );
    423423
    424424        /**
    425425         * Filter the returned CSS classes for the current comment.
     
    446446function get_comment_date( $d = '', $comment_ID = 0 ) {
    447447        $comment = get_comment( $comment_ID );
    448448        if ( '' == $d )
    449                 $date = mysql2date(get_option('date_format'), $comment->comment_date);
     449                $date = mysql2date( get_option( 'date_format' ), $comment->comment_date );
    450450        else
    451                 $date = mysql2date($d, $comment->comment_date);
     451                $date = mysql2date( $d, $comment->comment_date );
    452452        /**
    453453         * Filter the returned comment date.
    454454         *
     
    486486 */
    487487function get_comment_excerpt( $comment_ID = 0 ) {
    488488        $comment = get_comment( $comment_ID );
    489         $comment_text = strip_tags($comment->comment_content);
    490         $blah = explode(' ', $comment_text);
    491         if (count($blah) > 20) {
     489        $comment_text = strip_tags( $comment->comment_content );
     490        $blah = explode( ' ', $comment_text );
     491        if ( count( $blah ) > 20 ) {
    492492                $k = 20;
    493493                $use_dotdotdot = 1;
    494494        } else {
    495                 $k = count($blah);
     495                $k = count( $blah );
    496496                $use_dotdotdot = 0;
    497497        }
    498498        $excerpt = '';
    499         for ($i=0; $i<$k; $i++) {
     499        for ( $i=0; $i<$k; $i++ ) {
    500500                $excerpt .= $blah[$i] . ' ';
    501501        }
    502         $excerpt .= ($use_dotdotdot) ? '&hellip;' : '';
    503         return apply_filters('get_comment_excerpt', $excerpt);
     502        $excerpt .= ( $use_dotdotdot ) ? '&hellip;' : '';
     503        return apply_filters( 'get_comment_excerpt', $excerpt );
    504504}
    505505
    506506/**
     
    511511 * @param int $comment_ID Optional. The ID of the comment for which to print the excerpt. Default current comment.
    512512 */
    513513function comment_excerpt( $comment_ID = 0 ) {
    514         $comment_excerpt = get_comment_excerpt($comment_ID);
     514        $comment_excerpt = get_comment_excerpt( $comment_ID );
    515515        /**
    516516         * Filter the comment excerpt for display.
    517517         *
     
    562562function get_comment_link( $comment = null, $args = array() ) {
    563563        global $wp_rewrite, $in_comment_loop;
    564564
    565         $comment = get_comment($comment);
     565        $comment = get_comment( $comment );
    566566
    567567        // Backwards compat
    568         if ( !is_array($args) ) {
     568        if ( !is_array( $args ) ) {
    569569                $page = $args;
    570570                $args = array();
    571571                $args['page'] = $page;
     
    574574        $defaults = array( 'type' => 'all', 'page' => '', 'per_page' => '', 'max_depth' => '' );
    575575        $args = wp_parse_args( $args, $defaults );
    576576
    577         if ( '' === $args['per_page'] && get_option('page_comments') )
    578                 $args['per_page'] = get_option('comments_per_page');
     577        if ( '' === $args['per_page'] && get_option( 'page_comments' ) )
     578                $args['per_page'] = get_option( 'comments_per_page' );
    579579
    580         if ( empty($args['per_page']) ) {
     580        if ( empty( $args['per_page'] ) ) {
    581581                $args['per_page'] = 0;
    582582                $args['page'] = 0;
    583583        }
    584584
    585585        if ( $args['per_page'] ) {
    586586                if ( '' == $args['page'] )
    587                         $args['page'] = ( !empty($in_comment_loop) ) ? get_query_var('cpage') : get_page_of_comment( $comment->comment_ID, $args );
     587                        $args['page'] = ( !empty( $in_comment_loop ) ) ? get_query_var( 'cpage' ) : get_page_of_comment( $comment->comment_ID, $args );
    588588
    589589                if ( $wp_rewrite->using_permalinks() )
    590590                        $link = user_trailingslashit( trailingslashit( get_permalink( $comment->comment_post_ID ) ) . 'comment-page-' . $args['page'], 'comment' );
     
    658658        if ( !$post_id )
    659659                $post_id = get_the_ID();
    660660
    661         $post = get_post($post_id);
    662         if ( ! isset($post->comment_count) )
     661        $post = get_post( $post_id );
     662        if ( ! isset( $post->comment_count ) )
    663663                $count = 0;
    664664        else
    665665                $count = $post->comment_count;
     
    692692        $number = get_comments_number();
    693693
    694694        if ( $number > 1 )
    695                 $output = str_replace('%', number_format_i18n($number), ( false === $more ) ? __('% Comments') : $more);
     695                $output = str_replace( '%', number_format_i18n( $number ), ( false === $more ) ? __( '% Comments' ) : $more );
    696696        elseif ( $number == 0 )
    697                 $output = ( false === $zero ) ? __('No Comments') : $zero;
     697                $output = ( false === $zero ) ? __( 'No Comments' ) : $zero;
    698698        else // must be one
    699                 $output = ( false === $one ) ? __('1 Comment') : $one;
     699                $output = ( false === $one ) ? __( '1 Comment' ) : $one;
    700700
    701701        /**
    702702         * Filter the comments count for display.
     
    773773        global $comment;
    774774        $comment_date = $gmt ? $comment->comment_date_gmt : $comment->comment_date;
    775775        if ( '' == $d )
    776                 $date = mysql2date(get_option('time_format'), $comment_date, $translate);
     776                $date = mysql2date( get_option( 'time_format' ), $comment_date, $translate );
    777777        else
    778                 $date = mysql2date($d, $comment_date, $translate);
     778                $date = mysql2date( $d, $comment_date, $translate );
    779779
    780780        /**
    781781         * Filter the returned comment time.
     
    798798 * @param string $d Optional. The format of the time. Default user's settings.
    799799 */
    800800function comment_time( $d = '' ) {
    801         echo get_comment_time($d);
     801        echo get_comment_time( $d );
    802802}
    803803
    804804/**
     
    862862 * @return string The trackback URL after being filtered.
    863863 */
    864864function get_trackback_url() {
    865         if ( '' != get_option('permalink_structure') )
    866                 $tb_url = trailingslashit(get_permalink()) . user_trailingslashit('trackback', 'single_trackback');
     865        if ( '' != get_option( 'permalink_structure' ) )
     866                $tb_url = trailingslashit( get_permalink() ) . user_trailingslashit( 'trackback', 'single_trackback' );
    867867        else
    868                 $tb_url = get_option('siteurl') . '/wp-trackback.php?p=' . get_the_ID();
     868                $tb_url = get_option( 'siteurl' ) . '/wp-trackback.php?p=' . get_the_ID();
    869869
    870870        /**
    871871         * Filter the returned trackback URL.
     
    887887 */
    888888function trackback_url( $deprecated_echo = true ) {
    889889        if ( $deprecated_echo !== true )
    890                 _deprecated_argument( __FUNCTION__, '2.5', __('Use <code>get_trackback_url()</code> instead if you do not want the value echoed.') );
     890                _deprecated_argument( __FUNCTION__, '2.5', __( 'Use <code>get_trackback_url()</code> instead if you do not want the value echoed.' ) );
    891891        if ( $deprecated_echo )
    892892                echo get_trackback_url();
    893893        else
     
    907907        if ( !empty( $deprecated ) )
    908908                _deprecated_argument( __FUNCTION__, '2.5' );
    909909
    910         if ( false !== stripos($_SERVER['HTTP_USER_AGENT'], 'W3C_Validator') )
     910        if ( false !== stripos( $_SERVER['HTTP_USER_AGENT'], 'W3C_Validator' ) )
    911911                return;
    912912
    913913        echo '<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
     
    919919        echo '    dc:identifier="';
    920920        the_permalink();
    921921        echo '"'."\n";
    922         echo '    dc:title="'.str_replace('--', '&#x2d;&#x2d;', wptexturize(strip_tags(get_the_title()))).'"'."\n";
     922        echo '    dc:title="'.str_replace( '--', '&#x2d;&#x2d;', wptexturize( strip_tags( get_the_title() ) ) ).'"'."\n";
    923923        echo '    trackback:ping="'.get_trackback_url().'"'." />\n";
    924924        echo '</rdf:RDF>';
    925925}
     
    934934 */
    935935function comments_open( $post_id = null ) {
    936936
    937         $_post = get_post($post_id);
     937        $_post = get_post( $post_id );
    938938
    939939        $open = ( 'open' == $_post->comment_status );
    940940
     
    959959 */
    960960function pings_open( $post_id = null ) {
    961961
    962         $_post = get_post($post_id);
     962        $_post = get_post( $post_id );
    963963
    964964        $open = ( 'open' == $_post->ping_status );
    965965        return apply_filters( 'pings_open', $open, $post_id );
     
    10171017function comments_template( $file = '/comments.php', $separate_comments = false ) {
    10181018        global $wp_query, $withcomments, $post, $wpdb, $id, $comment, $user_login, $user_ID, $user_identity, $overridden_cpage;
    10191019
    1020         if ( !(is_single() || is_page() || $withcomments) || empty($post) )
     1020        if ( !( is_single() || is_page() || $withcomments ) || empty( $post ) )
    10211021                return;
    10221022
    1023         if ( empty($file) )
     1023        if ( empty( $file ) )
    10241024                $file = '/comments.php';
    10251025
    1026         $req = get_option('require_name_email');
     1026        $req = get_option( 'require_name_email' );
    10271027
    10281028        /**
    10291029         * Comment author information fetched from the comment cookies.
     
    10451045        /**
    10461046         * The url of the current comment author escaped for use in attributes.
    10471047         */
    1048         $comment_author_url = esc_url($commenter['comment_author_url']);
     1048        $comment_author_url = esc_url( $commenter['comment_author_url'] );
    10491049
    10501050        /** @todo Use API instead of SELECTs. */
    10511051        if ( $user_ID) {
    1052                 $comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND (comment_approved = '1' OR ( user_id = %d AND comment_approved = '0' ) )  ORDER BY comment_date_gmt", $post->ID, $user_ID));
     1052                $comments = $wpdb->get_results($wpdb->prepare( "SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND (comment_approved = '1' OR ( user_id = %d AND comment_approved = '0' ) )  ORDER BY comment_date_gmt", $post->ID, $user_ID ) );
    10531053        } else if ( empty($comment_author) ) {
    1054                 $comments = get_comments( array('post_id' => $post->ID, 'status' => 'approve', 'order' => 'ASC') );
     1054                $comments = get_comments( array( 'post_id' => $post->ID, 'status' => 'approve', 'order' => 'ASC' ) );
    10551055        } else {
    1056                 $comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND ( comment_approved = '1' OR ( comment_author = %s AND comment_author_email = %s AND comment_approved = '0' ) ) ORDER BY comment_date_gmt", $post->ID, wp_specialchars_decode($comment_author,ENT_QUOTES), $comment_author_email));
     1056                $comments = $wpdb->get_results($wpdb->prepare( "SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND ( comment_approved = '1' OR ( comment_author = %s AND comment_author_email = %s AND comment_approved = '0' ) ) ORDER BY comment_date_gmt", $post->ID, wp_specialchars_decode( $comment_author,ENT_QUOTES ), $comment_author_email ) );
    10571057        }
    10581058
    10591059        // keep $comments for legacy's sake
     
    10671067         */
    10681068        $wp_query->comments = apply_filters( 'comments_array', $comments, $post->ID );
    10691069        $comments = &$wp_query->comments;
    1070         $wp_query->comment_count = count($wp_query->comments);
    1071         update_comment_cache($wp_query->comments);
     1070        $wp_query->comment_count = count( $wp_query->comments );
     1071        update_comment_cache( $wp_query->comments );
    10721072
    10731073        if ( $separate_comments ) {
    1074                 $wp_query->comments_by_type = separate_comments($comments);
     1074                $wp_query->comments_by_type = separate_comments( $comments );
    10751075                $comments_by_type = &$wp_query->comments_by_type;
    10761076        }
    10771077
    10781078        $overridden_cpage = false;
    1079         if ( '' == get_query_var('cpage') && get_option('page_comments') ) {
    1080                 set_query_var( 'cpage', 'newest' == get_option('default_comments_page') ? get_comment_pages_count() : 1 );
     1079        if ( '' == get_query_var( 'cpage' ) && get_option( 'page_comments' ) ) {
     1080                set_query_var( 'cpage', 'newest' == get_option( 'default_comments_page' ) ? get_comment_pages_count() : 1 );
    10811081                $overridden_cpage = true;
    10821082        }
    10831083
    1084         if ( !defined('COMMENTS_TEMPLATE') )
    1085                 define('COMMENTS_TEMPLATE', true);
     1084        if ( !defined( 'COMMENTS_TEMPLATE' ) )
     1085                define( 'COMMENTS_TEMPLATE', true );
    10861086
    10871087        $theme_template = STYLESHEETPATH . $file;
    10881088        /**
     
    11221122function comments_popup_script( $width = 400, $height = 400, $file = '' ) {
    11231123        global $wpcommentspopupfile, $wpcommentsjavascript;
    11241124
    1125         if (empty ($file)) {
     1125        if ( empty ( $file ) ) {
    11261126                $wpcommentspopupfile = '';  // Use the index.
    11271127        } else {
    11281128                $wpcommentspopupfile = $file;
     
    11641164        $number = get_comments_number( $id );
    11651165
    11661166        if ( 0 == $number && !comments_open() && !pings_open() ) {
    1167                 echo '<span' . ((!empty($css_class)) ? ' class="' . esc_attr( $css_class ) . '"' : '') . '>' . $none . '</span>';
     1167                echo '<span' . ( ( !empty( $css_class ) ) ? ' class="' . esc_attr( $css_class ) . '"' : '' ) . '>' . $none . '</span>';
    11681168                return;
    11691169        }
    11701170
    11711171        if ( post_password_required() ) {
    1172                 echo __('Enter your password to view comments.');
     1172                echo __( 'Enter your password to view comments.' );
    11731173                return;
    11741174        }
    11751175
     
    11781178                if ( empty( $wpcommentspopupfile ) )
    11791179                        $home = home_url();
    11801180                else
    1181                         $home = get_option('siteurl');
     1181                        $home = get_option( 'siteurl' );
    11821182                echo $home . '/' . $wpcommentspopupfile . '?comments_popup=' . $id;
    11831183                echo '" onclick="wpopen(this.href); return false"';
    11841184        } else { // if comments_popup_script() is not in the template, display simple comment link
     
    11921192        if ( !empty( $css_class ) ) {
    11931193                echo ' class="'.$css_class.'" ';
    11941194        }
    1195         $title = the_title_attribute( array('echo' => 0 ) );
     1195        $title = the_title_attribute( array( 'echo' => 0 ) );
    11961196
    11971197        $attributes = '';
    11981198        /**
     
    12041204         */
    12051205        echo apply_filters( 'comments_popup_link_attributes', $attributes );
    12061206
    1207         echo ' title="' . esc_attr( sprintf( __('Comment on %s'), $title ) ) . '">';
     1207        echo ' title="' . esc_attr( sprintf( __( 'Comment on %s' ), $title ) ) . '">';
    12081208        comments_number( $zero, $one, $more );
    12091209        echo '</a>';
    12101210}
     
    12341234 * @param int|WP_Post $post    Optional. Post ID or WP_Post object the comment is going to be displayed on. Default current post.
    12351235 * @return mixed Link to show comment form, if successful. False, if comments are closed.
    12361236 */
    1237 function get_comment_reply_link($args = array(), $comment = null, $post = null) {
     1237function get_comment_reply_link( $args = array(), $comment = null, $post = null ) {
    12381238
    12391239        $defaults = array(
    12401240                'add_below'  => 'comment',
    12411241                'respond_id' => 'respond',
    1242                 'reply_text' => __('Reply'),
    1243                 'login_text' => __('Log in to Reply'),
     1242                'reply_text' => __( 'Reply' ),
     1243                'login_text' => __( 'Log in to Reply' ),
    12441244                'depth'      => 0,
    12451245                'before'     => '',
    12461246                'after'      => ''
    12471247        );
    12481248
    1249         $args = wp_parse_args($args, $defaults);
     1249        $args = wp_parse_args( $args, $defaults );
    12501250
    12511251        if ( 0 == $args['depth'] || $args['max_depth'] <= $args['depth'] )
    12521252                return;
    12531253
    1254         extract($args, EXTR_SKIP);
     1254        extract( $args, EXTR_SKIP );
    12551255
    1256         $comment = get_comment($comment);
    1257         if ( empty($post) )
     1256        $comment = get_comment( $comment );
     1257        if ( empty( $post ) )
    12581258                $post = $comment->comment_post_ID;
    1259         $post = get_post($post);
     1259        $post = get_post( $post );
    12601260
    1261         if ( !comments_open($post->ID) )
     1261        if ( !comments_open( $post->ID ) )
    12621262                return false;
    12631263
    12641264        $link = '';
    12651265
    1266         if ( get_option('comment_registration') && ! is_user_logged_in() )
     1266        if ( get_option( 'comment_registration' ) && ! is_user_logged_in() )
    12671267                $link = '<a rel="nofollow" class="comment-reply-login" href="' . esc_url( wp_login_url( get_permalink() ) ) . '">' . $login_text . '</a>';
    12681268        else
    12691269                $link = "<a class='comment-reply-link' href='" . esc_url( add_query_arg( 'replytocom', $comment->comment_ID ) ) . "#" . $respond_id . "' onclick='return addComment.moveForm(\"$add_below-$comment->comment_ID\", \"$comment->comment_ID\", \"$respond_id\", \"$post->ID\")'>$reply_text</a>";
     
    12931293 * @param int|WP_Post $post    Optional. Post ID or WP_Post object the comment is going to be displayed on. Default current post.
    12941294 * @return mixed Link to show comment form, if successful. False, if comments are closed.
    12951295 */
    1296 function comment_reply_link($args = array(), $comment = null, $post = null) {
    1297         echo get_comment_reply_link($args, $comment, $post);
     1296function comment_reply_link( $args = array(), $comment = null, $post = null ) {
     1297        echo get_comment_reply_link( $args, $comment, $post );
    12981298}
    12991299
    13001300/**
     
    13181318 * @param int|WP_Post $post    Optional. Post ID or WP_Post object the comment is going to be displayed on. Default current post.
    13191319 * @return string|bool|null Link to show comment form, if successful. False, if comments are closed.
    13201320 */
    1321 function get_post_reply_link($args = array(), $post = null) {
     1321function get_post_reply_link( $args = array(), $post = null ) {
    13221322        $defaults = array(
    13231323                'add_below'  => 'post',
    13241324                'respond_id' => 'respond',
    1325                 'reply_text' => __('Leave a Comment'),
    1326                 'login_text' => __('Log in to leave a Comment'),
     1325                'reply_text' => __( 'Leave a Comment' ),
     1326                'login_text' => __( 'Log in to leave a Comment' ),
    13271327                'before'     => '',
    13281328                'after'      => '',
    13291329        );
    13301330
    1331         $args = wp_parse_args($args, $defaults);
    1332         extract($args, EXTR_SKIP);
    1333         $post = get_post($post);
     1331        $args = wp_parse_args( $args, $defaults );
     1332        extract( $args, EXTR_SKIP );
     1333        $post = get_post( $post );
    13341334
    1335         if ( !comments_open($post->ID) )
     1335        if ( !comments_open( $post->ID ) )
    13361336                return false;
    13371337
    1338         if ( get_option('comment_registration') && ! is_user_logged_in() )
     1338        if ( get_option( 'comment_registration' ) && ! is_user_logged_in() )
    13391339                $link = '<a rel="nofollow" href="' . wp_login_url( get_permalink() ) . '">' . $login_text . '</a>';
    13401340        else
    1341                 $link = "<a rel='nofollow' class='comment-reply-link' href='" . get_permalink($post->ID) . "#$respond_id' onclick='return addComment.moveForm(\"$add_below-$post->ID\", \"0\", \"$respond_id\", \"$post->ID\")'>$reply_text</a>";
     1341                $link = "<a rel='nofollow' class='comment-reply-link' href='" . get_permalink( $post->ID ) . "#$respond_id' onclick='return addComment.moveForm(\"$add_below-$post->ID\", \"0\", \"$respond_id\", \"$post->ID\")'>$reply_text</a>";
    13421342
    13431343        $formatted_link = $before . $link . $after;
    13441344        /**
     
    13611361 * @param int|WP_Post $post Optional. Post ID or WP_Post object the comment is going to be displayed on. Default current post.
    13621362 * @return string|bool|null Link to show comment form, if successful. False, if comments are closed.
    13631363 */
    1364 function post_reply_link($args = array(), $post = null) {
    1365         echo get_post_reply_link($args, $post);
     1364function post_reply_link( $args = array(), $post = null ) {
     1365        echo get_post_reply_link( $args, $post );
    13661366}
    13671367
    13681368/**
     
    13731373 * @param string $text Optional. Text to display for cancel reply link. Default empty.
    13741374 */
    13751375function get_cancel_comment_reply_link( $text = '' ) {
    1376         if ( empty($text) )
    1377                 $text = __('Click here to cancel reply.');
     1376        if ( empty( $text ) )
     1377                $text = __( 'Click here to cancel reply.' );
    13781378
    1379         $style = isset($_GET['replytocom']) ? '' : ' style="display:none;"';
    1380         $link = esc_html( remove_query_arg('replytocom') ) . '#respond';
     1379        $style = isset( $_GET['replytocom'] ) ? '' : ' style="display:none;"';
     1380        $link = esc_html( remove_query_arg( 'replytocom' ) ) . '#respond';
    13811381
    13821382        $formatted_link = '<a rel="nofollow" id="cancel-comment-reply-link" href="' . $link . '"' . $style . '>' . $text . '</a>';
    13831383        /**
     
    14001400 * @param string $text Optional. Text to display for cancel reply link. Default empty.
    14011401 */
    14021402function cancel_comment_reply_link( $text = '' ) {
    1403         echo get_cancel_comment_reply_link($text);
     1403        echo get_cancel_comment_reply_link( $text );
    14041404}
    14051405
    14061406/**
     
    14151415        if ( empty( $id ) )
    14161416                $id = get_the_ID();
    14171417
    1418         $replytoid = isset($_GET['replytocom']) ? (int) $_GET['replytocom'] : 0;
     1418        $replytoid = isset( $_GET['replytocom'] ) ? (int) $_GET['replytocom'] : 0;
    14191419        $result  = "<input type='hidden' name='comment_post_ID' value='$id' id='comment_post_ID' />\n";
    14201420        $result .= "<input type='hidden' name='comment_parent' id='comment_parent' value='$replytoid' />\n";
    14211421
     
    14601460        if ( false === $noreplytext ) $noreplytext = __( 'Leave a Reply' );
    14611461        if ( false === $replytext ) $replytext = __( 'Leave a Reply to %s' );
    14621462
    1463         $replytoid = isset($_GET['replytocom']) ? (int) $_GET['replytocom'] : 0;
     1463        $replytoid = isset( $_GET['replytocom'] ) ? (int) $_GET['replytocom'] : 0;
    14641464
    14651465        if ( 0 == $replytoid )
    14661466                echo $noreplytext;
    14671467        else {
    1468                 $comment = get_comment($replytoid);
     1468                $comment = get_comment( $replytoid );
    14691469                $author = ( $linktoparent ) ? '<a href="#comment-' . get_comment_ID() . '">' . get_comment_author() . '</a>' : get_comment_author();
    14701470                printf( $replytext, $author );
    14711471        }
     
    14971497         * @since 2.7.0
    14981498         * @var array
    14991499         */
    1500         var $db_fields = array ('parent' => 'comment_parent', 'id' => 'comment_ID');
     1500        var $db_fields = array ( 'parent' => 'comment_parent', 'id' => 'comment_ID' );
    15011501
    15021502        /**
    15031503         * Start the list before the elements are added.
     
    15961596
    15971597                // If we're at the max depth, and the current element still has children, loop over those and display them at this level
    15981598                // This is to prevent them being orphaned to the end of the list.
    1599                 if ( $max_depth <= $depth + 1 && isset( $children_elements[$id]) ) {
     1599                if ( $max_depth <= $depth + 1 && isset( $children_elements[$id] ) ) {
    16001600                        foreach ( $children_elements[ $id ] as $child )
    16011601                                $this->display_element( $child, $children_elements, $max_depth, $depth, $args, $output );
    16021602
     
    18451845        // Figure out what comments we'll be looping through ($_comments)
    18461846        if ( null !== $comments ) {
    18471847                $comments = (array) $comments;
    1848                 if ( empty($comments) )
     1848                if ( empty( $comments ) )
    18491849                        return;
    18501850                if ( 'all' != $r['type'] ) {
    1851                         $comments_by_type = separate_comments($comments);
    1852                         if ( empty($comments_by_type[$r['type']]) )
     1851                        $comments_by_type = separate_comments( $comments );
     1852                        if ( empty( $comments_by_type[$r['type']] ) )
    18531853                                return;
    18541854                        $_comments = $comments_by_type[$r['type']];
    18551855                } else {
    18561856                        $_comments = $comments;
    18571857                }
    18581858        } else {
    1859                 if ( empty($wp_query->comments) )
     1859                if ( empty( $wp_query->comments ) )
    18601860                        return;
    18611861                if ( 'all' != $r['type'] ) {
    1862                         if ( empty($wp_query->comments_by_type) )
    1863                                 $wp_query->comments_by_type = separate_comments($wp_query->comments);
    1864                         if ( empty($wp_query->comments_by_type[$r['type']]) )
     1862                        if ( empty( $wp_query->comments_by_type ) )
     1863                                $wp_query->comments_by_type = separate_comments( $wp_query->comments );
     1864                        if ( empty( $wp_query->comments_by_type[$r['type']] ) )
    18651865                                return;
    18661866                        $_comments = $wp_query->comments_by_type[$r['type']];
    18671867                } else {
     
    18691869                }
    18701870        }
    18711871
    1872         if ( '' === $r['per_page'] && get_option('page_comments') )
    1873                 $r['per_page'] = get_query_var('comments_per_page');
     1872        if ( '' === $r['per_page'] && get_option( 'page_comments' ) )
     1873                $r['per_page'] = get_query_var( 'comments_per_page' );
    18741874
    1875         if ( empty($r['per_page']) ) {
     1875        if ( empty( $r['per_page'] ) ) {
    18761876                $r['per_page'] = 0;
    18771877                $r['page'] = 0;
    18781878        }
    18791879
    18801880        if ( '' === $r['max_depth'] ) {
    1881                 if ( get_option('thread_comments') )
    1882                         $r['max_depth'] = get_option('thread_comments_depth');
     1881                if ( get_option( 'thread_comments' ) )
     1882                        $r['max_depth'] = get_option( 'thread_comments_depth' );
    18831883                else
    18841884                        $r['max_depth'] = -1;
    18851885        }
    18861886
    18871887        if ( '' === $r['page'] ) {
    1888                 if ( empty($overridden_cpage) ) {
    1889                         $r['page'] = get_query_var('cpage');
     1888                if ( empty( $overridden_cpage ) ) {
     1889                        $r['page'] = get_query_var( 'cpage' );
    18901890                } else {
    18911891                        $threaded = ( -1 != $r['max_depth'] );
    1892                         $r['page'] = ( 'newest' == get_option('default_comments_page') ) ? get_comment_pages_count($_comments, $r['per_page'], $threaded) : 1;
     1892                        $r['page'] = ( 'newest' == get_option( 'default_comments_page' ) ) ? get_comment_pages_count( $_comments, $r['per_page'], $threaded ) : 1;
    18931893                        set_query_var( 'cpage', $r['page'] );
    18941894                }
    18951895        }
    18961896        // Validation check
    1897         $r['page'] = intval($r['page']);
     1897        $r['page'] = intval( $r['page'] );
    18981898        if ( 0 == $r['page'] && 0 != $r['per_page'] )
    18991899                $r['page'] = 1;
    19001900
    19011901        if ( null === $r['reverse_top_level'] )
    1902                 $r['reverse_top_level'] = ( 'desc' == get_option('comment_order') );
     1902                $r['reverse_top_level'] = ( 'desc' == get_option( 'comment_order' ) );
    19031903
    19041904        extract( $r, EXTR_SKIP );
    19051905
    1906         if ( empty($walker) )
     1906        if ( empty( $walker ) )
    19071907                $walker = new Walker_Comment;
    19081908
    1909         $output = $walker->paged_walk($_comments, $max_depth, $page, $per_page, $r);
     1909        $output = $walker->paged_walk( $_comments, $max_depth, $page, $per_page, $r );
    19101910        $wp_query->max_num_comment_pages = $walker->max_pages;
    19111911
    19121912        $in_comment_loop = false;
     
    19831983                            '<input id="url" name="url" ' . ( $html5 ? 'type="url"' : 'type="text"' ) . ' value="' . esc_attr( $commenter['comment_author_url'] ) . '" size="30" /></p>',
    19841984        );
    19851985
    1986         $required_text = sprintf( ' ' . __('Required fields are marked %s'), '<span class="required">*</span>' );
     1986        $required_text = sprintf( ' ' . __( 'Required fields are marked %s' ), '<span class="required">*</span>' );
    19871987
    19881988        /**
    19891989         * Filter the default comment form fields.