Changeset 18345
- Timestamp:
- 06/27/2011 03:46:11 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/bookmark.php
r17146 r18345 214 214 $orderby = strtolower($orderby); 215 215 $length = ''; 216 switch ( $orderby) {216 switch ( $orderby ) { 217 217 case 'length': 218 218 $length = ", CHAR_LENGTH(link_name) AS length"; … … 221 221 $orderby = 'rand()'; 222 222 break; 223 case 'link_id': 224 $orderby = "$wpdb->links.link_id"; 225 break; 223 226 default: 224 227 $orderparams = array(); 225 foreach ( explode(',', $orderby) as $ordparam ) 226 $orderparams[] = 'link_' . trim($ordparam); 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 } 227 233 $orderby = implode(',', $orderparams); 228 234 } 229 235 230 if ( 'link_id' == $orderby ) 231 $orderby = "$wpdb->links.link_id"; 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'; 232 242 233 243 $visible = '';
Note: See TracChangeset
for help on using the changeset viewer.