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 ) {
|
| 2218 | 2218 | * Some meta boxes hook into these actions to add hidden input fields in the classic post form. For backwards |
| 2219 | 2219 | * compatibility, we can capture the output from these actions, and extract the hidden input fields. |
| 2220 | 2220 | */ |
| 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 ') ) { |
| 2238 | 2232 | continue; |
| 2239 | 2233 | } |
| 2240 | 2234 | |
| 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; |
| 2251 | 2237 | } |
| 2252 | 2238 | } |
| 2253 | 2239 | ?> |