Hi,
https://buddydev.com/plugins/recent-visitors-for-buddypress-profile/
1) I used user role, which some user has 2 roles
Example: I dis-record for user role A
But this user has 2 roles: Role A + Role B
==> Will this user will be available hidden in visited?2) What is coded should i use to hidden someone by user_id1; user_id2?
This user has only 1 roleA, but they are specical users i would like to hidden only. Not apply for all user in this roleThanks
Hi Julia,
Can you please help me understand your question.If You need more control than settings, It is doable. we have a lot of hooks available for the same.
For example, to disable visit recording by a user, we have a hook “visitor_is_visit_recordable” that we can use.
Please let me know the details and I will assist you with the code.
Thank you
BrajeshAlso, to answer your first question
We check if the user has a role, so if a user has 2 roles and one of those role matches, It will be recordable.
Thank you
BrajeshAbout visitor_is_visit_recordable
What is complete code to disabled record for user-id1 & user-id2 please. Sorry i’m not coder.
No problem.
You can put this code/** * Disable recording for some users. These users will not appear in list from now onwards. * * @param bool $is_enabled is recording enabled. * @param int $user_id the user id we are checking for. * * @return bool */ function buddydev_custom_disable_visitor_recording( $is_enabled, $user_id ) { $disabled_user_ids = array( 1, 2 ); // add the user ids here. if ( in_array( $user_id, $disabled_user_ids ) ) { $is_enabled = false; } return $is_enabled; } add_action( 'visitor_is_visit_recordable', 'buddydev_custom_disable_visitor_recording', 10, 2 );
In your theme’s functions.php or in the bp-custom.php.
If you are uncomfortable with it, please drop me an email with ftp details and I will do it for you.
Thank you
BrajeshDo you mean i create child-theme/buddypress/bp-custom.php to add for code?
Hi Please also give me same function code used for plugin: Stealth Mode for Site admin
Thanks
Please put the above code in your child-theme/functions.php.
Also, can you please clarify this?
Hi Please also give me same function code used for plugin: Stealth Mode for Site admin
Thank you
BrajeshHi,
We also have similar record plugin basic on activity, i would like hidden it for some specical users too. ” Stealth Mode for Site admin” plugin.
So how to enable “Stealth Mode” For user-ids1, user-ids2?
Thanks
- This reply was modified 6 years, 11 months ago by smart life.
The plugin is aimed for site admins only. So if you have more than one site admin, they can use it.
Even better, do you use Profile Visibility Manager? If yes, I will suggest avoid the stealth mode and just set the user has hidden from everywhere in the visibility manager.
Regards
Brajesh
You must be logged in to reply to this topic.