Advertisements

get_most_active_blogs

Definition:
function get_most_active_blogs( $num = 10, $display = true ) {}

Parameters

  • $num
  • $display

Source code

function get_most_active_blogs( $num = 10, $display = true ) {

	_deprecated_function( __FUNCTION__, '3.0' );



	$blogs = get_blog_list( 0, 'all', false ); // $blog_id -> $details

	if ( is_array( $blogs ) ) {

		reset( $blogs );

		foreach ( (array) $blogs as $key => $details ) {

			$most_active[ $details['blog_id'] ] = $details['postcount'];

			$blog_list[ $details['blog_id'] ] = $details; // array_slice() removes keys!!

		}

		arsort( $most_active );

		reset( $most_active );

		foreach ( (array) $most_active as $key => $details )

			$t[ $key ] = $blog_list[ $key ];



		unset( $most_active );

		$most_active = $t;

	}



	if ( $display == true ) {

		if ( is_array( $most_active ) ) {

			reset( $most_active );

			foreach ( (array) $most_active as $key => $details ) {

				$url = esc_url('http://' . $details['domain'] . $details['path']);

				echo '<li>' . $details['postcount'] . " <a href='$url'>$url</a></li>";

			}

		}

	}

	return array_slice( $most_active, 0, $num );

}

1488

Advertisements

No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: