Make WordPress Core

Ticket #28979: 28979.diff

File 28979.diff, 2.2 KB (added by helen, 9 years ago)
  • src/wp-admin/customize.php

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

     
    4444        public $widgets;
    4545
    4646        protected $settings = array();
     47        protected $containers = array();
    4748        protected $panels   = array();
    4849        protected $sections = array();
    4950        protected $controls = array();
     
    328329        }
    329330
    330331        /**
     332         * Get the registered containers.
     333         *
     334         * @since 4.0.0
     335         * @access public
     336         *
     337         * @return array Sorted panels and top-level sections.
     338         */
     339        public function containers() {
     340                return $this->containers;
     341        }
     342
     343        /**
    331344         * Checks if the current theme is active.
    332345         *
    333346         * @since 3.4.0
     
    890903                        $panels[] = $panel;
    891904                }
    892905                $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' ) );
    893910        }
    894911
    895912        /**
  • src/wp-includes/class-wp-customize-widgets.php

     
    436436                $this->manager->add_panel( 'widgets', array(
    437437                        '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' => 140,
    439440                ) );
    440441
    441442                foreach ( $sidebars_widgets as $sidebar_id => $sidebar_widget_ids ) {