WordPress.org

Make WordPress Core

Changeset 27541


Ignore:
Timestamp:
03/14/2014 08:00:09 PM (7 years ago)
Author:
ocean90
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-customize-widgets.php

    r27525 r27541  
    259259     */
    260260    static function customize_register( $wp_customize = null ) {
    261         global $wp_registered_widgets, $wp_registered_widget_controls;
     261        global $wp_registered_widgets, $wp_registered_widget_controls, $wp_registered_sidebars;
    262262        if ( ! ( $wp_customize instanceof WP_Customize_Manager ) ) {
    263263            $wp_customize = $GLOBALS['wp_customize'];
     
    312312                        'title' => sprintf( __( 'Widgets: %s' ), $GLOBALS['wp_registered_sidebars'][$sidebar_id]['name'] ),
    313313                        'description' => $GLOBALS['wp_registered_sidebars'][$sidebar_id]['description'],
     314                        'priority' => 1000 + array_search( $sidebar_id, array_keys( $wp_registered_sidebars ) ),
    314315                    );
    315316                    $section_args = apply_filters( 'customizer_widgets_section_args', $section_args, $section_id, $sidebar_id );
Note: See TracChangeset for help on using the changeset viewer.