Ticket #37128: 37128-usage.diff
| File 37128-usage.diff, 4.5 KB (added by , 9 years ago) |
|---|
-
src/wp-includes/class-wp-customize-manager.php
1563 1563 public function prepare_controls() { 1564 1564 1565 1565 $controls = array(); 1566 uasort( $this->controls, array( $this, '_cmp_priority' ) ); 1566 $this->controls = wp_list_sort( $this->controls, array( 1567 'priority' => 'ASC', 1568 'instance_number' => 'ASC', 1569 ) ); 1567 1570 1568 1571 foreach ( $this->controls as $id => $control ) { 1569 1572 if ( ! isset( $this->sections[ $control->section ] ) || ! $control->check_capabilities() ) { … … 1576 1579 $this->controls = $controls; 1577 1580 1578 1581 // Prepare sections. 1579 uasort( $this->sections, array( $this, '_cmp_priority' ) ); 1582 $this->sections = wp_list_sort( $this->sections, array( 1583 'priority' => 'ASC', 1584 'instance_number' => 'ASC', 1585 ) ); 1580 1586 $sections = array(); 1581 1587 1582 1588 foreach ( $this->sections as $section ) { … … 1584 1590 continue; 1585 1591 } 1586 1592 1587 usort( $section->controls, array( $this, '_cmp_priority' ) );1588 1593 1594 $section->controls = wp_list_sort( $section->controls, array( 1595 'priority' => 'ASC', 1596 'instance_number' => 'ASC', 1597 ) ); 1598 1589 1599 if ( ! $section->panel ) { 1590 1600 // Top-level section. 1591 1601 $sections[ $section->id ] = $section; … … 1599 1609 $this->sections = $sections; 1600 1610 1601 1611 // Prepare panels. 1602 uasort( $this->panels, array( $this, '_cmp_priority' ) ); 1612 $this->panels = wp_list_sort( $this->panels, array( 1613 'priority' => 'ASC', 1614 'instance_number' => 'ASC', 1615 ) ); 1603 1616 $panels = array(); 1604 1617 1605 1618 foreach ( $this->panels as $panel ) { … … 1607 1620 continue; 1608 1621 } 1609 1622 1610 uasort( $panel->sections, array( $this, '_cmp_priority' ) ); 1623 $panel->sections = wp_list_sort( $panel->sections, array( 1624 'priority' => 'ASC', 1625 'instance_number' => 'ASC', 1626 ) ); 1611 1627 $panels[ $panel->id ] = $panel; 1612 1628 } 1613 1629 $this->panels = $panels; 1614 1630 1615 1631 // Sort panels and top-level sections together. 1616 1632 $this->containers = array_merge( $this->panels, $this->sections ); 1617 uasort( $this->containers, array( $this, '_cmp_priority' ) ); 1633 $this->containers = wp_list_sort( $this->containers, array( 1634 'priority' => 'ASC', 1635 'instance_number' => 'ASC', 1636 ) ); 1618 1637 } 1619 1638 1620 1639 /** -
src/wp-includes/customize/class-wp-customize-nav-menu-item-setting.php
503 503 } 504 504 505 505 if ( ARRAY_A === $args['output'] ) { 506 $GLOBALS['_menu_item_sort_prop'] = $args['output_key']; 507 usort( $items, '_sort_nav_menu_items' ); 506 $items = wp_list_sort( $items, array( 507 $args['output_key'] => 'ASC', 508 ) ); 508 509 $i = 1; 509 510 510 511 foreach ( $items as $k => $item ) { -
src/wp-includes/link-template.php
169 169 if ( strpos($permalink, '%category%') !== false ) { 170 170 $cats = get_the_category($post->ID); 171 171 if ( $cats ) { 172 usort($cats, '_usort_terms_by_ID'); // order by ID 172 $cats = wp_list_sort( $cats, array( 173 'term_id' => 'ASC', 174 ) ); 173 175 174 176 /** 175 177 * Filters the category that gets used in the %category% permalink token. -
src/wp-includes/nav-menu.php
682 682 } 683 683 684 684 if ( ARRAY_A == $args['output'] ) { 685 $GLOBALS['_menu_item_sort_prop'] = $args['output_key']; 686 usort($items, '_sort_nav_menu_items'); 685 $items = wp_list_sort( $items, array( 686 $args['output_key'] => 'ASC', 687 ) ); 687 688 $i = 1; 688 689 foreach ( $items as $k => $item ) { 689 690 $items[$k]->{$args['output_key']} = $i++; … … 772 773 773 774 $menu_item->type_label = __( 'Post Type Archive' ); 774 775 $post_content = wp_trim_words( $menu_item->post_content, 200 ); 775 $post_type_description = '' == $post_content ? $post_type_description : $post_content; 776 $post_type_description = '' == $post_content ? $post_type_description : $post_content; 776 777 $menu_item->url = get_post_type_archive_link( $menu_item->object ); 777 778 } elseif ( 'taxonomy' == $menu_item->type ) { 778 779 $object = get_taxonomy( $menu_item->object );