WordPress.org

Ready to get started?Download WordPress

Forums

A report plugin: wp_list_authors() and switch_to_blog() (1 post)

  1. DrLightman
    Member
    Posted 3 years ago #

    Hi, I'm writing a small plugin to have a global report of all authors posts number of the network.

    The plugin shows the list of all blogs, when the admin clicks a blog, a box appears with the output of wp_list_authors for that blog.

    All good, on the chart, but it doesn't work.

    switch_to_blog( $expand_blog_id );
    wp_list_authors( array(
    	'orderby'	=> 'post_count',
    	'order'		=> 'DESC'
    ) );
    restore_current_blog( );

    This code doesn't seem to work, nothing is output. Any idea why?

    I used switch_to_blog() with wp_count_posts() in the same plugin and it worked, may be that it does not with wp_list_authors()?

Topic Closed

This topic has been closed to new replies.

About this Topic