3 * Edit comment form for inclusion in another file.
6 * @subpackage Administration
10 if ( !defined('ABSPATH') )
13 <form name="post" action="comment.php" method="post" id="post">
14 <?php wp_nonce_field('update-comment_' . $comment->comment_ID) ?>
16 <h1><?php _e( 'Edit Comment' ); ?></h1>
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 ); ?>" />
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">
28 <legend class="edit-comment-author"><?php _e( 'Author' ) ?></legend>
29 <table class="form-table editcomment">
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>
36 <td class="first"><label for="email"><?php _e( 'E-mail:' ); ?></label></td>
38 <input type="text" name="newcomment_author_email" size="30" value="<?php echo $comment->comment_author_email; ?>" id="email" />
42 <td class="first"><label for="newcomment_author_url"><?php _e( 'URL:' ); ?></label></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); ?>" />
54 <div id="postdiv" class="postarea">
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 ); ?>
61 </div><!-- /post-body-content -->
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>
67 <div class="submitbox" id="submitcomment">
68 <div id="minor-publishing">
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>
74 <div class="clear"></div>
77 <div id="misc-publishing-actions">
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>
86 <div class="misc-pub-section curtime misc-pub-curtime">
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 ) );
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 ); ?>
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>';
107 $post_link = esc_html( get_the_title( $post_id ) );
111 <div class="misc-pub-section misc-pub-response-to">
113 /* translators: post link */
114 __( 'In response to: %s' ),
115 '<b>' . $post_link . '</b>'
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 );
125 <div class="misc-pub-section misc-pub-reply-to">
127 /* translators: comment link */
128 __( 'In reply to: %s' ),
129 '<b><a href="' . $parent_link . '">' . $name . '</a></b>'
136 * Filter miscellaneous actions for the edit comment form sidebar.
140 * @param string $html Output HTML to display miscellaneous action.
141 * @param object $comment Current comment object.
143 echo apply_filters( 'edit_comment_misc_actions', '', $comment );
146 </div> <!-- misc actions -->
147 <div class="clear"></div>
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' ) . "&c=$comment->comment_ID&_wp_original_http_referer=" . urlencode(wp_get_referer()), 'delete-comment_' . $comment->comment_ID) . "'>" . ( !EMPTY_TRASH_DAYS ? __('Delete Permanently') : __('Move to Trash') ) . "</a>\n"; ?>
154 <div id="publishing-action">
155 <?php submit_button( __( 'Update' ), 'primary', 'save', false ); ?>
157 <div class="clear"></div>
161 </div><!-- /submitdiv -->
164 <div id="postbox-container-2" class="postbox-container">
166 /** This action is documented in wp-admin/edit-form-advanced.php */
167 do_action( 'add_meta_boxes', 'comment', $comment );
170 * Fires when comment-specific meta boxes are added.
174 * @param object $comment Comment object.
176 do_action( 'add_meta_boxes_comment', $comment );
178 do_meta_boxes(null, 'normal', $comment);
180 $referer = wp_get_referer();
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" />
190 </div><!-- /post-body -->
195 <?php if ( ! wp_is_mobile() ) : ?>
196 <script type="text/javascript">
197 try{document.post.name.focus();}catch(e){}