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