Users activity history

It’s not going to show you previous history before the plugin was activated, there’s no way to do that as you have to have the plugin activated for it to log and store those. This is not something done by default in WordPress. What you need to do instead is to enable WordPress debugging, and … Read more

get_users – Sort by a different meta_value than search criteria

Should be ‘meta_key’ => ‘last_name’ instead of ‘meta_key’ => ‘user_lastname’ $args = array( ‘meta_query’ => array( array( ‘key’ => ‘pw_user_status’, ‘value’ => ‘approved’ , ), ), ‘orderby’ => ‘meta_value’, ‘meta_key’ => ‘last_name’, ‘order’ => ‘ASC’ ); $users = get_users( $args );

members only products

Use this code on your child theme’s functions.php file.. //Hide for non-logged-in users (public visitors) function bp_logged_out_page_template_redirect() { if( ! is_user_logged_in() && is_page( ‘members’ ) || is_page( ‘activity’ ) || bp_is_user() ) { wp_redirect( home_url( ‘/register/’ ) ); exit(); } } add_action( ‘template_redirect’, ‘bp_logged_out_page_template_redirect’ ); The above snippet will do: •IF the user is not … Read more

Return all users that have one or more published blog posts

There is an argument for this, and it is documented. If you look at the documentation for get_users() is says this: See WP_User_Query::prepare_query(). for more information on accepted arguments. If you follow that link you’ll see the list of arguments, and one of those is: ‘has_published_posts’ (bool|array) Pass an array of post types to filter … Read more