From 9e6f811c2bb78068eeca292c2bc8f26c09d8b4b2 Mon Sep 17 00:00:00 2001 From: "Dominik Schilling (ocean90)" Date: Fri, 14 Mar 2014 20:00:09 +0000 Subject: [PATCH] Widget Customizer: Move widget area sections to bottom. Since a theme can have a lot of widget areas and we don't want to bury third-party sections, bump the widget sections to the bottom with a priority of 1000+. Fixes also the ordering. props westonruter. fixes #27401. git-svn-id: https://develop.svn.wordpress.org/trunk@27541 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/class-wp-customize-widgets.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/wp-includes/class-wp-customize-widgets.php b/src/wp-includes/class-wp-customize-widgets.php index 2182ca1638..249505bdec 100644 --- a/src/wp-includes/class-wp-customize-widgets.php +++ b/src/wp-includes/class-wp-customize-widgets.php @@ -258,7 +258,7 @@ class WP_Customize_Widgets { * @action customize_register */ static function customize_register( $wp_customize = null ) { - global $wp_registered_widgets, $wp_registered_widget_controls; + global $wp_registered_widgets, $wp_registered_widget_controls, $wp_registered_sidebars; if ( ! ( $wp_customize instanceof WP_Customize_Manager ) ) { $wp_customize = $GLOBALS['wp_customize']; } @@ -311,6 +311,7 @@ class WP_Customize_Widgets { $section_args = array( 'title' => sprintf( __( 'Widgets: %s' ), $GLOBALS['wp_registered_sidebars'][$sidebar_id]['name'] ), 'description' => $GLOBALS['wp_registered_sidebars'][$sidebar_id]['description'], + 'priority' => 1000 + array_search( $sidebar_id, array_keys( $wp_registered_sidebars ) ), ); $section_args = apply_filters( 'customizer_widgets_section_args', $section_args, $section_id, $sidebar_id ); $wp_customize->add_section( $section_id, $section_args );