Changeset 15912
- Timestamp:
- 10/22/2010 11:08:35 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/default-list-tables.php
r15904 r15912 3327 3327 3328 3328 if ( $s ) { 3329 function _search_plugins_filter_callback( $plugin ) {3330 static $term;3331 if ( is_null( $term ) )3332 $term = stripslashes( $_REQUEST['s'] );3333 3334 foreach ( $plugin as $value )3335 if ( stripos( $value, $term ) !== false )3336 return true;3337 3338 return false;3339 }3340 3329 $status = 'search'; 3341 $plugins['search'] = array_filter( $plugins['all'], '_search_plugins_filter_callback');3330 $plugins['search'] = array_filter( $plugins['all'], array( $this, '_search_callback' ) ); 3342 3331 } 3343 3332 … … 3356 3345 $order = strtoupper( $order ); 3357 3346 3358 function _order_plugins_callback( $plugin_a, $plugin_b ) { 3359 global $orderby, $order; 3360 3361 $a = $plugin_a[$orderby]; 3362 $b = $plugin_b[$orderby]; 3363 3364 if ( $a == $b ) 3365 return 0; 3366 3367 if ( 'DESC' == $order ) 3368 return ( $a < $b ) ? 1 : -1; 3369 else 3370 return ( $a < $b ) ? -1 : 1; 3371 } 3372 uasort( $this->items, '_order_plugins_callback' ); 3347 uasort( $this->items, array( $this, '_order_callback' ) ); 3373 3348 } 3374 3349 … … 3384 3359 'per_page' => $plugins_per_page, 3385 3360 ) ); 3361 } 3362 3363 function _search_callback( $plugin ) { 3364 static $term; 3365 if ( is_null( $term ) ) 3366 $term = stripslashes( $_REQUEST['s'] ); 3367 3368 foreach ( $plugin as $value ) 3369 if ( stripos( $value, $term ) !== false ) 3370 return true; 3371 3372 return false; 3373 } 3374 3375 function _order_callback( $plugin_a, $plugin_b ) { 3376 global $orderby, $order; 3377 3378 $a = $plugin_a[$orderby]; 3379 $b = $plugin_b[$orderby]; 3380 3381 if ( $a == $b ) 3382 return 0; 3383 3384 if ( 'DESC' == $order ) 3385 return ( $a < $b ) ? 1 : -1; 3386 else 3387 return ( $a < $b ) ? -1 : 1; 3386 3388 } 3387 3389
Note: See TracChangeset
for help on using the changeset viewer.