WordPress.org

Support

Support » How-To and Troubleshooting » A report plugin: wp_list_authors() and switch_to_blog()

A report plugin: wp_list_authors() and switch_to_blog()

  • 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()?

  • The topic ‘A report plugin: wp_list_authors() and switch_to_blog()’ is closed to new replies.