Forum Replies Created
-
In reply to: Limit activity in groups to admin/mods only
Found the solution with the following code:
Restrict in single group
function restrict_activity_posting_for_specific_group( $can_post, $user_id, $group_id ) { // The ID of the group you want to restrict posting in (replace with the actual group ID) $restricted_group_id = 123; // Example group ID // Only apply the restriction to the specific group if ( $group_id == $restricted_group_id ) { // Check if the user is an admin or moderator if ( !bp_group_is_admin( $user_id, $group_id ) && !bp_group_is_mod( $user_id, $group_id ) ) { return false; // Don't allow posting } } // If not the restricted group, or the user is admin/mod, allow posting return $can_post; } add_filter( 'bp_activity_can_post', 'restrict_activity_posting_for_specific_group', 10, 3 );Restrict in multiple groups
function restrict_activity_posting_for_specific_groups( $can_post, $user_id, $group_id ) { // The IDs of the groups you want to restrict posting in (replace with actual group IDs) $restricted_group_ids = array( 123, 456, 789 ); // Example group IDs // Check if the group ID is in the restricted group IDs array if ( in_array( $group_id, $restricted_group_ids ) ) { // Only apply the restriction if the user is not an admin or moderator if ( !bp_group_is_admin( $user_id, $group_id ) && !bp_group_is_mod( $user_id, $group_id ) ) { return false; // Don't allow posting } } // If not in the restricted groups or the user is an admin/mod, allow posting return $can_post; } add_filter( 'bp_activity_can_post', 'restrict_activity_posting_for_specific_groups', 10, 3 );In reply to: Limit activity in groups to admin/mods onlyUnfortunately this plugin breaks the “groups” settings from backend and comes up with a critical error, so if anyone has a solution, please let me know. π
In reply to: After WordPress 6.7 release, buddypress failsSounds like compatibility issue within the theme then. Have you tried it with a BuddyPress supported theme?
In reply to: After WordPress 6.7 release, buddypress failsYou can add users from back-end, yes.. but the users still need to “activate” their account and login for them to show up on the front-end (in directory).
Does the member show up in the normal member directory? – and is the issue only with the “alphabetical search”? .. My alphabetical search works fine, so might be a theme compatibility issue.
Have you cleared both server and browser cache?
In reply to: Limit activity in groups to admin/mods onlyFound plugin that does the job:
In reply to: After WordPress 6.7 release, buddypress failsTry download this plugin – and switch to the user you created (can also be done from backend) – and “login” with that user. Normally users show up, when they have logged in after registration.
Maybe that works. π
In reply to: After WordPress 6.7 release, buddypress failsPlease do me a favor, go to your latest buddypress and wordpress version and try to use the userlist/friendlist, I am 1000% sure you are having the same issues.
Sorry, but works fine for me – even with latest update to BuddyPress Version 14.2.1.
I even run a pretty complex site with a lot of software that needs to be compatible – including custom code setups and so on. Still works π
In reply to: After WordPress 6.7 release, buddypress failsHello again π
The user you’re setting up, is this a legit setup with a mail (where you can activate the account)?. If not, then maybe give this a try. Normally users must activate their accounts from a mail they receive upon registration before they’re visible on the directory.
Also, what settings have you setup under the following:
Settings > BuddyPress > OptionsThis might make it easier for me to see if anything in there is the culprit. π
In reply to: After WordPress 6.7 release, buddypress failsDoes sound like there is a conflict somewhere – no snippet codes enabled while troubleshooting?
Could you provvide screenshots of what it looks like on your end? πIn reply to: After WordPress 6.7 release, buddypress failsHello @forinn
Works fine for me, so sounds like a third-party conflict or maybe an issue within your theme.
Have you tried troubleshooting the issues? (Cleared cache, tested compatibility within plugins and so on?)
In reply to: BuddyPress Group – Load Newest Activity (Bug)Hello @emaralive
Thank you for the update. Sounds exciting – I’m looking forward for the new release when it’s ready. In the meantime I just made the “Load More” button hidden on my site. π
Please keep me updated. Thank you! π
In reply to: Exclude Site Role From Member DirectoryFigured it out (I’m stupid lol).
I can confirm that the snippet from Brajesh Singh still works. Just make sure to place it into your bp-custom.php (/wp-content/plugins/bp-custom.php). Turns out my role wasn’t called “Basic” (as shown/named within the backend). Since I use Paid Membership Pro it used pmpro_role_1 set by PMP.
Remember to change the role within the code down below to the one you want to exclude. π
Credit: https://buddydev.com/hiding-users-on-buddypress-based-site/
/** * Exclude Users from BuddyPress Members List by WordPress role. * * @param array $args args. * * @return array */ function buddydev_exclude_users_by_role( $args ) { // do not exclude in admin. if ( is_admin() && ! defined( 'DOING_AJAX' ) ) { return $args; } $excluded = isset( $args['exclude'] ) ? $args['exclude'] : array(); if ( ! is_array( $excluded ) ) { $excluded = explode( ',', $excluded ); } $role = 'administrator';// change to the role to be excluded. $user_ids = get_users( array( 'role' => $role, 'fields' => 'ID' ) ); $excluded = array_merge( $excluded, $user_ids ); $args['exclude'] = $excluded; return $args; } add_filter( 'bp_after_has_members_parse_args', 'buddydev_exclude_users_by_role' );In reply to: Hyerarchical groups for BPThank you for this plugin @dcavins!
Didn’t know someone took the time to update the old “BP Group Hierarchy” plugin by David Dean.
Can confirm it works for me with the following setup:
WordPress - Version 6.6.2 BuddyPress - Version 14.2.1 Template Pack - LegacyThe only minor issue I’m having is that my theme doesnβt support the setting:
Replace the flat groups directory with a hierarchical directory.This makes sense though and isn’t necessary.
Thank you for updating this. π
In reply to: BuddyPress Group – Load Newest Activity (Bug)Any update on this @imath? π
In reply to: Apply user roles upon registrationJust setup a quick test on a dummy site and it seems like PMP and WPJM works fine together. π
In reply to: Apply user roles upon registrationI’m pretty sure you can set either of the roles made by WPJM when using PMP.
I use PMP to set specific roles and permissions within these roles for my members.
Eg. Coach, Support, Business and so on… And then assign the roles when needed upon signup.You just must choose within PMP the roles that WPJM made itself (if they are legit roles recognized by WordPress – and they should be).
Snippet code has its own pros/cons if you ask me.
How do you plan on controlling this with a function – without making it super complex?
How would it know when to assign what role – depending on your needs?I would personally just use PMP – easy to use and setup lol..
Hope you find a solution that works for you! π
In reply to: Groups and rtMedia IssueMakes sense, have you checked that your BuddyPress URLs are correct?
Settings > BuddyPress > URLs
Maybe there is a setting in there missing or something; maybe under User Groups or Gallery. :/
I personally swicthed to MediaPress since I had other third plugins like Anonymous Posting, Privacy Settings and so on that were too important – and rtMedia wasn’t compatible with them.
Also rtMedia seems to be a pain in the *** when it comes to being compatible with anything and it always seems to be causing issues.
I’m sure it would be pretty fast to move images if you used FTP to do so.
/uploads/mediapress/members/MEMBER-ID/GALLERY-ID/IMAGE-URLIt’s not easy to help other troubleshoot issues unless you’re backend testing settings for yourself, so it’s hard to guess what the problem might be.
I never had issues with the permalinks when using rtMedia though. π
In reply to: Can’t change profile visibilityNot sure if I got the option because of third party plugin I’ve got installed.
But you should be able to change this as a setting under Users > Profile Fields.
Normally you can set the different visibility settings in there, but “Name/Username” is normally fixed and can’t be changed from what I know.
In reply to: Apply user roles upon registrationHave you checked if the WPJM is compatible with a plugin like PMP? – Might be an easier way for you to control permissions based on user roles.
In reply to: Groups and rtMedia IssueHave you cleared all cache (both server/site and browser)?
Sounds to me like compatibility issue between plugins.I no longer use rtMedia myself due too way to many conflicts with pretty much every third party plugin.
In reply to: BuddyPress Global Search Vulnerability issueHello @varunkamani
I already gave you a few options to choose from, so in the end it’s up to you.
1. Ignore error and keep plugin
Keep the plugin and accept the fact that it comes with some issues and risks.
The risk itself is pretty low when it comes to the XSS since this is pretty common.
Like mentioned before, old and unsupported plugins do come with some risk.2. Find a different plugin
Find a different plugin that is updated that can provide you with the features you need/want.
You can search on both WordPress.Org or other sites like Google, CodeCanyon etc.https://wordpress.org/plugins/
3. Use a third party security plugin
Download and install a third party security plugin that can help prevent the XSS attacks on your site. This could be either free or paid/premium depending on your budget and needs.4. Get a developer to help you update current plugin
If you insist on keeping the BuddyPress Global Search and you want it updated to fix its current issues, you’d need to pay a developer to help you update the plugin itself. This might not be the best solution long term, and I would also assume BuddyBoss themselves would update this if they felt it was necessary. The fact that they talked about updating it for the past 3 years and now left it abandoned tells me that it’s not a priority for them.From a quick search on the forums, this topic has been up several times before for the past many years, so don’t expect an easy or “free” solution for this.
Hope it helps! π
In reply to: BuddyPress Group – Load Newest Activity (Bug)Sounds great!
Will this be rolled out as an update or how do I implement this fix on my site? π
Thank you guys for looking into this and the work you do! π
In reply to: BuddyPress Global Search Vulnerability issuePersonally I use the following (PRO version) – depends on what you want from your site and what your budget is. π
The PRO version uses Security Headers that offers XSS Protection and other cool features too.
Really Simple Security – Simple and Performant Security (formerly Really Simple SSL)
In reply to: BuddyPress Global Search Vulnerability issueIn reply to: BuddyPress Global Search Vulnerability issue@varunkamani it’s not that simple.
The vulnerability issue in this case is Cross Site Scripting (XSS).
This could allow a malicious actor to inject malicious scripts, such as redirects, advertisements, and other HTML payloads into your website which will be executed when guests visit your site.
It is a known risk in general to use outdated and unsupported plugins on any site.
In order to “fix this” the plugin itself would need to be updated to reach the security standard. You can also look online for solutions to manage this, but it might not be the only vulnerability about the plugin itself. Like mentioned – old and outdated plugins are a risk.
You could check out this link:
Cross Site ScriptingA solution could also be to use a different plugin that is updated and supported.
What theme are you using?