diff --git a/simple-css.php b/simple-css.php index 09c89a5..172698c 100644 --- a/simple-css.php +++ b/simple-css.php @@ -58,7 +58,9 @@ function simple_css_register_setting() { register_setting( 'simple_css', 'simple_css', - 'simple_css_validate' + array( + 'sanitize_callback' => 'simple_css_validate', + ) ); } @@ -299,6 +301,10 @@ function simple_css_save_metabox( $post_id ) { return; } + if ( ! current_user_can( 'edit_post', $post_id ) ) { + return; + } + if ( isset( $_POST[ '_simple_css' ] ) && $_POST[ '_simple_css' ] !== '' ) { update_post_meta( $post_id, '_simple_css', strip_tags( $_POST[ '_simple_css' ] ) ); } else {