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

props celloexpressions.
fixes #28979.

Built from https://develop.svn.wordpress.org/trunk@29488


git-svn-id: http://core.svn.wordpress.org/trunk@29266 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin 2014-08-14 04:43:16 +00:00
parent ba9ee74028
commit de569d83a1
7 changed files with 28 additions and 14 deletions

View File

@ -132,7 +132,7 @@ body {
} }
#customize-theme-controls .control-section:last-of-type.open, #customize-theme-controls .control-section:last-of-type.open,
#customize-theme-controls .control-section:last-of-type .accordion-section-title { #customize-theme-controls .control-section:last-of-type > .accordion-section-title {
border-bottom-color: #ddd; border-bottom-color: #ddd;
} }

File diff suppressed because one or more lines are too long

View File

@ -132,7 +132,7 @@ body {
} }
#customize-theme-controls .control-section:last-of-type.open, #customize-theme-controls .control-section:last-of-type.open,
#customize-theme-controls .control-section:last-of-type .accordion-section-title { #customize-theme-controls .control-section:last-of-type > .accordion-section-title {
border-bottom-color: #ddd; border-bottom-color: #ddd;
} }

File diff suppressed because one or more lines are too long

View File

@ -161,11 +161,8 @@ do_action( 'customize_controls_print_scripts' );
<div id="customize-theme-controls"><ul> <div id="customize-theme-controls"><ul>
<?php <?php
foreach ( $wp_customize->panels() as $panel ) { foreach ( $wp_customize->containers() as $container ) {
$panel->maybe_render(); $container->maybe_render();
}
foreach ( $wp_customize->sections() as $section ) {
$section->maybe_render();
} }
?> ?>
</ul></div> </ul></div>

View File

@ -43,10 +43,11 @@ final class WP_Customize_Manager {
*/ */
public $widgets; public $widgets;
protected $settings = array(); protected $settings = array();
protected $panels = array(); protected $containers = array();
protected $sections = array(); protected $panels = array();
protected $controls = array(); protected $sections = array();
protected $controls = array();
protected $nonce_tick; protected $nonce_tick;
@ -305,6 +306,17 @@ final class WP_Customize_Manager {
return $this->controls; return $this->controls;
} }
/**
* Get the registered containers.
*
* @since 4.0.0
*
* @return array
*/
public function containers() {
return $this->containers;
}
/** /**
* Get the registered sections. * Get the registered sections.
* *
@ -891,6 +903,10 @@ final class WP_Customize_Manager {
$panels[] = $panel; $panels[] = $panel;
} }
$this->panels = $panels; $this->panels = $panels;
// Sort panels and top-level sections together.
$this->containers = array_merge( $this->panels, $this->sections );
uasort( $this->containers, array( $this, '_cmp_priority' ) );
} }
/** /**

View File

@ -434,8 +434,9 @@ final class WP_Customize_Widgets {
} }
$this->manager->add_panel( 'widgets', array( $this->manager->add_panel( 'widgets', array(
'title' => __( 'Widgets' ), 'title' => __( 'Widgets' ),
'description' => __( 'Widgets are independent sections of content that can be placed into widgetized areas provided by your theme (commonly called sidebars).' ), 'description' => __( 'Widgets are independent sections of content that can be placed into widgetized areas provided by your theme (commonly called sidebars).' ),
'priority' => 110,
) ); ) );
foreach ( $sidebars_widgets as $sidebar_id => $sidebar_widget_ids ) { foreach ( $sidebars_widgets as $sidebar_id => $sidebar_widget_ids ) {