Changeset 44241
- Timestamp:
- 12/16/2018 10:51:01 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/5.0 merged: 43882
- Property svn:mergeinfo changed
-
trunk/src/wp-admin/edit-form-blocks.php
r44223 r44241 359 359 register_and_do_post_meta_boxes( $post ); 360 360 361 // Some meta boxes hook into the 'edit_form_advanced' filter.362 /** This action is documented in wp-admin/edit-form-advanced.php */363 do_action( 'edit_form_advanced', $post );364 365 361 require_once( ABSPATH . 'wp-admin/admin-header.php' ); 366 362 ?> -
trunk/src/wp-admin/includes/post.php
r44240 r44241 2308 2308 $user_id = $current_user->ID; 2309 2309 wp_nonce_field( $nonce_action ); 2310 2311 /* 2312 * Some meta boxes hook into these actions to add hidden input fields in the classic post form. For backwards 2313 * compatibility, we can capture the output from these actions, and extract the hidden input fields. 2314 */ 2315 $actions = array( 2316 'edit_form_after_title', 2317 'edit_form_advanced', 2318 ); 2319 2320 foreach ( $actions as $action ) { 2321 ob_start(); 2322 do_action_deprecated( 2323 $action, 2324 array( $post ), 2325 '5.0.0', 2326 'block_editor_meta_box_hidden_fields', 2327 __( 'This action is still supported in the classic editor, but is deprecated in the block editor.' ) 2328 ); 2329 $classic_output = ob_get_clean(); 2330 2331 if ( ! $classic_output ) { 2332 continue; 2333 } 2334 2335 $classic_elements = wp_html_split( $classic_output ); 2336 $hidden_inputs = ''; 2337 foreach( $classic_elements as $element ) { 2338 if ( 0 !== strpos( $element, '<input ') ) { 2339 continue; 2340 } 2341 2342 if ( preg_match( '/\stype=[\'"]hidden[\'"]\s/', $element ) ) { 2343 echo $element; 2344 } 2345 } 2346 } 2310 2347 ?> 2311 2348 <input type="hidden" id="user-id" name="user_ID" value="<?php echo (int) $user_id; ?>" /> … … 2325 2362 // Permalink title nonce. 2326 2363 wp_nonce_field( 'samplepermalink', 'samplepermalinknonce', false ); 2327 } 2364 2365 /** 2366 * Add hidden input fields to the meta box save form. 2367 * 2368 * Hook into this action to print `<input type="hidden" ... />` fields, which will be POSTed back to 2369 * the server when meta boxes are saved. 2370 * 2371 * @since 5.0.0 2372 * 2373 * @params WP_Post $post The post that is being edited. 2374 */ 2375 do_action( 'block_editor_meta_box_hidden_fields', $post ); 2376 }
Note: See TracChangeset
for help on using the changeset viewer.