diff --git a/wp-admin/includes/post.php b/wp-admin/includes/post.php index d9ca48d94f..977b1433e5 100644 --- a/wp-admin/includes/post.php +++ b/wp-admin/includes/post.php @@ -499,9 +499,9 @@ function add_meta( $post_ID ) { $protected = array( '_wp_attached_file', '_wp_attachment_metadata', '_wp_old_slug', '_wp_page_template' ); - $metakeyselect = stripslashes( trim( $_POST['metakeyselect'] ) ); - $metakeyinput = stripslashes( trim( $_POST['metakeyinput'] ) ); - $metavalue = maybe_serialize( stripslashes( trim( $_POST['metavalue'] ) ) ); + $metakeyselect = isset($_POST['metakeyselect']) ? stripslashes( trim( $_POST['metakeyselect'] ) ) : ''; + $metakeyinput = isset($_POST['metakeyinput']) ? stripslashes( trim( $_POST['metakeyinput'] ) ) : ''; + $metavalue = isset($_POST['metavalue']) ? maybe_serialize( stripslashes( trim( $_POST['metavalue'] ) ) ) : ''; if ( ('0' === $metavalue || !empty ( $metavalue ) ) && ((('#NONE#' != $metakeyselect) && !empty ( $metakeyselect) ) || !empty ( $metakeyinput) ) ) { // We have a key/value pair. If both the select and the