Make WordPress Core


Ignore:
Timestamp:
11/30/2017 11:09:33 PM (7 years ago)
Author:
pento
Message:

Code is Poetry.
WordPress' code just... wasn't.
This is now dealt with.

Props jrf, pento, netweb, GaryJ, jdgrimes, westonruter, Greg Sherwood from PHPCS, and everyone who's ever contributed to WPCS and PHPCS.
Fixes #41057.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/theme-compat/comments.php

    r42228 r42343  
    66 *
    77 * This file is here for backward compatibility with old themes and will be removed in a future version
    8  *
    98 */
    109_deprecated_file(
     
    1817
    1918// Do not delete these lines
    20     if (!empty($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
    21         die ('Please do not load this page directly. Thanks!');
     19if ( ! empty( $_SERVER['SCRIPT_FILENAME'] ) && 'comments.php' == basename( $_SERVER['SCRIPT_FILENAME'] ) ) {
     20    die( 'Please do not load this page directly. Thanks!' );
     21}
    2222
    23     if ( post_password_required() ) { ?>
    24         <p class="nocomments"><?php _e('This post is password protected. Enter the password to view comments.'); ?></p>
     23if ( post_password_required() ) { ?>
     24        <p class="nocomments"><?php _e( 'This post is password protected. Enter the password to view comments.' ); ?></p>
    2525    <?php
    26         return;
    27     }
     26    return;
     27}
    2828?>
    2929
     
    3333    <h3 id="comments">
    3434        <?php
    35             if ( 1 == get_comments_number() ) {
    36                 /* translators: %s: post title */
    37                 printf( __( 'One response to %s' ),  '&#8220;' . get_the_title() . '&#8221;' );
    38             } else {
    39                 /* translators: 1: number of comments, 2: post title */
    40                 printf( _n( '%1$s response to %2$s', '%1$s responses to %2$s', get_comments_number() ),
    41                     number_format_i18n( get_comments_number() ),  '&#8220;' . get_the_title() . '&#8221;' );
    42             }
     35        if ( 1 == get_comments_number() ) {
     36            /* translators: %s: post title */
     37            printf( __( 'One response to %s' ), '&#8220;' . get_the_title() . '&#8221;' );
     38        } else {
     39            /* translators: 1: number of comments, 2: post title */
     40            printf(
     41                _n( '%1$s response to %2$s', '%1$s responses to %2$s', get_comments_number() ),
     42                number_format_i18n( get_comments_number() ), '&#8220;' . get_the_title() . '&#8221;'
     43            );
     44        }
    4345        ?>
    4446    </h3>
    4547
    4648    <div class="navigation">
    47         <div class="alignleft"><?php previous_comments_link() ?></div>
    48         <div class="alignright"><?php next_comments_link() ?></div>
     49        <div class="alignleft"><?php previous_comments_link(); ?></div>
     50        <div class="alignright"><?php next_comments_link(); ?></div>
    4951    </div>
    5052
    5153    <ol class="commentlist">
    52     <?php wp_list_comments();?>
     54    <?php wp_list_comments(); ?>
    5355    </ol>
    5456
    5557    <div class="navigation">
    56         <div class="alignleft"><?php previous_comments_link() ?></div>
    57         <div class="alignright"><?php next_comments_link() ?></div>
     58        <div class="alignleft"><?php previous_comments_link(); ?></div>
     59        <div class="alignright"><?php next_comments_link(); ?></div>
    5860    </div>
    5961<?php else : // this is displayed if there are no comments so far ?>
     
    6466    <?php else : // comments are closed ?>
    6567        <!-- If comments are closed. -->
    66         <p class="nocomments"><?php _e('Comments are closed.'); ?></p>
     68        <p class="nocomments"><?php _e( 'Comments are closed.' ); ?></p>
    6769
    6870    <?php endif; ?>
Note: See TracChangeset for help on using the changeset viewer.