diff --git a/wp-admin/edit-form-blocks.php b/wp-admin/edit-form-blocks.php
index 9e26086849..7b80b304f1 100644
--- a/wp-admin/edit-form-blocks.php
+++ b/wp-admin/edit-form-blocks.php
@@ -358,10 +358,6 @@ do_action( 'enqueue_block_editor_assets' );
require_once( ABSPATH . 'wp-admin/includes/meta-boxes.php' );
register_and_do_post_meta_boxes( $post );
-// Some meta boxes hook into the 'edit_form_advanced' filter.
-/** This action is documented in wp-admin/edit-form-advanced.php */
-do_action( 'edit_form_advanced', $post );
-
require_once( ABSPATH . 'wp-admin/admin-header.php' );
?>
diff --git a/wp-admin/includes/post.php b/wp-admin/includes/post.php
index ced29d4a72..aba113c7a5 100644
--- a/wp-admin/includes/post.php
+++ b/wp-admin/includes/post.php
@@ -2307,6 +2307,43 @@ function the_block_editor_meta_box_post_form_hidden_fields( $post ) {
$current_user = wp_get_current_user();
$user_id = $current_user->ID;
wp_nonce_field( $nonce_action );
+
+ /*
+ * Some meta boxes hook into these actions to add hidden input fields in the classic post form. For backwards
+ * compatibility, we can capture the output from these actions, and extract the hidden input fields.
+ */
+ $actions = array(
+ 'edit_form_after_title',
+ 'edit_form_advanced',
+ );
+
+ foreach ( $actions as $action ) {
+ ob_start();
+ do_action_deprecated(
+ $action,
+ array( $post ),
+ '5.0.0',
+ 'block_editor_meta_box_hidden_fields',
+ __( 'This action is still supported in the classic editor, but is deprecated in the block editor.' )
+ );
+ $classic_output = ob_get_clean();
+
+ if ( ! $classic_output ) {
+ continue;
+ }
+
+ $classic_elements = wp_html_split( $classic_output );
+ $hidden_inputs = '';
+ foreach( $classic_elements as $element ) {
+ if ( 0 !== strpos( $element, '
@@ -2324,4 +2361,16 @@ function the_block_editor_meta_box_post_form_hidden_fields( $post ) {
wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
// Permalink title nonce.
wp_nonce_field( 'samplepermalink', 'samplepermalinknonce', false );
+
+ /**
+ * Add hidden input fields to the meta box save form.
+ *
+ * Hook into this action to print `` fields, which will be POSTed back to
+ * the server when meta boxes are saved.
+ *
+ * @since 5.0.0
+ *
+ * @params WP_Post $post The post that is being edited.
+ */
+ do_action( 'block_editor_meta_box_hidden_fields', $post );
}
diff --git a/wp-includes/version.php b/wp-includes/version.php
index 07041fc06d..4370a3dabe 100644
--- a/wp-includes/version.php
+++ b/wp-includes/version.php
@@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
-$wp_version = '5.1-alpha-44240';
+$wp_version = '5.1-alpha-44241';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.