/user_associated_blogs_loop.php Secret
Created
May 4, 2016 19:07
Star
You must be signed in to star a gist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Get the users blogs and loop through them | |
$blogs = get_blogs_of_user( $user_id ); | |
foreach( $blogs as $blog ) { | |
switch_to_blog( $blog->userblog_id ); | |
// Update the post count array with post count from each blog | |
$network_post_count[] = count_user_posts( $user_id ); | |
restore_current_blog(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment