|
244 | 244 | require_once( ABSPATH . 'wp-admin/includes/meta-boxes.php' ); |
245 | 245 |
|
246 | 246 |
|
247 | | -$publish_callback_args = null; |
| 247 | +$publish_callback_args = array( '__back_compat_meta_box' => true ); |
248 | 248 | if ( post_type_supports( $post_type, 'revisions' ) && 'auto-draft' != $post->post_status ) { |
249 | 249 | $revisions = wp_get_post_revisions( $post_ID ); |
250 | 250 |
|
251 | 251 | // We should aim to show the revisions meta box only when there are revisions. |
252 | 252 | if ( count( $revisions ) > 1 ) { |
253 | 253 | reset( $revisions ); // Reset pointer for key() |
254 | 254 | $publish_callback_args = array( |
255 | | - 'revisions_count' => count( $revisions ), |
256 | | - 'revision_id' => key( $revisions ), |
| 255 | + 'revisions_count' => count( $revisions ), |
| 256 | + 'revision_id' => key( $revisions ), |
| 257 | + '__back_compat_meta_box' => true, |
257 | 258 | ); |
258 | | - add_meta_box( 'revisionsdiv', __( 'Revisions' ), 'post_revisions_meta_box', null, 'normal', 'core' ); |
| 259 | + add_meta_box( 'revisionsdiv', __( 'Revisions' ), 'post_revisions_meta_box', null, 'normal', 'core', array( '__back_compat_meta_box' => true ) ); |
259 | 260 | } |
260 | 261 | } |
261 | 262 |
|
262 | 263 | if ( 'attachment' == $post_type ) { |
263 | 264 | wp_enqueue_script( 'image-edit' ); |
264 | 265 | wp_enqueue_style( 'imgareaselect' ); |
265 | | - add_meta_box( 'submitdiv', __( 'Save' ), 'attachment_submit_meta_box', null, 'side', 'core' ); |
| 266 | + add_meta_box( 'submitdiv', __( 'Save' ), 'attachment_submit_meta_box', null, 'side', 'core', array( '__back_compat_meta_box' => true ) ); |
266 | 267 | add_action( 'edit_form_after_title', 'edit_form_image_editor' ); |
267 | 268 |
|
268 | 269 | if ( wp_attachment_is( 'audio', $post ) ) { |
269 | | - add_meta_box( 'attachment-id3', __( 'Metadata' ), 'attachment_id3_data_meta_box', null, 'normal', 'core' ); |
| 270 | + add_meta_box( 'attachment-id3', __( 'Metadata' ), 'attachment_id3_data_meta_box', null, 'normal', 'core', array( '__back_compat_meta_box' => true ) ); |
270 | 271 | } |
271 | 272 | } else { |
272 | 273 | add_meta_box( 'submitdiv', __( 'Publish' ), 'post_submit_meta_box', null, 'side', 'core', $publish_callback_args ); |
273 | 274 | } |
274 | 275 |
|
275 | 276 | if ( current_theme_supports( 'post-formats' ) && post_type_supports( $post_type, 'post-formats' ) ) { |
276 | | - add_meta_box( 'formatdiv', _x( 'Format', 'post format' ), 'post_format_meta_box', null, 'side', 'core' ); |
| 277 | + add_meta_box( 'formatdiv', _x( 'Format', 'post format' ), 'post_format_meta_box', null, 'side', 'core', array( '__back_compat_meta_box' => true ) ); |
277 | 278 | } |
278 | 279 |
|
279 | 280 | // all taxonomies |
|
291 | 292 | $tax_meta_box_id = $tax_name . 'div'; |
292 | 293 | } |
293 | 294 |
|
294 | | - add_meta_box( $tax_meta_box_id, $label, $taxonomy->meta_box_cb, null, 'side', 'core', array( 'taxonomy' => $tax_name ) ); |
| 295 | + add_meta_box( |
| 296 | + $tax_meta_box_id, |
| 297 | + $label, |
| 298 | + $taxonomy->meta_box_cb, |
| 299 | + null, |
| 300 | + 'side', |
| 301 | + 'core', |
| 302 | + array( |
| 303 | + 'taxonomy' => $tax_name, |
| 304 | + '__back_compat_meta_box' => true, |
| 305 | + ) |
| 306 | + ); |
295 | 307 | } |
296 | 308 |
|
297 | 309 | if ( post_type_supports( $post_type, 'page-attributes' ) || count( get_page_templates( $post ) ) > 0 ) { |
298 | | - add_meta_box( 'pageparentdiv', $post_type_object->labels->attributes, 'page_attributes_meta_box', null, 'side', 'core' ); |
| 310 | + add_meta_box( 'pageparentdiv', $post_type_object->labels->attributes, 'page_attributes_meta_box', null, 'side', 'core', array( '__back_compat_meta_box' => true ) ); |
299 | 311 | } |
300 | 312 |
|
301 | 313 | if ( $thumbnail_support && current_user_can( 'upload_files' ) ) { |
302 | | - add_meta_box( 'postimagediv', esc_html( $post_type_object->labels->featured_image ), 'post_thumbnail_meta_box', null, 'side', 'low' ); |
| 314 | + add_meta_box( 'postimagediv', esc_html( $post_type_object->labels->featured_image ), 'post_thumbnail_meta_box', null, 'side', 'low', array( '__back_compat_meta_box' => true ) ); |
303 | 315 | } |
304 | 316 |
|
305 | 317 | if ( post_type_supports( $post_type, 'excerpt' ) ) { |
306 | | - add_meta_box( 'postexcerpt', __( 'Excerpt' ), 'post_excerpt_meta_box', null, 'normal', 'core' ); |
| 318 | + add_meta_box( 'postexcerpt', __( 'Excerpt' ), 'post_excerpt_meta_box', null, 'normal', 'core', array( '__back_compat_meta_box' => true ) ); |
307 | 319 | } |
308 | 320 |
|
309 | 321 | if ( post_type_supports( $post_type, 'trackbacks' ) ) { |
310 | | - add_meta_box( 'trackbacksdiv', __( 'Send Trackbacks' ), 'post_trackback_meta_box', null, 'normal', 'core' ); |
| 322 | + add_meta_box( 'trackbacksdiv', __( 'Send Trackbacks' ), 'post_trackback_meta_box', null, 'normal', 'core', array( '__back_compat_meta_box' => true ) ); |
311 | 323 | } |
312 | 324 |
|
313 | 325 | if ( post_type_supports( $post_type, 'custom-fields' ) ) { |
314 | | - add_meta_box( 'postcustom', __( 'Custom Fields' ), 'post_custom_meta_box', null, 'normal', 'core' ); |
| 326 | + add_meta_box( 'postcustom', __( 'Custom Fields' ), 'post_custom_meta_box', null, 'normal', 'core', array( '__back_compat_meta_box' => true ) ); |
315 | 327 | } |
316 | 328 |
|
317 | 329 | /** |
|
327 | 339 | // Allow the Discussion meta box to show up if the post type supports comments, |
328 | 340 | // or if comments or pings are open. |
329 | 341 | if ( comments_open( $post ) || pings_open( $post ) || post_type_supports( $post_type, 'comments' ) ) { |
330 | | - add_meta_box( 'commentstatusdiv', __( 'Discussion' ), 'post_comment_status_meta_box', null, 'normal', 'core' ); |
| 342 | + add_meta_box( 'commentstatusdiv', __( 'Discussion' ), 'post_comment_status_meta_box', null, 'normal', 'core', array( '__back_compat_meta_box' => true ) ); |
331 | 343 | } |
332 | 344 |
|
333 | 345 | $stati = get_post_stati( array( 'public' => true ) ); |
|
340 | 352 | // If the post type support comments, or the post has comments, allow the |
341 | 353 | // Comments meta box. |
342 | 354 | if ( comments_open( $post ) || pings_open( $post ) || $post->comment_count > 0 || post_type_supports( $post_type, 'comments' ) ) { |
343 | | - add_meta_box( 'commentsdiv', __( 'Comments' ), 'post_comment_meta_box', null, 'normal', 'core' ); |
| 355 | + add_meta_box( 'commentsdiv', __( 'Comments' ), 'post_comment_meta_box', null, 'normal', 'core', array( '__back_compat_meta_box' => true ) ); |
344 | 356 | } |
345 | 357 | } |
346 | 358 |
|
347 | 359 | if ( ! ( 'pending' == get_post_status( $post ) && ! current_user_can( $post_type_object->cap->publish_posts ) ) ) { |
348 | | - add_meta_box( 'slugdiv', __( 'Slug' ), 'post_slug_meta_box', null, 'normal', 'core' ); |
| 360 | + add_meta_box( 'slugdiv', __( 'Slug' ), 'post_slug_meta_box', null, 'normal', 'core', array( '__back_compat_meta_box' => true ) ); |
349 | 361 | } |
350 | 362 |
|
351 | 363 | if ( post_type_supports( $post_type, 'author' ) && current_user_can( $post_type_object->cap->edit_others_posts ) ) { |
352 | | - add_meta_box( 'authordiv', __( 'Author' ), 'post_author_meta_box', null, 'normal', 'core' ); |
| 364 | + add_meta_box( 'authordiv', __( 'Author' ), 'post_author_meta_box', null, 'normal', 'core', array( '__back_compat_meta_box' => true ) ); |
353 | 365 | } |
354 | 366 |
|
355 | 367 | /** |
|
0 commit comments