Make WordPress Core

Ticket #28956: 28956.1.patch

File 28956.1.patch, 3.6 KB (added by keesiemeijer, 8 years ago)

Add meta_box_context and meta_box_priority parameters

  • src/wp-admin/edit-form-advanced.php

     
    246246// all taxonomies
    247247foreach ( get_object_taxonomies( $post ) as $tax_name ) {
    248248        $taxonomy = get_taxonomy( $tax_name );
    249         if ( ! $taxonomy->show_ui || false === $taxonomy->meta_box_cb )
     249        if ( ! $taxonomy->show_ui || false === $taxonomy->meta_box_cb ) {
    250250                continue;
     251        }
    251252
    252253        $label = $taxonomy->labels->name;
    253254
    254         if ( ! is_taxonomy_hierarchical( $tax_name ) )
     255        if ( ! is_taxonomy_hierarchical( $tax_name ) ) {
    255256                $tax_meta_box_id = 'tagsdiv-' . $tax_name;
    256         else
     257        } else {
    257258                $tax_meta_box_id = $tax_name . 'div';
     259        }
    258260
    259         add_meta_box( $tax_meta_box_id, $label, $taxonomy->meta_box_cb, null, 'side', 'core', array( 'taxonomy' => $tax_name ) );
     261        add_meta_box( $tax_meta_box_id, $label, $taxonomy->meta_box_cb, null, $taxonomy->meta_box_context , $taxonomy->meta_box_priority, array( 'taxonomy' => $tax_name ) );
    260262}
    261263
    262264if ( post_type_supports( $post_type, 'page-attributes' ) || count( get_page_templates( $post ) ) > 0 ) {
  • src/wp-includes/class-wp-taxonomy.php

     
    142142        public $meta_box_cb = null;
    143143
    144144        /**
     145         * The context for the meta box display.
     146         *
     147         * @since 4.8.0
     148         * @access public
     149         * @var string
     150         */
     151        public $meta_box_context = 'side';
     152
     153        /**
     154         * The priority for the meta box display.
     155         *
     156         * @since 4.8.0
     157         * @access public
     158         * @var string
     159         */
     160        public $meta_box_priority = 'core';
     161
     162        /**
    145163         * An array of object types this taxonomy is registered for.
    146164         *
    147165         * @since 4.7.0
     
    250268                        'show_in_quick_edit'    => null,
    251269                        'show_admin_column'     => false,
    252270                        'meta_box_cb'           => null,
     271                        'meta_box_context'      => 'side',
     272                        'meta_box_priority'     => 'core',
    253273                        'capabilities'          => array(),
    254274                        'rewrite'               => true,
    255275                        'query_var'             => $this->name,
  • src/wp-includes/taxonomy.php

     
    294294 * @since 4.4.0 The `show_ui` argument is now enforced on the term editing screen.
    295295 * @since 4.4.0 The `public` argument now controls whether the taxonomy can be queried on the front end.
    296296 * @since 4.5.0 Introduced `publicly_queryable` argument.
     297 * @since 4.8.0 Introduced `meta_box_context` and `meta_box_priority` argument.
    297298 *
    298299 * @global array $wp_taxonomies Registered taxonomies.
    299300 *
     
    333334 *                                                post_categories_meta_box() is used for hierarchical taxonomies, and
    334335 *                                                post_tags_meta_box() is used for non-hierarchical. If false, no meta
    335336 *                                                box is shown.
     337 *     @type string        $meta_box_context      The context within the screen where the meta box is displayed.
     338 *                                                Accepts 'side', 'normal' and 'advanced'. Default value: 'side'.
     339 *     @type string        $meta_box_priority     The priority within the context where the meta box is displayed.
     340 *                                                Accepts 'high', 'core', 'default' and 'low'. Default value: 'core'.
    336341 *     @type array         $capabilities {
    337342 *         Array of capabilities for this taxonomy.
    338343 *