Make WordPress Core


Ignore:
Timestamp:
11/30/2017 11:09:33 PM (8 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-admin/edit-form-comment.php

    r42228 r42343  
    88
    99// don't load directly
    10 if ( !defined('ABSPATH') )
    11     die('-1');
     10if ( ! defined( 'ABSPATH' ) ) {
     11    die( '-1' );
     12}
    1213?>
    1314<form name="post" action="comment.php" method="post" id="post">
    14 <?php wp_nonce_field('update-comment_' . $comment->comment_ID) ?>
     15<?php wp_nonce_field( 'update-comment_' . $comment->comment_ID ); ?>
    1516<div class="wrap">
    1617<h1><?php _e( 'Edit Comment' ); ?></h1>
     
    3738<div class="inside">
    3839<fieldset>
    39 <legend class="edit-comment-author"><?php _e( 'Author' ) ?></legend>
     40<legend class="edit-comment-author"><?php _e( 'Author' ); ?></legend>
    4041<table class="form-table editcomment">
    4142<tbody>
     
    5354    <td class="first"><label for="newcomment_author_url"><?php _e( 'URL:' ); ?></label></td>
    5455    <td>
    55         <input type="text" id="newcomment_author_url" name="newcomment_author_url" size="30" class="code" value="<?php echo esc_attr($comment->comment_author_url); ?>" />
     56        <input type="text" id="newcomment_author_url" name="newcomment_author_url" size="30" class="code" value="<?php echo esc_attr( $comment->comment_author_url ); ?>" />
    5657    </td>
    5758</tr>
     
    6768    echo '<label for="content" class="screen-reader-text">' . __( 'Comment' ) . '</label>';
    6869    $quicktags_settings = array( 'buttons' => 'strong,em,link,block,del,ins,img,ul,ol,li,code,close' );
    69     wp_editor( $comment->comment_content, 'content', array( 'media_buttons' => false, 'tinymce' => false, 'quicktags' => $quicktags_settings ) );
    70     wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false ); ?>
     70    wp_editor(
     71        $comment->comment_content, 'content', array(
     72            'media_buttons' => false,
     73            'tinymce'       => false,
     74            'quicktags'     => $quicktags_settings,
     75        )
     76    );
     77    wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
     78    ?>
    7179</div>
    7280</div><!-- /post-body-content -->
     
    7482<div id="postbox-container-1" class="postbox-container">
    7583<div id="submitdiv" class="stuffbox" >
    76 <h2><?php _e( 'Status' ) ?></h2>
     84<h2><?php _e( 'Status' ); ?></h2>
    7785<div class="inside">
    7886<div class="submitbox" id="submitcomment">
     
    93101$datef = __( 'M j, Y @ H:i' );
    94102?>
    95 <span id="timestamp"><?php
     103<span id="timestamp">
     104<?php
    96105printf(
    97106    /* translators: %s: comment date */
     
    99108    '<b>' . date_i18n( $datef, strtotime( $comment->comment_date ) ) . '</b>'
    100109);
    101 ?></span>
     110?>
     111</span>
    102112<a href="#edit_timestamp" class="edit-timestamp hide-if-no-js"><span aria-hidden="true"><?php _e( 'Edit' ); ?></span> <span class="screen-reader-text"><?php _e( 'Edit date and time' ); ?></span></a>
    103113<fieldset id='timestampdiv' class='hide-if-js'>
     
    110120$post_id = $comment->comment_post_ID;
    111121if ( current_user_can( 'edit_post', $post_id ) ) {
    112     $post_link = "<a href='" . esc_url( get_edit_post_link( $post_id ) ) . "'>";
     122    $post_link  = "<a href='" . esc_url( get_edit_post_link( $post_id ) ) . "'>";
    113123    $post_link .= esc_html( get_the_title( $post_id ) ) . '</a>';
    114124} else {
     
    118128
    119129<div class="misc-pub-section misc-pub-response-to">
    120     <?php printf(
     130    <?php
     131    printf(
    121132        /* translators: %s: post link */
    122133        __( 'In response to: %s' ),
    123134        '<b>' . $post_link . '</b>'
    124     ); ?>
     135    );
     136    ?>
    125137</div>
    126138
    127139<?php
    128140if ( $comment->comment_parent ) :
    129     $parent      = get_comment( $comment->comment_parent );
     141    $parent = get_comment( $comment->comment_parent );
    130142    if ( $parent ) :
    131143        $parent_link = esc_url( get_comment_link( $parent ) );
     
    133145    ?>
    134146    <div class="misc-pub-section misc-pub-reply-to">
    135         <?php printf(
     147        <?php
     148        printf(
    136149            /* translators: %s: comment link */
    137150            __( 'In reply to: %s' ),
    138151            '<b><a href="' . $parent_link . '">' . $name . '</a></b>'
    139         ); ?>
     152        );
     153        ?>
    140154    </div>
    141 <?php endif;
    142 endif; ?>
     155<?php
     156endif;
     157endif;
     158?>
    143159
    144160<?php
     
    160176<div id="major-publishing-actions">
    161177<div id="delete-action">
    162 <?php echo "<a class='submitdelete deletion' href='" . wp_nonce_url("comment.php?action=" . ( !EMPTY_TRASH_DAYS ? 'deletecomment' : 'trashcomment' ) . "&amp;c=$comment->comment_ID&amp;_wp_original_http_referer=" . urlencode(wp_get_referer()), 'delete-comment_' . $comment->comment_ID) . "'>" . ( !EMPTY_TRASH_DAYS ? __('Delete Permanently') : __('Move to Trash') ) . "</a>\n"; ?>
     178<?php echo "<a class='submitdelete deletion' href='" . wp_nonce_url( 'comment.php?action=' . ( ! EMPTY_TRASH_DAYS ? 'deletecomment' : 'trashcomment' ) . "&amp;c=$comment->comment_ID&amp;_wp_original_http_referer=" . urlencode( wp_get_referer() ), 'delete-comment_' . $comment->comment_ID ) . "'>" . ( ! EMPTY_TRASH_DAYS ? __( 'Delete Permanently' ) : __( 'Move to Trash' ) ) . "</a>\n"; ?>
    163179</div>
    164180<div id="publishing-action">
     
    186202do_action( 'add_meta_boxes_comment', $comment );
    187203
    188 do_meta_boxes(null, 'normal', $comment);
     204do_meta_boxes( null, 'normal', $comment );
    189205
    190206$referer = wp_get_referer();
     
    192208</div>
    193209
    194 <input type="hidden" name="c" value="<?php echo esc_attr($comment->comment_ID) ?>" />
    195 <input type="hidden" name="p" value="<?php echo esc_attr($comment->comment_post_ID) ?>" />
     210<input type="hidden" name="c" value="<?php echo esc_attr( $comment->comment_ID ); ?>" />
     211<input type="hidden" name="p" value="<?php echo esc_attr( $comment->comment_post_ID ); ?>" />
    196212<input name="referredby" type="hidden" id="referredby" value="<?php echo $referer ? esc_url( $referer ) : ''; ?>" />
    197 <?php wp_original_referer_field(true, 'previous'); ?>
     213<?php wp_original_referer_field( true, 'previous' ); ?>
    198214<input type="hidden" name="noredir" value="1" />
    199215
     
    207223try{document.post.name.focus();}catch(e){}
    208224</script>
    209 <?php endif;
     225<?php
     226endif;
Note: See TracChangeset for help on using the changeset viewer.