Total number of authors with more than one post

I believe that wp_list_authors will do what you want, sort of. You could run the function with the echo parameter false and count the results. $authors = wp_list_authors( array( ‘echo’=>false, ‘html’=>false ) ); echo var_dump($authors); echo count (explode(‘,’,$authors)); Or, alternately, and perhaps less profligately, steal that function’s SQL. $authors = $wpdb->get_results( “SELECT DISTINCT post_author, COUNT(ID) … Read more

Get all commenters on a post

I’m a little unclear as to exactly the final data you’re looking for. You said “array form”, but that’s not specific enough. So based on your code snippet, this code will provide you an array of all unique commenter user IDs. The code is essentially the same as yours, but I’ve combined a few parts … Read more

How to migrate wordpress users from one blog to another

Normally BackupBuddy should transfer users just fine, it might be issue with importing into multisite installation. Have you tried asking developers about it? As for more hands-on approach I’d try creating users in network and then overwrite hashes of their passwords in database with values from original installation.

How to change the order in which users are displayed in admin?

Nope, the line you found seems to be some basic preliminary query. Selection of users for display in table seems to be handled by WP_User_Search class. Luckily it can be hooked into easily. Try this (changes order to descending): add_action(‘pre_user_search’, ‘change_user_order’); function change_user_order($query) { $query->query_orderby = ‘ ORDER BY user_login DESC’; } PS I am … Read more

Get total number of authors on the site

You can use the WP_User_Query class, like the example below. Each code line have an small description, that you understand, what we do. // Get all users with role Author. $user_query = new WP_User_Query( array( ‘role’ => ‘Author’ ) ); // Get the total number of users for the current query. I use (int) only … Read more