Make WordPress Core


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/bookmark.php

    r18355 r17146  
    214214    $orderby = strtolower($orderby);
    215215    $length = '';
    216     switch ( $orderby ) {
     216    switch ($orderby) {
    217217        case 'length':
    218218            $length = ", CHAR_LENGTH(link_name) AS length";
     
    221221            $orderby = 'rand()';
    222222            break;
    223         case 'link_id':
    224             $orderby = "$wpdb->links.link_id";
    225             break;
    226223        default:
    227224            $orderparams = array();
    228             foreach ( explode(',', $orderby) as $ordparam ) {
    229                 $ordparam = trim($ordparam);
    230                 if ( in_array( $ordparam, array( 'name', 'url', 'visible', 'rating', 'owner', 'updated' ) ) )
    231                     $orderparams[] = 'link_' . $ordparam;
    232             }
     225            foreach ( explode(',', $orderby) as $ordparam )
     226                $orderparams[] = 'link_' . trim($ordparam);
    233227            $orderby = implode(',', $orderparams);
    234228    }
    235229
    236     if ( empty( $orderby ) )
    237         $orderby = 'link_name';
    238 
    239     $order = strtoupper( $order );
    240     if ( '' !== $order && !in_array( $order, array( 'ASC', 'DESC' ) ) )
    241         $order = 'ASC';
     230    if ( 'link_id' == $orderby )
     231        $orderby = "$wpdb->links.link_id";
    242232
    243233    $visible = '';
Note: See TracChangeset for help on using the changeset viewer.