[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

/wp-admin/ -> edit-form-comment.php (source)

   1  <?php
   2  /**
   3   * Edit comment form for inclusion in another file.
   4   *
   5   * @package WordPress
   6   * @subpackage Administration
   7   */
   8  
   9  // don't load directly
  10  if ( ! defined( 'ABSPATH' ) ) {
  11      die( '-1' );
  12  }
  13  ?>
  14  <form name="post" action="comment.php" method="post" id="post">
  15  <?php wp_nonce_field( 'update-comment_' . $comment->comment_ID ); ?>
  16  <div class="wrap">
  17  <h1><?php _e( 'Edit Comment' ); ?></h1>
  18  
  19  <div id="poststuff">
  20  <input type="hidden" name="action" value="editedcomment" />
  21  <input type="hidden" name="comment_ID" value="<?php echo esc_attr( $comment->comment_ID ); ?>" />
  22  <input type="hidden" name="comment_post_ID" value="<?php echo esc_attr( $comment->comment_post_ID ); ?>" />
  23  
  24  <div id="post-body" class="metabox-holder columns-2">
  25  <div id="post-body-content" class="edit-form-section edit-comment-section">
  26  <?php
  27  if ( 'approved' === wp_get_comment_status( $comment ) && $comment->comment_post_ID > 0 ) :
  28      $comment_link = get_comment_link( $comment );
  29      ?>
  30  <div class="inside">
  31      <div id="comment-link-box">
  32          <strong><?php _ex( 'Permalink:', 'comment' ); ?></strong>
  33          <span id="sample-permalink">
  34              <a href="<?php echo esc_url( $comment_link ); ?>">
  35                  <?php echo esc_html( $comment_link ); ?>
  36              </a>
  37          </span>
  38      </div>
  39  </div>
  40  <?php endif; ?>
  41  <div id="namediv" class="stuffbox">
  42  <div class="inside">
  43  <h2 class="edit-comment-author"><?php _e( 'Author' ); ?></h2>
  44  <fieldset>
  45  <legend class="screen-reader-text"><?php _e( 'Comment Author' ); ?></legend>
  46  <table class="form-table editcomment" role="presentation">
  47  <tbody>
  48  <tr>
  49      <td class="first"><label for="name"><?php _e( 'Name' ); ?></label></td>
  50      <td><input type="text" name="newcomment_author" size="30" value="<?php echo esc_attr( $comment->comment_author ); ?>" id="name" /></td>
  51  </tr>
  52  <tr>
  53      <td class="first"><label for="email"><?php _e( 'Email' ); ?></label></td>
  54      <td>
  55          <input type="text" name="newcomment_author_email" size="30" value="<?php echo $comment->comment_author_email; ?>" id="email" />
  56      </td>
  57  </tr>
  58  <tr>
  59      <td class="first"><label for="newcomment_author_url"><?php _e( 'URL' ); ?></label></td>
  60      <td>
  61          <input type="text" id="newcomment_author_url" name="newcomment_author_url" size="30" class="code" value="<?php echo esc_attr( $comment->comment_author_url ); ?>" />
  62      </td>
  63  </tr>
  64  </tbody>
  65  </table>
  66  </fieldset>
  67  </div>
  68  </div>
  69  
  70  <div id="postdiv" class="postarea">
  71  <?php
  72      echo '<label for="content" class="screen-reader-text">' . __( 'Comment' ) . '</label>';
  73      $quicktags_settings = array( 'buttons' => 'strong,em,link,block,del,ins,img,ul,ol,li,code,close' );
  74      wp_editor(
  75          $comment->comment_content,
  76          'content',
  77          array(
  78              'media_buttons' => false,
  79              'tinymce'       => false,
  80              'quicktags'     => $quicktags_settings,
  81          )
  82      );
  83      wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
  84      ?>
  85  </div>
  86  </div><!-- /post-body-content -->
  87  
  88  <div id="postbox-container-1" class="postbox-container">
  89  <div id="submitdiv" class="stuffbox" >
  90  <h2><?php _e( 'Status' ); ?></h2>
  91  <div class="inside">
  92  <div class="submitbox" id="submitcomment">
  93  <div id="minor-publishing">
  94  
  95  <div id="misc-publishing-actions">
  96  
  97  <fieldset class="misc-pub-section misc-pub-comment-status" id="comment-status-radio">
  98  <legend class="screen-reader-text"><?php _e( 'Comment status' ); ?></legend>
  99  <label><input type="radio"<?php checked( $comment->comment_approved, '1' ); ?> name="comment_status" value="1" /><?php _ex( 'Approved', 'comment status' ); ?></label><br />
 100  <label><input type="radio"<?php checked( $comment->comment_approved, '0' ); ?> name="comment_status" value="0" /><?php _ex( 'Pending', 'comment status' ); ?></label><br />
 101  <label><input type="radio"<?php checked( $comment->comment_approved, 'spam' ); ?> name="comment_status" value="spam" /><?php _ex( 'Spam', 'comment status' ); ?></label>
 102  </fieldset>
 103  
 104  <div class="misc-pub-section curtime misc-pub-curtime">
 105  <?php
 106  $submitted = sprintf(
 107      /* translators: 1: Comment date, 2: Comment time. */
 108      __( '%1$s at %2$s' ),
 109      /* translators: Publish box date format, see https://secure.php.net/date */
 110      date_i18n( _x( 'M j, Y', 'publish box date format' ), strtotime( $comment->comment_date ) ),
 111      /* translators: Publish box time format, see https://secure.php.net/date */
 112      date_i18n( _x( 'H:i', 'publish box time format' ), strtotime( $comment->comment_date ) )
 113  );
 114  ?>
 115  <span id="timestamp">
 116  <?php
 117  /* translators: %s: Comment date. */
 118  printf( __( 'Submitted on: %s' ), '<b>' . $submitted . '</b>' );
 119  ?>
 120  </span>
 121  <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>
 122  <fieldset id='timestampdiv' class='hide-if-js'>
 123  <legend class="screen-reader-text"><?php _e( 'Date and time' ); ?></legend>
 124  <?php touch_time( ( 'editcomment' === $action ), 0 ); ?>
 125  </fieldset>
 126  </div>
 127  
 128  <?php
 129  $post_id = $comment->comment_post_ID;
 130  if ( current_user_can( 'edit_post', $post_id ) ) {
 131      $post_link  = "<a href='" . esc_url( get_edit_post_link( $post_id ) ) . "'>";
 132      $post_link .= esc_html( get_the_title( $post_id ) ) . '</a>';
 133  } else {
 134      $post_link = esc_html( get_the_title( $post_id ) );
 135  }
 136  ?>
 137  
 138  <div class="misc-pub-section misc-pub-response-to">
 139      <?php
 140      printf(
 141          /* translators: %s: Post link. */
 142          __( 'In response to: %s' ),
 143          '<b>' . $post_link . '</b>'
 144      );
 145      ?>
 146  </div>
 147  
 148  <?php
 149  if ( $comment->comment_parent ) :
 150      $parent = get_comment( $comment->comment_parent );
 151      if ( $parent ) :
 152          $parent_link = esc_url( get_comment_link( $parent ) );
 153          $name        = get_comment_author( $parent );
 154          ?>
 155      <div class="misc-pub-section misc-pub-reply-to">
 156          <?php
 157          printf(
 158              /* translators: %s: Comment link. */
 159              __( 'In reply to: %s' ),
 160              '<b><a href="' . $parent_link . '">' . $name . '</a></b>'
 161          );
 162          ?>
 163      </div>
 164          <?php
 165  endif;
 166  endif;
 167  ?>
 168  
 169  <?php
 170      /**
 171       * Filters miscellaneous actions for the edit comment form sidebar.
 172       *
 173       * @since 4.3.0
 174       *
 175       * @param string $html    Output HTML to display miscellaneous action.
 176       * @param object $comment Current comment object.
 177       */
 178      echo apply_filters( 'edit_comment_misc_actions', '', $comment );
 179  ?>
 180  
 181  </div> <!-- misc actions -->
 182  <div class="clear"></div>
 183  </div>
 184  
 185  <div id="major-publishing-actions">
 186  <div id="delete-action">
 187  <?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"; ?>
 188  </div>
 189  <div id="publishing-action">
 190  <?php submit_button( __( 'Update' ), 'primary large', 'save', false ); ?>
 191  </div>
 192  <div class="clear"></div>
 193  </div>
 194  </div>
 195  </div>
 196  </div><!-- /submitdiv -->
 197  </div>
 198  
 199  <div id="postbox-container-2" class="postbox-container">
 200  <?php
 201  /** This action is documented in wp-admin/includes/meta-boxes.php */
 202  do_action( 'add_meta_boxes', 'comment', $comment );
 203  
 204  /**
 205   * Fires when comment-specific meta boxes are added.
 206   *
 207   * @since 3.0.0
 208   *
 209   * @param WP_Comment $comment Comment object.
 210   */
 211  do_action( 'add_meta_boxes_comment', $comment );
 212  
 213  do_meta_boxes( null, 'normal', $comment );
 214  
 215  $referer = wp_get_referer();
 216  ?>
 217  </div>
 218  
 219  <input type="hidden" name="c" value="<?php echo esc_attr( $comment->comment_ID ); ?>" />
 220  <input type="hidden" name="p" value="<?php echo esc_attr( $comment->comment_post_ID ); ?>" />
 221  <input name="referredby" type="hidden" id="referredby" value="<?php echo $referer ? esc_url( $referer ) : ''; ?>" />
 222  <?php wp_original_referer_field( true, 'previous' ); ?>
 223  <input type="hidden" name="noredir" value="1" />
 224  
 225  </div><!-- /post-body -->
 226  </div>
 227  </div>
 228  </form>
 229  
 230  <?php if ( ! wp_is_mobile() ) : ?>
 231  <script type="text/javascript">
 232  try{document.post.name.focus();}catch(e){}
 233  </script>
 234      <?php
 235  endif;


Generated: Tue Sep 17 01:00:03 2019 Cross-referenced by PHPXref 0.7.1