How to Display a List of Users Who Have Made at Least 1 Post?

You need to set the who parameter in get_users <?php $blogusers = get_users( ‘orderby=post_count&who=authors’ ); foreach ( $blogusers as $user ) { echo ‘<li>’ . esc_html( $user->display_name ) . ‘</li>’; } ?> EDIT Seems I was to fast answering. The code in your question and in my answer is the start to what you want … Read more

New post status for custom post type

There is a great Step by Step description on how to do that here https://www.jclabs.co.uk/create-custom-post-status-in-wordpress-using-register_post_status/ To add your custom post status to the drop-down menue, just add the following to your themes function script: add_action(‘admin_footer-post.php’, ‘jc_append_post_status_list’); function jc_append_post_status_list(){ global $post; $complete=””; $label=””; if($post->post_type == ‘recipes’){ if($post->post_status == ‘aggregated’){ $complete=” selected=\”selected\””; $label=”<span id=\”post-status-display\”> Aggregated</span>”; } echo … Read more

How to check if a user (not current user) is logged in?

I would use transients to do this: create a user-online-update function that you hook on init; it would look something like this: // get the user activity the list $logged_in_users = get_transient(‘online_status’); // get current user ID $user = wp_get_current_user(); // check if the current user needs to update his online status; // he does … Read more