Skip to content
Browse files

Instead of limiting the array of blogs, we'll just replace the array …

…that is used.
  • Loading branch information...
1 parent 4cd3712 commit f2308944a181ab1f7ebea6d0921f69773442e8c0 @joshbetz joshbetz committed Jul 9, 2012
Showing with 7 additions and 4 deletions.
  1. +7 −4 includes/class-bulk-user-table.php
View
11 includes/class-bulk-user-table.php
@@ -96,15 +96,18 @@ function get_bulk_actions() {
}
function get_blog_ids( $cap ) {
+
+ $limit = array_map( 'intval', apply_filters( 'bulk_user_management_blogs', array() ) );
+
+ if ( count( $limit ) > 0 )
+ return $limit;
+
$user_id = get_current_user_id();
$blogs = get_blogs_of_user( $user_id );
-
- $limit = array_map( 'intval', apply_filters( 'bulk_user_management_limit_blogs', array() ) );
-
$blog_ids = array();
foreach ( $blogs as $blog ) {
$user = new WP_User( $user_id, null, $blog->userblog_id );
- if ( user_can( $user, $cap ) && ( count( $limit ) == 0 || in_array( $blog->userblog_id, $limit ) ) )
+ if ( user_can( $user, $cap ) )
$blog_ids[] = $blog->userblog_id;
}

0 comments on commit f230894

Please sign in to comment.
Something went wrong with that request. Please try again.