Forum Replies Created
-
In reply to: Comments not showing on Activity Stream
Thanks @benjiswart for posting the solution you found!
It wouldn’t be wise to edit the
wp_usertable. You could store the info in the user meta table, or better yet use BuddyPress member types: https://codex.buddypress.org/developer/member-types/In reply to: Programmatically create xprofile fieldHi @ibes-
You can get the profile field groups and fields by using the function:
$groups = bp_xprofile_get_groups( array( 'fetch_fields' => true ) );With this information, you should be able to determine whether a field exists and what its ID is.
Best,
-David
In reply to: Shortcode question [bp_profile_url]Also, if you’re trying to link to the user’s own profile, don’t forget about the utility url:
If the user isn’t logged in, it’ll pass them through the registration form to get there.
In reply to: How to restrict group creation to certain usersActually your code will work either way (no matter what the restrict group creation checkbox is set to). Your function must not be “seen” by WP. Is it in bp-custom.php or in your theme’s functions.php file?
In reply to: How to restrict group creation to certain usersIf you uncheck “allow group creation for all users” only site admins will be able to make groups.
In reply to: How to restrict group creation to certain usersHi @auctionarmory-
That looks promising! The only way you can know if it “works” is by trying it in your environment. Create a couple of test users, one who’s got the somewhat elevated role of “vendor” and one who’s just a subscriber. Then try it when logged in as your test users. If your vendor can do create groups, but your subscriber can’t (and your admin still can) you’ve nailed it!
Good luck!
In reply to: How to restrict group creation to certain usersSee above for a list of user capabilities by role:
2) Choose the users that you want to enable (to create groups). Get the list of WP capabilities for each of them from here (or use a role/capability editing plugin):
https://codex.wordpress.org/Roles_and_Capabilities
Choose one capability which is only shared by those users that will have the ability to create groups.
No, there is not currently a way to make a group “pending” though that’s will be possible as a result of something I’m working on.
In reply to: Messages not all showing.Since you’re using BuddyBoss theme (I think) I’d probably ask them first, because the template that loads the message loop is provided by the theme.
That’s a weird problem, though!
In reply to: Registration processThe best advice I can offer is to make the registration page as simple as can be, and then ask for more info later, once the user is registered. If the registration page is hard, the user has to _really_ want to join to go through with it.
In reply to: Restrict users seeing other users based on fieldsYou might also approach this with member types: https://codex.buddypress.org/developer/member-types/
In reply to: Forgotten Password#2 can also happen if the user’s email client has stripped out some of the needed query arg parameters. Outlook has been known to strip the query arg
?key=for instance.In reply to: How to restrict group creation to certain usersI generally stick to using capabilities. So I’d find a capability that all of the roles you want to be able to create groups have. Then the code looks like:
add_filter( 'bp_user_can_create_groups', function( $can_create ) { $can_create = false; if ( current_user_can( 'known_capability' ) ) { $can_create = true; } return $can_create; } );If you want to wrestle with the confusion of roles, this might work:
add_filter( 'bp_user_can_create_groups', function( $can_create ) { $can_create = false; $user = wp_get_current_user(); if ( in_array( 'administrator', (array) $user->roles ) || in_array( 'my_custom_role_name', (array) $user->roles ) ) { $can_create = true; } return $can_create; } );In reply to: remove the cropping functionThe blurriness is a result of the image being cropped to smaller than the size needed to display it, or starting with an image that is too small to begin with. I’m afraid that disabling the cropping functionality wouldn’t completely solve your problem. The cropping tool does show a preview of the resulting image, so in any case, your users shouldn’t be surprised that the result is blurry–they can see the result before accepting the crop. 🙂
In reply to: BuddyPress ModeratorI’ve been using this plugin, which is an updated version of that old one: https://github.com/hwdsbcommons/BP-Moderation
It works well and the repository owner is open to accepting pull requests.
In reply to: Adding new field to user registration form.Hi @teljkon-
I don’t understand your points 2 and 3, but 1 can be solved easily: https://codex.buddypress.org/administrator-guide/extended-profiles/
Fields in the “Primary (Base)” profile field group are added to the registration form.
In reply to: Update URL on “Register”Good job solving your issue. 🙂
In reply to: Can view profile on desktop, but not on mobilePlease share how you solved the issue, so that other forum users can learn from your experience.
Thanks!
In reply to: Why can you crop the cover image?Cover images work best when the original image is large enough. You can disable cover images for groups and/or members at wp-admin > settings > buddypress > options:
• Group Settings > Allow customizable cover images for groups
• Profile Settings > Allow registered members to upload cover imagesIn reply to: Embed GroupsI don’t know of a shortcode for listing out groups. However, you could use the code in
buddypress/bp-templates/bp-legacy/buddypress/groups/groups-loop.phpas a starter. The loop is powered bybp_has_groups()which is template loop like the WordPress posts loop. You could add a template to your child theme, likepage-group-list.phpand copy that groups loop into it and start tinkering. you can read more about the parameters you can pass intobp_has_groups()here: https://buddypress.trac.wordpress.org/browser/branches/2.9/src/bp-groups/bp-groups-template.php#L290I do want to make sure that you know there’s a group directory built by default, right?
In reply to: Activity Feed showing items twiceHuh. I can’t replicate this behavior. You’ll need to share more info about your site environment (plugins, versions, theme).
On my several BP sites, nested commenting is working as expected, so I expect that it’s a combination of tools you’re using.
In reply to: How to Insert @username in activity comment replies.I’m not sure I’m understanding what you’re trying to do. Can you share an image or similar showing the desired result?
In reply to: version 2.9.5 for bug fixes!?Hello, not sure about the timing of a 2.9.4 release. Also unaware of a bug with the number of friends not matching the indicator bubble. If you can verify that there is a bug, please open a trac ticket: https://buddypress.trac.wordpress.org/
Thanks!
In reply to: Noindex tagThere’s a function to tell when you’re on a BP page
is_buddypress()so this is a guess at how you could do it:add_action( 'wp_head', function() { if ( is_buddypress() ) { echo '<meta name="robots" content="noindex">'; } });In reply to: Can view profile on desktop, but not on mobileTry using a more vanilla theme to test this out, like twentyseventeen. I suspect the problem is the theme you’re using.