解决了升级到php8之后,写文章时的警告。详情:https://yangyq.net/2022/06/wordpress-warning-metaboxes-nonce.html
This commit is contained in:
@@ -423,7 +423,7 @@ function post_seo_callback( $post ) {
|
|||||||
function wpdocs_save_meta_box( $post_id ) {
|
function wpdocs_save_meta_box( $post_id ) {
|
||||||
global $new_meta_boxes;
|
global $new_meta_boxes;
|
||||||
|
|
||||||
if ( !wp_verify_nonce( $_POST['metaboxes_nonce'], plugin_basename(__FILE__) ))
|
if ( empty( $_POST['metaboxes_nonce'] )||!wp_verify_nonce( $_POST['metaboxes_nonce'], plugin_basename(__FILE__) ))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if ( !current_user_can( 'edit_posts', $post_id ))
|
if ( !current_user_can( 'edit_posts', $post_id ))
|
||||||
|
|||||||
Reference in New Issue
Block a user