Make WordPress Core

Ticket #45456: 45456.diff

File 45456.diff, 1.8 KB (added by pento, 8 years ago)
  • src/wp-admin/includes/post.php

    diff --git a/src/wp-admin/includes/post.php b/src/wp-admin/includes/post.php
    index 8eab849f4e..a2bbd8753e 100644
    a b function the_block_editor_meta_box_post_form_hidden_fields( $post ) {  
    22182218         * Some meta boxes hook into these actions to add hidden input fields in the classic post form. For backwards
    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        }
    22532239        ?>