Block Editor: Prevent the meta box form from being accidentally submitted.

Meta boxes are loaded inside a wrapper form, that the block editor submits as part of the saving process. It shouldn't be submitted manually.

Props pento.
Merges [43880] to trunk.
Fixes #45284.
Built from https://develop.svn.wordpress.org/trunk@44240


git-svn-id: http://core.svn.wordpress.org/trunk@44070 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2018-12-17 03:17:56 +00:00
parent 9e54ec265c
commit eccc31aadf
2 changed files with 2 additions and 2 deletions

View File

@ -2210,7 +2210,7 @@ function the_block_editor_meta_boxes() {
<?php the_block_editor_meta_box_post_form_hidden_fields( $post ); ?> <?php the_block_editor_meta_box_post_form_hidden_fields( $post ); ?>
</form> </form>
<?php foreach ( $locations as $location ) : ?> <?php foreach ( $locations as $location ) : ?>
<form class="metabox-location-<?php echo esc_attr( $location ); ?>"> <form class="metabox-location-<?php echo esc_attr( $location ); ?>" onsubmit="return false;">
<div id="poststuff" class="sidebar-open"> <div id="poststuff" class="sidebar-open">
<div id="postbox-container-2" class="postbox-container"> <div id="postbox-container-2" class="postbox-container">
<?php <?php

View File

@ -13,7 +13,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '5.1-alpha-44239'; $wp_version = '5.1-alpha-44240';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.