From 556e442814bb2d1d0588290114e1aae368f6b4ea Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers Date: Tue, 18 Dec 2018 23:31:54 +0000 Subject: [PATCH] Block Editor: Remove a deprecated notice being generated by the meta box compat functions. Props pento. Merges [44248] into trunk. Fixes #45456. git-svn-id: https://develop.svn.wordpress.org/trunk@44315 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/post.php | 38 +++++++++++----------------------- 1 file changed, 12 insertions(+), 26 deletions(-) diff --git a/src/wp-admin/includes/post.php b/src/wp-admin/includes/post.php index 0d599ef542..dec958cba2 100644 --- a/src/wp-admin/includes/post.php +++ b/src/wp-admin/includes/post.php @@ -2367,36 +2367,22 @@ function the_block_editor_meta_box_post_form_hidden_fields( $post ) { * 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', - ); + ob_start(); + /** This filter is documented in wp-admin/edit-form-advanced.php */ + do_action( 'edit_form_after_title', $post ); + /** This filter is documented in wp-admin/edit-form-advanced.php */ + do_action( 'edit_form_advanced', $post ); + $classic_output = ob_get_clean(); - 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 ) { + $classic_elements = wp_html_split( $classic_output ); + $hidden_inputs = ''; + foreach ( $classic_elements as $element ) { + if ( 0 !== strpos( $element, '