Make WordPress Core

Changeset 44315


Ignore:
Timestamp:
12/18/2018 11:31:54 PM (5 years ago)
Author:
desrosj
Message:

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

Props pento.

Merges [44248] into trunk.

Fixes #45456.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/wp-admin/includes/post.php

    r44297 r44315  
    23682368     * compatibility, we can capture the output from these actions, and extract the hidden input fields.
    23692369     */
    2370     $actions = array(
    2371         'edit_form_after_title',
    2372         'edit_form_advanced',
    2373     );
    2374 
    2375     foreach ( $actions as $action ) {
    2376         ob_start();
    2377         do_action_deprecated(
    2378             $action,
    2379             array( $post ),
    2380             '5.0.0',
    2381             'block_editor_meta_box_hidden_fields',
    2382             __( 'This action is still supported in the classic editor, but is deprecated in the block editor.' )
    2383         );
    2384         $classic_output = ob_get_clean();
    2385 
    2386         if ( ! $classic_output ) {
     2370    ob_start();
     2371    /** This filter is documented in wp-admin/edit-form-advanced.php */
     2372    do_action( 'edit_form_after_title', $post );
     2373    /** This filter is documented in wp-admin/edit-form-advanced.php */
     2374    do_action( 'edit_form_advanced', $post );
     2375    $classic_output = ob_get_clean();
     2376
     2377    $classic_elements = wp_html_split( $classic_output );
     2378    $hidden_inputs    = '';
     2379    foreach ( $classic_elements as $element ) {
     2380        if ( 0 !== strpos( $element, '<input ' ) ) {
    23872381            continue;
    23882382        }
    23892383
    2390         $classic_elements = wp_html_split( $classic_output );
    2391         $hidden_inputs    = '';
    2392         foreach ( $classic_elements as $element ) {
    2393             if ( 0 !== strpos( $element, '<input ' ) ) {
    2394                 continue;
    2395             }
    2396 
    2397             if ( preg_match( '/\stype=[\'"]hidden[\'"]\s/', $element ) ) {
    2398                 echo $element;
    2399             }
     2384        if ( preg_match( '/\stype=[\'"]hidden[\'"]\s/', $element ) ) {
     2385            echo $element;
    24002386        }
    24012387    }
Note: See TracChangeset for help on using the changeset viewer.