Make WordPress Core

Ticket #45257: 45257.patch

File 45257.patch, 4.7 KB (added by ocean90, 6 years ago)
  • src/wp-admin/includes/meta-boxes.php

     
    356356         * @since 3.5.0
    357357         * @since 4.9.0 Added the `$post` parameter.
    358358         *
    359          * @param WP_Post $post WP_Post object for the current attachment. 
     359         * @param WP_Post $post WP_Post object for the current attachment.
    360360         */
    361361        do_action( 'attachment_submitbox_misc_actions', $post );
    362362        ?>
     
    13281328                add_meta_box( 'submitdiv', __( 'Publish' ), 'post_submit_meta_box', null, 'side', 'core', $publish_callback_args );
    13291329        }
    13301330
    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' ) ) {
    13321332                add_meta_box( 'formatdiv', _x( 'Format', 'post format' ), 'post_format_meta_box', null, 'side', 'core', array( '__back_compat_meta_box' => true ) );
     1333        }
    13331334
    13341335        // all taxonomies
    13351336        foreach ( get_object_taxonomies( $post ) as $tax_name ) {
    13361337                $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 ) {
    13381339                        continue;
     1340                }
    13391341
    13401342                $label = $taxonomy->labels->name;
    13411343
    1342                 if ( ! is_taxonomy_hierarchical( $tax_name ) )
     1344                if ( ! is_taxonomy_hierarchical( $tax_name ) ) {
    13431345                        $tax_meta_box_id = 'tagsdiv-' . $tax_name;
    1344                 else
     1346                } else {
    13451347                        $tax_meta_box_id = $tax_name . 'div';
     1348                }
    13461349
    13471350                add_meta_box( $tax_meta_box_id, $label, $taxonomy->meta_box_cb, null, 'side', 'core', array( 'taxonomy' => $tax_name, '__back_compat_meta_box' => true ) );
    13481351        }
     
    13511354                add_meta_box( 'pageparentdiv', $post_type_object->labels->attributes, 'page_attributes_meta_box', null, 'side', 'core', array( '__back_compat_meta_box' => true ) );
    13521355        }
    13531356
    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        }
    13561360
    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        }
    13591364
    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        }
    13621368
    1363         if ( post_type_supports($post_type, 'custom-fields') )
     1369        if ( post_type_supports( $post_type, 'custom-fields' ) ) {
    13641370                $screen = get_current_screen();
    13651371                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 ) );
    13671373                }
     1374        }
    13681375
    13691376        /**
    13701377         * Fires in the middle of built-in meta box registration.
     
    13961403                }
    13971404        }
    13981405
    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        }
    14011409
    14021410        if ( post_type_supports( $post_type, 'author' ) && current_user_can( $post_type_object->cap->edit_others_posts ) ) {
    14031411                add_meta_box( 'authordiv', __( 'Author' ), 'post_author_meta_box', null, 'normal', 'core', array( '__back_compat_meta_box' => true ) );