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

props celloexpressions.
fixes #28979.


git-svn-id: https://develop.svn.wordpress.org/trunk@29488 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin
2014-08-14 04:42:30 +00:00
parent 112f9e9cc7
commit bc582fc058
4 changed files with 25 additions and 11 deletions

View File

@@ -43,10 +43,11 @@ final class WP_Customize_Manager {
*/
public $widgets;
protected $settings = array();
protected $panels = array();
protected $sections = array();
protected $controls = array();
protected $settings = array();
protected $containers = array();
protected $panels = array();
protected $sections = array();
protected $controls = array();
protected $nonce_tick;
@@ -305,6 +306,17 @@ final class WP_Customize_Manager {
return $this->controls;
}
/**
* Get the registered containers.
*
* @since 4.0.0
*
* @return array
*/
public function containers() {
return $this->containers;
}
/**
* Get the registered sections.
*
@@ -891,6 +903,10 @@ final class WP_Customize_Manager {
$panels[] = $panel;
}
$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' ) );
}
/**