mirror of
https://github.com/WordPress/five-for-the-future.git
synced 2025-07-05 18:35:46 +03:00
Verify nonce before processing action
This commit is contained in:
parent
258e86dc0b
commit
3192c724ae
1 changed files with 6 additions and 0 deletions
|
@ -186,6 +186,12 @@ function handle_activation_action( $post_id ) {
|
|||
return;
|
||||
}
|
||||
|
||||
if ( 'deactivate' === $action ) {
|
||||
check_admin_referer( 'deactivate-post_' . $post_id );
|
||||
} else {
|
||||
check_admin_referer( 'reactivate-post_' . $post_id );
|
||||
}
|
||||
|
||||
$post = get_post( $post_id );
|
||||
if ( ! is_a( $post, 'WP_Post' ) || CPT_ID !== $post->post_type ) {
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue