-
Author
-
August 16, 2018 at 17:03 #206565lydiabarilParticipant
Hi,
I am writing about the issue of profiles not being visible after registration until the registrered user signs in.
One way to get around this is to populate wp_bp_activity table with all the user ids and a value of last_activity for the field “type”.
Could you please provide a code for that ? I have found code to insert in function.php but it is for a previous version of buddypress.
Also, it would be so much better even to find a way to not populate this table and just show all the users without checking if they have last_activity. Is there a way to do that ?
thanks
August 16, 2018 at 22:14 #206614LauraModeratorHello, will assign the ticket to a higher support level who can help and advise you in your query.
Thanks! ?Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionLaura Solanes - Graphic Designer and Web Designer
Please be patient as I try to answer each topic as fast as i can.
If you like the theme or the support you've received please consider leaving us a review on Themeforest!
Always happy to help you 🙂
August 17, 2018 at 18:21 #206716RaduModeratorHi,
Use the next function for the new users that only register
COPY CODE//!!!!!This function should run only one time. add_action( 'wp_loaded', 'sq_retroactive_user_fix' ); function sq_retroactive_user_fix() { $users = get_users( array( 'fields' => 'ID', 'number' => 2000 ) ); foreach( $users as $user_id ) { // Check to see if the user has activity if ( bp_get_user_last_activity( $user_id ) ) { continue; } // Inactive so lets activate bp_update_user_last_activity( $user_id, bp_core_current_time() ); } // Clean transient cache delete_transient( 'bp_active_member_count' ); } //END !!!!!This function should run only one time.
This function should run only one time.
Cheers
RHi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution -
AuthorPosts
You must be logged in to reply to this topic.