Changeset 44315
- Timestamp:
- 12/18/2018 11:31:54 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/5.0 merged: 44248
- Property svn:mergeinfo changed
-
trunk/src/wp-admin/includes/post.php
r44297 r44315 2368 2368 * compatibility, we can capture the output from these actions, and extract the hidden input fields. 2369 2369 */ 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 ' ) ) { 2387 2381 continue; 2388 2382 } 2389 2383 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; 2400 2386 } 2401 2387 }
Note: See TracChangeset
for help on using the changeset viewer.