WordPress.org

Make WordPress Core

Changeset 38862


Ignore:
Timestamp:
10/21/2016 04:16:17 PM (19 months ago)
Author:
westonruter
Message:

Customize: Revert part of [38859] which caused sections to get deactivated in the customizer.

See #37128.

File:
1 edited

Legend:

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

    r38859 r38862  
    25062506     *
    25072507     * @since 3.4.0
    2508      * @deprecated 4.7.0 Use wp_list_sort()
    25092508     *
    25102509     * @param WP_Customize_Panel|WP_Customize_Section|WP_Customize_Control $a Object A.
     
    25132512     */
    25142513    protected function _cmp_priority( $a, $b ) {
    2515         _deprecated_function( __METHOD__, '4.7.0', 'wp_list_sort' );
    2516 
    25172514        if ( $a->priority === $b->priority ) {
    25182515            return $a->instance_number - $b->instance_number;
     
    25342531
    25352532        $controls = array();
    2536         $this->controls = wp_list_sort( $this->controls, array(
    2537             'priority'        => 'ASC',
    2538             'instance_number' => 'ASC',
    2539         ) );
     2533        uasort( $this->controls, array( $this, '_cmp_priority' ) );
    25402534
    25412535        foreach ( $this->controls as $id => $control ) {
     
    25502544
    25512545        // Prepare sections.
    2552         $this->sections = wp_list_sort( $this->sections, array(
    2553             'priority'        => 'ASC',
    2554             'instance_number' => 'ASC',
    2555         ) );
     2546        uasort( $this->sections, array( $this, '_cmp_priority' ) );
    25562547        $sections = array();
    25572548
     
    25612552            }
    25622553
    2563 
    2564             $section->controls = wp_list_sort( $section->controls, array(
    2565                 'priority'        => 'ASC',
    2566                 'instance_number' => 'ASC',
    2567             ) );
     2554            usort( $section->controls, array( $this, '_cmp_priority' ) );
    25682555
    25692556            if ( ! $section->panel ) {
     
    25802567
    25812568        // Prepare panels.
    2582         $this->panels = wp_list_sort( $this->panels, array(
    2583             'priority'        => 'ASC',
    2584             'instance_number' => 'ASC',
    2585         ) );
     2569        uasort( $this->panels, array( $this, '_cmp_priority' ) );
    25862570        $panels = array();
    25872571
     
    25912575            }
    25922576
    2593             $panel->sections = wp_list_sort( $panel->sections, array(
    2594                 'priority'        => 'ASC',
    2595                 'instance_number' => 'ASC',
    2596             ) );
     2577            uasort( $panel->sections, array( $this, '_cmp_priority' ) );
    25972578            $panels[ $panel->id ] = $panel;
    25982579        }
     
    26012582        // Sort panels and top-level sections together.
    26022583        $this->containers = array_merge( $this->panels, $this->sections );
    2603         $this->containers = wp_list_sort( $this->containers, array(
    2604             'priority'        => 'ASC',
    2605             'instance_number' => 'ASC',
    2606         ) );
     2584        uasort( $this->containers, array( $this, '_cmp_priority' ) );
    26072585    }
    26082586
Note: See TracChangeset for help on using the changeset viewer.