author | ymh <ymh.work@gmail.com> |
Fri, 05 Sep 2025 18:52:52 +0200 | |
changeset 22 | 8c2e4d02f4ef |
parent 21 | 48c4eec2b7e6 |
permissions | -rw-r--r-- |
0 | 1 |
<?php |
2 |
/** |
|
3 |
* Comment Management Screen |
|
4 |
* |
|
5 |
* @package WordPress |
|
6 |
* @subpackage Administration |
|
7 |
*/ |
|
8 |
||
9 |
/** Load WordPress Bootstrap */ |
|
16 | 10 |
require_once __DIR__ . '/admin.php'; |
0 | 11 |
|
9 | 12 |
$parent_file = 'edit-comments.php'; |
0 | 13 |
$submenu_file = 'edit-comments.php'; |
14 |
||
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
15 |
/** |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
16 |
* @global string $action |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
17 |
*/ |
5 | 18 |
global $action; |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
19 |
|
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
20 |
$action = ! empty( $_REQUEST['action'] ) ? sanitize_text_field( $_REQUEST['action'] ) : ''; |
0 | 21 |
|
9 | 22 |
if ( isset( $_POST['deletecomment'] ) ) { |
0 | 23 |
$action = 'deletecomment'; |
9 | 24 |
} |
0 | 25 |
|
16 | 26 |
if ( 'cdc' === $action ) { |
0 | 27 |
$action = 'delete'; |
16 | 28 |
} elseif ( 'mac' === $action ) { |
0 | 29 |
$action = 'approve'; |
9 | 30 |
} |
0 | 31 |
|
32 |
if ( isset( $_GET['dt'] ) ) { |
|
16 | 33 |
if ( 'spam' === $_GET['dt'] ) { |
0 | 34 |
$action = 'spam'; |
16 | 35 |
} elseif ( 'trash' === $_GET['dt'] ) { |
0 | 36 |
$action = 'trash'; |
9 | 37 |
} |
0 | 38 |
} |
39 |
||
18 | 40 |
if ( isset( $_REQUEST['c'] ) ) { |
41 |
$comment_id = absint( $_REQUEST['c'] ); |
|
42 |
$comment = get_comment( $comment_id ); |
|
16 | 43 |
|
18 | 44 |
// Prevent actions on a comment associated with a trashed post. |
45 |
if ( $comment && 'trash' === get_post_status( $comment->comment_post_ID ) ) { |
|
46 |
wp_die( |
|
19 | 47 |
__( 'You cannot edit this comment because the associated post is in the Trash. Please restore the post first, then try again.' ) |
18 | 48 |
); |
49 |
} |
|
50 |
} else { |
|
51 |
$comment = null; |
|
16 | 52 |
} |
53 |
||
9 | 54 |
switch ( $action ) { |
0 | 55 |
|
9 | 56 |
case 'editcomment': |
19 | 57 |
// Used in the HTML title tag. |
9 | 58 |
$title = __( 'Edit Comment' ); |
0 | 59 |
|
9 | 60 |
get_current_screen()->add_help_tab( |
61 |
array( |
|
62 |
'id' => 'overview', |
|
63 |
'title' => __( 'Overview' ), |
|
64 |
'content' => |
|
16 | 65 |
'<p>' . __( 'You can edit the information left in a comment if needed. This is often useful when you notice that a commenter has made a typographical error.' ) . '</p>' . |
66 |
'<p>' . __( 'You can also moderate the comment from this screen using the Status box, where you can also change the timestamp of the comment.' ) . '</p>', |
|
9 | 67 |
) |
68 |
); |
|
0 | 69 |
|
9 | 70 |
get_current_screen()->set_help_sidebar( |
71 |
'<p><strong>' . __( 'For more information:' ) . '</strong></p>' . |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
72 |
'<p>' . __( '<a href="https://wordpress.org/documentation/article/comments-screen/">Documentation on Comments</a>' ) . '</p>' . |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
73 |
'<p>' . __( '<a href="https://wordpress.org/support/forums/">Support forums</a>' ) . '</p>' |
9 | 74 |
); |
0 | 75 |
|
9 | 76 |
wp_enqueue_script( 'comment' ); |
16 | 77 |
require_once ABSPATH . 'wp-admin/admin-header.php'; |
0 | 78 |
|
16 | 79 |
if ( ! $comment ) { |
9 | 80 |
comment_footer_die( __( 'Invalid comment ID.' ) . sprintf( ' <a href="%s">' . __( 'Go back' ) . '</a>.', 'javascript:history.go(-1)' ) ); |
81 |
} |
|
0 | 82 |
|
9 | 83 |
if ( ! current_user_can( 'edit_comment', $comment_id ) ) { |
84 |
comment_footer_die( __( 'Sorry, you are not allowed to edit this comment.' ) ); |
|
85 |
} |
|
0 | 86 |
|
16 | 87 |
if ( 'trash' === $comment->comment_approved ) { |
9 | 88 |
comment_footer_die( __( 'This comment is in the Trash. Please move it out of the Trash if you want to edit it.' ) ); |
89 |
} |
|
0 | 90 |
|
9 | 91 |
$comment = get_comment_to_edit( $comment_id ); |
0 | 92 |
|
16 | 93 |
require ABSPATH . 'wp-admin/edit-form-comment.php'; |
0 | 94 |
|
9 | 95 |
break; |
0 | 96 |
|
9 | 97 |
case 'delete': |
98 |
case 'approve': |
|
99 |
case 'trash': |
|
100 |
case 'spam': |
|
19 | 101 |
// Used in the HTML title tag. |
9 | 102 |
$title = __( 'Moderate Comment' ); |
0 | 103 |
|
16 | 104 |
if ( ! $comment ) { |
9 | 105 |
wp_redirect( admin_url( 'edit-comments.php?error=1' ) ); |
106 |
die(); |
|
107 |
} |
|
0 | 108 |
|
9 | 109 |
if ( ! current_user_can( 'edit_comment', $comment->comment_ID ) ) { |
110 |
wp_redirect( admin_url( 'edit-comments.php?error=2' ) ); |
|
111 |
die(); |
|
112 |
} |
|
0 | 113 |
|
9 | 114 |
// No need to re-approve/re-trash/re-spam a comment. |
16 | 115 |
if ( str_replace( '1', 'approve', $comment->comment_approved ) === $action ) { |
9 | 116 |
wp_redirect( admin_url( 'edit-comments.php?same=' . $comment_id ) ); |
117 |
die(); |
|
118 |
} |
|
0 | 119 |
|
16 | 120 |
require_once ABSPATH . 'wp-admin/admin-header.php'; |
0 | 121 |
|
9 | 122 |
$formaction = $action . 'comment'; |
16 | 123 |
$nonce_action = ( 'approve' === $action ) ? 'approve-comment_' : 'delete-comment_'; |
9 | 124 |
$nonce_action .= $comment_id; |
0 | 125 |
|
9 | 126 |
?> |
127 |
<div class="wrap"> |
|
0 | 128 |
|
9 | 129 |
<h1><?php echo esc_html( $title ); ?></h1> |
0 | 130 |
|
9 | 131 |
<?php |
132 |
switch ( $action ) { |
|
133 |
case 'spam': |
|
134 |
$caution_msg = __( 'You are about to mark the following comment as spam:' ); |
|
16 | 135 |
$button = _x( 'Mark as spam', 'comment' ); |
9 | 136 |
break; |
137 |
case 'trash': |
|
138 |
$caution_msg = __( 'You are about to move the following comment to the Trash:' ); |
|
139 |
$button = __( 'Move to Trash' ); |
|
140 |
break; |
|
141 |
case 'delete': |
|
142 |
$caution_msg = __( 'You are about to delete the following comment:' ); |
|
16 | 143 |
$button = __( 'Permanently delete comment' ); |
9 | 144 |
break; |
145 |
default: |
|
146 |
$caution_msg = __( 'You are about to approve the following comment:' ); |
|
16 | 147 |
$button = __( 'Approve comment' ); |
9 | 148 |
break; |
149 |
} |
|
0 | 150 |
|
16 | 151 |
if ( '0' !== $comment->comment_approved ) { // If not unapproved. |
9 | 152 |
$message = ''; |
153 |
switch ( $comment->comment_approved ) { |
|
154 |
case '1': |
|
155 |
$message = __( 'This comment is currently approved.' ); |
|
156 |
break; |
|
157 |
case 'spam': |
|
158 |
$message = __( 'This comment is currently marked as spam.' ); |
|
159 |
break; |
|
160 |
case 'trash': |
|
161 |
$message = __( 'This comment is currently in the Trash.' ); |
|
162 |
break; |
|
163 |
} |
|
164 |
if ( $message ) { |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
165 |
wp_admin_notice( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
166 |
$message, |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
167 |
array( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
168 |
'type' => 'info', |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
169 |
'id' => 'message', |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
170 |
) |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
171 |
); |
9 | 172 |
} |
173 |
} |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
174 |
wp_admin_notice( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
175 |
'<strong>' . __( 'Caution:' ) . '</strong> ' . $caution_msg, |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
176 |
array( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
177 |
'type' => 'warning', |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
178 |
'id' => 'message', |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
179 |
) |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
180 |
); |
9 | 181 |
?> |
0 | 182 |
|
183 |
<table class="form-table comment-ays"> |
|
5 | 184 |
<tr> |
18 | 185 |
<th scope="row"><?php _e( 'Author' ); ?></th> |
186 |
<td><?php comment_author( $comment ); ?></td> |
|
0 | 187 |
</tr> |
9 | 188 |
<?php if ( get_comment_author_email( $comment ) ) { ?> |
0 | 189 |
<tr> |
18 | 190 |
<th scope="row"><?php _e( 'Email' ); ?></th> |
191 |
<td><?php comment_author_email( $comment ); ?></td> |
|
0 | 192 |
</tr> |
193 |
<?php } ?> |
|
9 | 194 |
<?php if ( get_comment_author_url( $comment ) ) { ?> |
0 | 195 |
<tr> |
18 | 196 |
<th scope="row"><?php _e( 'URL' ); ?></th> |
197 |
<td><a href="<?php comment_author_url( $comment ); ?>"><?php comment_author_url( $comment ); ?></a></td> |
|
0 | 198 |
</tr> |
199 |
<?php } ?> |
|
200 |
<tr> |
|
16 | 201 |
<th scope="row"><?php /* translators: Column name or table row header. */ _e( 'In response to' ); ?></th> |
5 | 202 |
<td> |
9 | 203 |
<?php |
5 | 204 |
$post_id = $comment->comment_post_ID; |
205 |
if ( current_user_can( 'edit_post', $post_id ) ) { |
|
9 | 206 |
$post_link = "<a href='" . esc_url( get_edit_post_link( $post_id ) ) . "'>"; |
5 | 207 |
$post_link .= esc_html( get_the_title( $post_id ) ) . '</a>'; |
208 |
} else { |
|
209 |
$post_link = esc_html( get_the_title( $post_id ) ); |
|
210 |
} |
|
211 |
echo $post_link; |
|
212 |
||
213 |
if ( $comment->comment_parent ) { |
|
214 |
$parent = get_comment( $comment->comment_parent ); |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
215 |
$parent_link = esc_url( get_comment_link( $parent ) ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
216 |
$name = get_comment_author( $parent ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
217 |
printf( |
16 | 218 |
/* translators: %s: Comment link. */ |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
219 |
' | ' . __( 'In reply to %s.' ), |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
220 |
'<a href="' . $parent_link . '">' . $name . '</a>' |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
221 |
); |
5 | 222 |
} |
9 | 223 |
?> |
5 | 224 |
</td> |
18 | 225 |
</tr> |
226 |
<tr> |
|
5 | 227 |
<th scope="row"><?php _e( 'Submitted on' ); ?></th> |
228 |
<td> |
|
9 | 229 |
<?php |
230 |
$submitted = sprintf( |
|
16 | 231 |
/* translators: 1: Comment date, 2: Comment time. */ |
9 | 232 |
__( '%1$s at %2$s' ), |
18 | 233 |
/* translators: Comment date format. See https://www.php.net/manual/datetime.format.php */ |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
234 |
get_comment_date( __( 'Y/m/d' ), $comment ), |
18 | 235 |
/* translators: Comment time format. See https://www.php.net/manual/datetime.format.php */ |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
236 |
get_comment_date( __( 'g:i a' ), $comment ) |
5 | 237 |
); |
9 | 238 |
if ( 'approved' === wp_get_comment_status( $comment ) && ! empty( $comment->comment_post_ID ) ) { |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
239 |
echo '<a href="' . esc_url( get_comment_link( $comment ) ) . '">' . $submitted . '</a>'; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
240 |
} else { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
241 |
echo $submitted; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
242 |
} |
9 | 243 |
?> |
18 | 244 |
</td> |
245 |
</tr> |
|
246 |
<tr> |
|
16 | 247 |
<th scope="row"><?php /* translators: Field name in comment form. */ _ex( 'Comment', 'noun' ); ?></th> |
9 | 248 |
<td class="comment-content"> |
249 |
<?php comment_text( $comment ); ?> |
|
18 | 250 |
<p class="edit-comment"> |
251 |
<a href="<?php echo esc_url( admin_url( "comment.php?action=editcomment&c={$comment->comment_ID}" ) ); ?>"><?php esc_html_e( 'Edit' ); ?></a> |
|
252 |
</p> |
|
5 | 253 |
</td> |
18 | 254 |
</tr> |
255 |
</table> |
|
0 | 256 |
|
18 | 257 |
<form action="comment.php" method="get" class="comment-ays-submit"> |
9 | 258 |
<p> |
259 |
<?php submit_button( $button, 'primary', 'submit', false ); ?> |
|
18 | 260 |
<a href="<?php echo esc_url( admin_url( 'edit-comments.php' ) ); ?>" class="button-cancel"><?php esc_html_e( 'Cancel' ); ?></a> |
9 | 261 |
</p> |
0 | 262 |
|
9 | 263 |
<?php wp_nonce_field( $nonce_action ); ?> |
264 |
<input type="hidden" name="action" value="<?php echo esc_attr( $formaction ); ?>" /> |
|
265 |
<input type="hidden" name="c" value="<?php echo esc_attr( $comment->comment_ID ); ?>" /> |
|
266 |
<input type="hidden" name="noredir" value="1" /> |
|
18 | 267 |
</form> |
0 | 268 |
|
18 | 269 |
</div> |
9 | 270 |
<?php |
271 |
break; |
|
0 | 272 |
|
9 | 273 |
case 'deletecomment': |
274 |
case 'trashcomment': |
|
275 |
case 'untrashcomment': |
|
276 |
case 'spamcomment': |
|
277 |
case 'unspamcomment': |
|
278 |
case 'approvecomment': |
|
279 |
case 'unapprovecomment': |
|
280 |
$comment_id = absint( $_REQUEST['c'] ); |
|
0 | 281 |
|
16 | 282 |
if ( in_array( $action, array( 'approvecomment', 'unapprovecomment' ), true ) ) { |
9 | 283 |
check_admin_referer( 'approve-comment_' . $comment_id ); |
284 |
} else { |
|
285 |
check_admin_referer( 'delete-comment_' . $comment_id ); |
|
286 |
} |
|
0 | 287 |
|
9 | 288 |
$noredir = isset( $_REQUEST['noredir'] ); |
0 | 289 |
|
16 | 290 |
$comment = get_comment( $comment_id ); |
291 |
if ( ! $comment ) { |
|
9 | 292 |
comment_footer_die( __( 'Invalid comment ID.' ) . sprintf( ' <a href="%s">' . __( 'Go back' ) . '</a>.', 'edit-comments.php' ) ); |
293 |
} |
|
294 |
if ( ! current_user_can( 'edit_comment', $comment->comment_ID ) ) { |
|
295 |
comment_footer_die( __( 'Sorry, you are not allowed to edit comments on this post.' ) ); |
|
296 |
} |
|
0 | 297 |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
298 |
if ( wp_get_referer() && ! $noredir && ! str_contains( wp_get_referer(), 'comment.php' ) ) { |
9 | 299 |
$redir = wp_get_referer(); |
16 | 300 |
} elseif ( wp_get_original_referer() && ! $noredir ) { |
9 | 301 |
$redir = wp_get_original_referer(); |
16 | 302 |
} elseif ( in_array( $action, array( 'approvecomment', 'unapprovecomment' ), true ) ) { |
9 | 303 |
$redir = admin_url( 'edit-comments.php?p=' . absint( $comment->comment_post_ID ) ); |
304 |
} else { |
|
305 |
$redir = admin_url( 'edit-comments.php' ); |
|
306 |
} |
|
0 | 307 |
|
9 | 308 |
$redir = remove_query_arg( array( 'spammed', 'unspammed', 'trashed', 'untrashed', 'deleted', 'ids', 'approved', 'unapproved' ), $redir ); |
0 | 309 |
|
9 | 310 |
switch ( $action ) { |
311 |
case 'deletecomment': |
|
312 |
wp_delete_comment( $comment ); |
|
313 |
$redir = add_query_arg( array( 'deleted' => '1' ), $redir ); |
|
314 |
break; |
|
315 |
case 'trashcomment': |
|
316 |
wp_trash_comment( $comment ); |
|
317 |
$redir = add_query_arg( |
|
318 |
array( |
|
319 |
'trashed' => '1', |
|
320 |
'ids' => $comment_id, |
|
321 |
), |
|
322 |
$redir |
|
323 |
); |
|
324 |
break; |
|
325 |
case 'untrashcomment': |
|
326 |
wp_untrash_comment( $comment ); |
|
327 |
$redir = add_query_arg( array( 'untrashed' => '1' ), $redir ); |
|
328 |
break; |
|
329 |
case 'spamcomment': |
|
330 |
wp_spam_comment( $comment ); |
|
331 |
$redir = add_query_arg( |
|
332 |
array( |
|
333 |
'spammed' => '1', |
|
334 |
'ids' => $comment_id, |
|
335 |
), |
|
336 |
$redir |
|
337 |
); |
|
338 |
break; |
|
339 |
case 'unspamcomment': |
|
340 |
wp_unspam_comment( $comment ); |
|
341 |
$redir = add_query_arg( array( 'unspammed' => '1' ), $redir ); |
|
342 |
break; |
|
343 |
case 'approvecomment': |
|
344 |
wp_set_comment_status( $comment, 'approve' ); |
|
345 |
$redir = add_query_arg( array( 'approved' => 1 ), $redir ); |
|
346 |
break; |
|
347 |
case 'unapprovecomment': |
|
348 |
wp_set_comment_status( $comment, 'hold' ); |
|
349 |
$redir = add_query_arg( array( 'unapproved' => 1 ), $redir ); |
|
350 |
break; |
|
351 |
} |
|
0 | 352 |
|
9 | 353 |
wp_redirect( $redir ); |
354 |
die; |
|
0 | 355 |
|
9 | 356 |
case 'editedcomment': |
357 |
$comment_id = absint( $_POST['comment_ID'] ); |
|
358 |
$comment_post_id = absint( $_POST['comment_post_ID'] ); |
|
0 | 359 |
|
9 | 360 |
check_admin_referer( 'update-comment_' . $comment_id ); |
0 | 361 |
|
16 | 362 |
$updated = edit_comment(); |
363 |
if ( is_wp_error( $updated ) ) { |
|
364 |
wp_die( $updated->get_error_message() ); |
|
365 |
} |
|
0 | 366 |
|
9 | 367 |
$location = ( empty( $_POST['referredby'] ) ? "edit-comments.php?p=$comment_post_id" : $_POST['referredby'] ) . '#comment-' . $comment_id; |
0 | 368 |
|
9 | 369 |
/** |
370 |
* Filters the URI the user is redirected to after editing a comment in the admin. |
|
371 |
* |
|
372 |
* @since 2.1.0 |
|
373 |
* |
|
374 |
* @param string $location The URI the user will be redirected to. |
|
375 |
* @param int $comment_id The ID of the comment being edited. |
|
376 |
*/ |
|
377 |
$location = apply_filters( 'comment_edit_redirect', $location, $comment_id ); |
|
16 | 378 |
|
9 | 379 |
wp_redirect( $location ); |
16 | 380 |
exit; |
0 | 381 |
|
9 | 382 |
default: |
383 |
wp_die( __( 'Unknown action.' ) ); |
|
0 | 384 |
|
16 | 385 |
} // End switch. |
0 | 386 |
|
16 | 387 |
require_once ABSPATH . 'wp-admin/admin-footer.php'; |