Skip to content
Permalink
Browse files

Block Editor: Remove a deprecated notice being generated by the meta …

…box compat functions.

See #45456.



git-svn-id: https://develop.svn.wordpress.org/branches/5.0@44248 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information...
pento committed Dec 16, 2018
1 parent 37b8a45 commit b47bfb88b5600afaff2b3a23617dead9c6879cd5
Showing with 13 additions and 27 deletions.
  1. +13 −27 src/wp-admin/includes/post.php
@@ -2218,36 +2218,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',
);
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 ) {
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();
$classic_elements = wp_html_split( $classic_output );
$hidden_inputs = '';
foreach( $classic_elements as $element ) {
if ( 0 !== strpos( $element, '<input ') ) {
continue;
}
$classic_elements = wp_html_split( $classic_output );
$hidden_inputs = '';
foreach( $classic_elements as $element ) {
if ( 0 !== strpos( $element, '<input ') ) {
continue;
}
if ( preg_match( '/\stype=[\'"]hidden[\'"]\s/', $element ) ) {
echo $element;
}
if ( preg_match( '/\stype=[\'"]hidden[\'"]\s/', $element ) ) {
echo $element;
}
}
?>

0 comments on commit b47bfb8

Please sign in to comment.
You can’t perform that action at this time.