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