| 581 | /** |
| 582 | * Filter the list of a user's sites before it is populated. |
| 583 | * |
| 584 | * Returning a populated array effectively short circuits `get_blogs_of_user()`. |
| 585 | * |
| 586 | * @since 4.6.0 |
| 587 | * |
| 588 | * @param array $blogs An array of WP_Site objects of which the user is a member. Default is an empty array. |
| 589 | * @param int $user_id User ID. |
| 590 | * @param bool $all Whether the returned array should contain all sites, including |
| 591 | * those marked 'deleted', 'archived', or 'spam'. Default false. |
| 592 | */ |
| 593 | $blogs = apply_filters( 'pre_get_blogs_of_user', array(), $user_id, $all ); |
| 594 | |
| 595 | if ( is_array( $blogs ) && 0 < count( $blogs ) ) { |
| 596 | return $blogs; |
| 597 | } |
| 598 | |