Make WordPress Core

Changeset 44248


Ignore:
Timestamp:
12/16/2018 11:56:13 PM (8 years ago)
Author:
pento
Message:

Block Editor: Remove a deprecated notice being generated by the meta box compat functions.

See #45456.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/5.0/src/wp-admin/includes/post.php

    r44185 r44248  
    22192219         * compatibility, we can capture the output from these actions, and extract the hidden input fields.
    22202220         */
    2221         $actions = array(
    2222                 'edit_form_after_title',
    2223                 'edit_form_advanced',
    2224         );
    2225 
    2226         foreach ( $actions as $action ) {
    2227                 ob_start();
    2228                 do_action_deprecated(
    2229                         $action,
    2230                         array( $post ),
    2231                         '5.0.0',
    2232                         'block_editor_meta_box_hidden_fields',
    2233                         __( 'This action is still supported in the classic editor, but is deprecated in the block editor.' )
    2234                 );
    2235                 $classic_output = ob_get_clean();
    2236 
    2237                 if ( ! $classic_output ) {
     2221        ob_start();
     2222        /** This filter is documented in wp-admin/edit-form-advanced.php */
     2223        do_action( 'edit_form_after_title', $post );
     2224        /** This filter is documented in wp-admin/edit-form-advanced.php */
     2225        do_action( 'edit_form_advanced', $post );
     2226        $classic_output = ob_get_clean();
     2227
     2228        $classic_elements = wp_html_split( $classic_output );
     2229        $hidden_inputs    = '';
     2230        foreach( $classic_elements as $element ) {
     2231                if ( 0 !== strpos( $element, '<input ') ) {
    22382232                        continue;
    22392233                }
    22402234
    2241                 $classic_elements = wp_html_split( $classic_output );
    2242                 $hidden_inputs    = '';
    2243                 foreach( $classic_elements as $element ) {
    2244                         if ( 0 !== strpos( $element, '<input ') ) {
    2245                                 continue;
    2246                         }
    2247 
    2248                         if ( preg_match( '/\stype=[\'"]hidden[\'"]\s/', $element ) ) {
    2249                                 echo $element;
    2250                         }
     2235                if ( preg_match( '/\stype=[\'"]hidden[\'"]\s/', $element ) ) {
     2236                        echo $element;
    22512237                }
    22522238        }
Note: See TracChangeset for help on using the changeset viewer.