Verify nonce before processing action

This commit is contained in:
Kelly Dwan 2019-12-05 11:25:34 -05:00
parent 258e86dc0b
commit 3192c724ae
No known key found for this signature in database
GPG key ID: 8BA5575F3D11575D

View file

@ -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;