Ticket #45257: 45257.patch
File 45257.patch, 4.7 KB (added by , 6 years ago) |
---|
-
src/wp-admin/includes/meta-boxes.php
356 356 * @since 3.5.0 357 357 * @since 4.9.0 Added the `$post` parameter. 358 358 * 359 * @param WP_Post $post WP_Post object for the current attachment. 359 * @param WP_Post $post WP_Post object for the current attachment. 360 360 */ 361 361 do_action( 'attachment_submitbox_misc_actions', $post ); 362 362 ?> … … 1328 1328 add_meta_box( 'submitdiv', __( 'Publish' ), 'post_submit_meta_box', null, 'side', 'core', $publish_callback_args ); 1329 1329 } 1330 1330 1331 if ( current_theme_supports( 'post-formats' ) && post_type_supports( $post_type, 'post-formats' ) ) 1331 if ( current_theme_supports( 'post-formats' ) && post_type_supports( $post_type, 'post-formats' ) ) { 1332 1332 add_meta_box( 'formatdiv', _x( 'Format', 'post format' ), 'post_format_meta_box', null, 'side', 'core', array( '__back_compat_meta_box' => true ) ); 1333 } 1333 1334 1334 1335 // all taxonomies 1335 1336 foreach ( get_object_taxonomies( $post ) as $tax_name ) { 1336 1337 $taxonomy = get_taxonomy( $tax_name ); 1337 if ( ! $taxonomy->show_ui || false === $taxonomy->meta_box_cb ) 1338 if ( ! $taxonomy->show_ui || false === $taxonomy->meta_box_cb ) { 1338 1339 continue; 1340 } 1339 1341 1340 1342 $label = $taxonomy->labels->name; 1341 1343 1342 if ( ! is_taxonomy_hierarchical( $tax_name ) ) 1344 if ( ! is_taxonomy_hierarchical( $tax_name ) ) { 1343 1345 $tax_meta_box_id = 'tagsdiv-' . $tax_name; 1344 else1346 } else { 1345 1347 $tax_meta_box_id = $tax_name . 'div'; 1348 } 1346 1349 1347 1350 add_meta_box( $tax_meta_box_id, $label, $taxonomy->meta_box_cb, null, 'side', 'core', array( 'taxonomy' => $tax_name, '__back_compat_meta_box' => true ) ); 1348 1351 } … … 1351 1354 add_meta_box( 'pageparentdiv', $post_type_object->labels->attributes, 'page_attributes_meta_box', null, 'side', 'core', array( '__back_compat_meta_box' => true ) ); 1352 1355 } 1353 1356 1354 if ( $thumbnail_support && current_user_can( 'upload_files' ) ) 1355 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 ) ); 1357 if ( $thumbnail_support && current_user_can( 'upload_files' ) ) { 1358 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 ) ); 1359 } 1356 1360 1357 if ( post_type_supports($post_type, 'excerpt') ) 1358 add_meta_box('postexcerpt', __('Excerpt'), 'post_excerpt_meta_box', null, 'normal', 'core', array( '__back_compat_meta_box' => true ) ); 1361 if ( post_type_supports( $post_type, 'excerpt' ) ) { 1362 add_meta_box( 'postexcerpt', __('Excerpt'), 'post_excerpt_meta_box', null, 'normal', 'core', array( '__back_compat_meta_box' => true ) ); 1363 } 1359 1364 1360 if ( post_type_supports($post_type, 'trackbacks') ) 1361 add_meta_box('trackbacksdiv', __('Send Trackbacks'), 'post_trackback_meta_box', null, 'normal', 'core', array( '__back_compat_meta_box' => true ) ); 1365 if ( post_type_supports( $post_type, 'trackbacks' ) ) { 1366 add_meta_box( 'trackbacksdiv', __('Send Trackbacks'), 'post_trackback_meta_box', null, 'normal', 'core', array( '__back_compat_meta_box' => true ) ); 1367 } 1362 1368 1363 if ( post_type_supports( $post_type, 'custom-fields') )1369 if ( post_type_supports( $post_type, 'custom-fields' ) ) { 1364 1370 $screen = get_current_screen(); 1365 1371 if ( ! $screen || ! $screen->is_block_editor() || (bool) get_user_meta( get_current_user_id(), 'enable_custom_fields', true ) ) { 1366 add_meta_box( 'postcustom', __('Custom Fields'), 'post_custom_meta_box', null, 'normal', 'core', array( '__back_compat_meta_box' => false, '__block_editor_compatible_meta_box' => true ) );1372 add_meta_box( 'postcustom', __('Custom Fields'), 'post_custom_meta_box', null, 'normal', 'core', array( '__back_compat_meta_box' => false, '__block_editor_compatible_meta_box' => true ) ); 1367 1373 } 1374 } 1368 1375 1369 1376 /** 1370 1377 * Fires in the middle of built-in meta box registration. … … 1396 1403 } 1397 1404 } 1398 1405 1399 if ( ! ( 'pending' == get_post_status( $post ) && ! current_user_can( $post_type_object->cap->publish_posts ) ) ) 1400 add_meta_box('slugdiv', __('Slug'), 'post_slug_meta_box', null, 'normal', 'core', array( '__back_compat_meta_box' => true ) ); 1406 if ( ! ( 'pending' == get_post_status( $post ) && ! current_user_can( $post_type_object->cap->publish_posts ) ) ) { 1407 add_meta_box( 'slugdiv', __('Slug'), 'post_slug_meta_box', null, 'normal', 'core', array( '__back_compat_meta_box' => true ) ); 1408 } 1401 1409 1402 1410 if ( post_type_supports( $post_type, 'author' ) && current_user_can( $post_type_object->cap->edit_others_posts ) ) { 1403 1411 add_meta_box( 'authordiv', __( 'Author' ), 'post_author_meta_box', null, 'normal', 'core', array( '__back_compat_meta_box' => true ) );