How to get a page to display the /members slug?
-
WP 6.6.2, BP 14.2.1, Divi theme.
I added a bunch of WordPress users to my site from a csv file using the Import and export users and customers plugin. Worked well. But those users couldn’t figure out how to make friend requests, since they couldn’t “see” the other users that they could ask. After some fumbling through this forum and googling, I came across the “/members” slug. I seemed like exactly what I needed, a list of members with a button to send a friend request to each one. The only problem was that it didn’t show all the users. More ressearch found this post from 10 years ago. Seems the issue was/is that it only shows those users who have had some BuddyPress activity recorded. But since these were mostly new users, most had no activity. So I wrote a little bp-custom.php file containing:
function make_all_users_active() { $users = get_users(); // repete_log(print_r($users, true), __FILE__, __LINE__); foreach($users as $user) { if (strlen(bp_get_user_last_activity($user->ID)) == 0) { // repete_log(sprintf("bp_update_user_last_activity(%s)", $user->ID), __FILE__, __LINE__); echo $user->ID . "<br>"; bp_update_user_last_activity($user->ID); } } } add_action ('wp_loaded', 'make_all_users_active');
This solved the problem of not showing all the other BuddyPress members, but as far as I can tell, I’ve now got to tell all the users that if they’re interested in making friend connections, they have to go to the address bar, and type /members right after the domain name. That seems ridiculous! I guess I could add a page containing a link to that slug that they could click, but it would be nicer if I could make a page they could find as one of the site’s pages that would display the information from that slug, without having to click a link. Better still would be to be able to customize the BuddyPress drop-down menu to add an item for “All Members” that would display the slug’s contents…
- You must be logged in to reply to this topic.