Forum Replies Created
-
I’ve used the Ban Hammer plugin successfully for this in the past.
In reply to: hide members list on opening directoryYou can filter using
bp_after_has_members_parse_args. Take a look here for examples:In reply to: customizing profile-headerCan you show us the full path you have to your child theme’s member-header.php file?
It should be your-theme/buddypress/members/single/member-header.php
In reply to: Disable User to Create or Upload Media?I’m wondering if the remove_cap() method is what you need. Try adding this to functions.php. Feel free to remove it after you’ve visited the front end of your site, it just needs to be run once.
add_action( 'init', function() { $role = get_role( 'subscriber' ); $role->remove_cap( 'upload_files' ); } );You can do the same with the author and editor roles should you wish.
In reply to: BuddyPress Newsletter relaunchedThese are fantastic, Slava, keep them coming!
In reply to: Change “Name” Field to First & Last NameThere sure is: xprofile_field_after_save
Let me know if you need anything else.
In reply to: Change “Name” Field to First & Last NameThe problem with bp_core_signup_user is it’s executed during registration only. If a member decides to change their “Name” at a later date, I don’t think the corresponding WordPress fields will be updated.
In reply to: Change “Name” Field to First & Last NameThanks for the reply, so you’re saying I should rename this field to “First Name” and create a secondary field for “Last Name” ?
That’s one approach you could take.
If there is nothing special about the field, is there a hook or filter where I can replace the field entirely and map them to first / last name fields in WordPress?
I think not unfortunately. You could request one be added by opening a ticket on Trac
In reply to: Change “Name” Field to First & Last NameThere isn’t anything special about the “Name” field aside from it being required. You could treat the field as the member’s first name and set up a second field labelled “Surname”?
In reply to: Is it profile or members conditional tags?I’ve just removed
bp_is_member()from the Template Tag Reference so there’s no confusion going forward:Often you’ll also want to change the from “name”. That can be done with:
add_filter( 'wp_mail_from_name', function( $name ) { return 'Jam Session'; } );Try the wp_mail_from filter:
add_filter( 'wp_mail_from', function( $email ) { return 'admin@jamsession.dk'; } );In reply to: Problem when i upload avatar in registration page.No need to edit the core file. The
bp_attachments_current_user_canfilter can be used here.add_filter( 'bp_attachments_current_user_can', function( $can, $capability ) { if ( 'edit_avatar' !== $capability ) { return $can; } // This will let all users upload an avatar (not just logged in members). $can = true; return $can; }, 10, 2 );In reply to: Activity Custom Content After Post IterationHow do I do that on the server side?
You’d use the modulo operator, like in my example above.
Did this work for you?
In reply to: Activity Custom Content After Post IterationAh, the “load more”. I forgot about that. In order to load your items (and activities) you’ll need to make an ajax request. In your server side processing script you can use the modulo operator to insert your items at every 5th iteration.
In reply to: Activity Custom Content After Post IterationI’ve used Pastebin because there’s quite a lot of code to paste here. Notice my amendments on lines 34, 36, 37, 38 and 58.
Let me know if it works for you.
In reply to: Activity Custom Content After Post IterationYou’ll need to replace
// Loop startand// Loop endwith your actual loop. If you want to paste your loop here I’ll try to take a lookIn reply to: Activity Custom Content After Post IterationYou can use the modulo arithmetic operator. Here’s an example:
$counter = 1; // Loop start if ( 0 === $counter % 5 ) { // Do something here. } $counter++ // Loop endIn reply to: Static page to DynamicYou use
bp_core_new_nav_item(). See this article for more info:In reply to: Buddypress Technical IssuesTry doing the same thing using a different theme to see if your theme is causing the issue.
It just feels like that should be part of a passed or available object rather than the raw $_POST so it’s gone through any form validations
At the point
bp_signup_validateexecutes we’re still very early on in the process (still validating the data). Setting object properties or saving to the database only happens after the validation checks.The $_POST variable should have what you need.
In reply to: Changing the groups slugThe BP Edit Group Slug plugin has been updated to work with BP 2.8. See this Tavern post for details:
BuddyPress Core Contributors Working on a Way to Safely Edit a Group’s Permalink
In reply to: Trying to get property of non-object@danbp Thanks for pointing that out, I’ll keep it in mind. My only thought is how do we know this issue is PHP 7 specific? To me it looks unrelated to PHP version.
In reply to: Trying to get property of non-object@airathalitov instead of commenting on an existing issue, this is probably worthy of opening a new ticket.