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