Make WordPress Core

Changeset 11428


Ignore:
Timestamp:
05/22/2009 12:29:32 PM (16 years ago)
Author:
azaozz
Message:

Make get_terms() orderby case insensitive, props DD32, fixes #9906

Location:
trunk/wp-includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/category-template.php

    r11383 r11428  
    333333    $defaults = array(
    334334        'show_option_all' => '', 'show_option_none' => '',
    335         'orderby' => 'ID', 'order' => 'ASC',
     335        'orderby' => 'id', 'order' => 'ASC',
    336336        'show_last_update' => 0, 'show_count' => 0,
    337337        'hide_empty' => 1, 'child_of' => 0,
  • trunk/wp-includes/taxonomy.php

    r11324 r11428  
    672672    }
    673673
    674     if ( 'count' == $orderby )
     674    $_orderby = strtolower($orderby);
     675    if ( 'count' == $_orderby )
    675676        $orderby = 'tt.count';
    676     else if ( 'name' == $orderby )
     677    else if ( 'name' == $_orderby )
    677678        $orderby = 't.name';
    678     else if ( 'slug' == $orderby )
     679    else if ( 'slug' == $_orderby )
    679680        $orderby = 't.slug';
    680     else if ( 'term_group' == $orderby )
     681    else if ( 'term_group' == $_orderby )
    681682        $orderby = 't.term_group';
    682     elseif ( empty($orderby) || 'id' == $orderby )
     683    elseif ( empty($_orderby) || 'id' == $_orderby )
    683684        $orderby = 't.term_id';
    684    
     685
    685686    $orderby = apply_filters( 'get_terms_orderby', $orderby, $args );
    686687
Note: See TracChangeset for help on using the changeset viewer.