Make WordPress Core

Changeset 29488


Ignore:
Timestamp:
08/14/2014 04:42:30 AM (12 years ago)
Author:
nacin
Message:

Customizer: Mixed priority sorting for panels and top-level sections.

props celloexpressions.
fixes #28979.

Location:
trunk/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/css/customize-controls.css

    r29470 r29488  
    133133
    134134#customize-theme-controls .control-section:last-of-type.open,
    135 #customize-theme-controls .control-section:last-of-type .accordion-section-title {
     135#customize-theme-controls .control-section:last-of-type > .accordion-section-title {
    136136        border-bottom-color: #ddd;
    137137}
  • trunk/src/wp-admin/customize.php

    r29206 r29488  
    162162                        <div id="customize-theme-controls"><ul>
    163163                                <?php
    164                                 foreach ( $wp_customize->panels() as $panel ) {
    165                                         $panel->maybe_render();
    166                                 }
    167                                 foreach ( $wp_customize->sections() as $section ) {
    168                                         $section->maybe_render();
     164                                foreach ( $wp_customize->containers() as $container ) {
     165                                        $container->maybe_render();
    169166                                }
    170167                                ?>
  • trunk/src/wp-includes/class-wp-customize-manager.php

    r29487 r29488  
    4444        public $widgets;
    4545
    46         protected $settings = array();
    47         protected $panels   = array();
    48         protected $sections = array();
    49         protected $controls = array();
     46        protected $settings   = array();
     47        protected $containers = array();
     48        protected $panels     = array();
     49        protected $sections   = array();
     50        protected $controls   = array();
    5051
    5152        protected $nonce_tick;
     
    304305        public function controls() {
    305306                return $this->controls;
     307        }
     308
     309        /**
     310         * Get the registered containers.
     311         *
     312         * @since 4.0.0
     313         *
     314         * @return array
     315         */
     316        public function containers() {
     317                return $this->containers;
    306318        }
    307319
     
    892904                }
    893905                $this->panels = $panels;
     906
     907                // Sort panels and top-level sections together.
     908                $this->containers = array_merge( $this->panels, $this->sections );
     909                uasort( $this->containers, array( $this, '_cmp_priority' ) );
    894910        }
    895911
  • trunk/src/wp-includes/class-wp-customize-widgets.php

    r29377 r29488  
    435435
    436436                $this->manager->add_panel( 'widgets', array(
    437                         'title' => __( 'Widgets' ),
     437                        'title'       => __( 'Widgets' ),
    438438                        'description' => __( 'Widgets are independent sections of content that can be placed into widgetized areas provided by your theme (commonly called sidebars).' ),
     439                        'priority'    => 110,
    439440                ) );
    440441
Note: See TracChangeset for help on using the changeset viewer.