Ticket #15828: 15828.patch
File 15828.patch, 1.1 KB (added by , 13 years ago) |
---|
-
wp-includes/user.php
648 648 * @param bool $all Whether to retrieve all blogs or only blogs that are not marked as deleted, archived, or spam. 649 649 * @return array A list of the user's blogs. False if the user was not found or an empty array if the user has no blogs. 650 650 */ 651 function get_blogs_of_user( $id, $all = false ) {651 function get_blogs_of_user( $id, $all = false, $order_by = false ) { 652 652 global $wpdb; 653 653 654 654 if ( !is_multisite() ) { … … 710 710 $blog_deets[ $blog_id ]->siteurl = $blog->siteurl; 711 711 } 712 712 } 713 714 if( false !== $order_by && in_array( $order_by, array( 'userblog_id', 'blogname', 'domain', 'path', 'site_id', 'siteurl' ) ) ) { 715 function bloglist_compare( $a, $b ){ 716 if ( $a->$order_by == $b->$order_by ) 717 return 0; 718 else 719 return ( $a->$order_by < $b->$order_by ) ? -1 : 1; 720 } 721 uasort($blog_deets, 'bloglist_compare'); 722 } 713 723 714 724 return apply_filters( 'get_blogs_of_user', $blog_deets, $id, $all ); 715 725 }