Forum Replies Created
-
In reply to: BP API Access
Hi @barkins – Unfortunately, BuddyPress doesn’t yet have a full set of CRUD endpoints for BP objects. The team is working on it, and we hope to start rolling out endpoints in the near future. BP-REST is the repo to follow for that.
BP will work fine with the default WP REST API, if all you want to do is access a list of users. However, WP’s user endpoint won’t include any BP data, and you won’t be able to modify/add user data via this endpoint. That said, if your needs are fairly narrow, you can definitely write your own custom endpoint for fetching/updating BP profile data – it’s likely to be much simpler than what’d be required in BP itself, if your needs are pretty specific. Here’s some docs: https://developer.wordpress.org/rest-api/extending-the-rest-api/adding-custom-endpoints/
@shanebp is correct that you’ll need to choose a hook where the user ID is made available.
Unfortunately, ‘bp_core_signup_user’ may be too early. On some setups (specifically, most Multisite configs) no user has yet been created at ‘bp_core_signup_user’ – only a signup object. The earliest point when you can be confident that a WP user object exists is ‘bp_core_activated_user’.
Hi @julienbr – Sorry you are having problems with this. Invite Anyone should use the same mechanism for sending emails as WP itself uses, so the first thing I’d check is whether WP emails are being sent. For example, do you get an email when you initiate a password reset?
If the problem seems specific to Invite Anyone, you should check to see whether the invitations are being created at all. After sending an invitation, you should be able to see it in the Invites Sent subtab of Send Invites on your profile. If the invites are not there, then the problem is not mail itself, it’s some other bug in Invite Anyone.
If the problem is really at the level of the SMTP setup, then the only thing I can think of is that your SMTP provider is blocking outgoing email because of the content of the message. This could happen because you’re sending to too many people in a single blast, or perhaps because of certain keywords in the email content. Check with your SMTP service to see whether there are any notices to this effect.
In reply to: Choosing activity stream informationYes, this can be done in code. You’ll need two filters. One removes the unwanted items from the dropdown on the activity page, and the other removes them from the activity stream itself.
add_filter( 'bp_get_activity_show_filters_options', function( $filters ) { unset( $filters['friendship_accepted,friendship_created'] ); unset( $filters['new_blog_post'] ); unset( $filters['new_blog_comment'] ); return $filters; } ); add_filter( 'bp_before_has_activities_parse_args', function( $args ) { $filter_query = array( array( 'column' => 'type', 'value' => array( 'friendship_accepted', 'friendship_created', 'new_blog_post', 'new_blog_comment' ), 'compare' => 'NOT IN', ), ); $args['filter_query'] = $filter_query; return $args; } );In reply to: change profile fields to something elseThe easiest way to customize things like this is by creating a child theme and overriding the template – in this case,
members/register.php. See https://codex.buddypress.org/themes/theme-compatibility-1-7/a-quick-look-at-1-7-theme-compatibility/#child-themes for some information on getting started with child themes.In reply to: Cover Photo IssuesAnother thing to check is whether regular avatar uploads are working. The two features use basically the same mechanism.
Cover image/avatar uploads sometimes run into trouble due to asset offloading, such as plugins that push uploaded assets to Amazon S3 or a CDN. Are you using anything like this?
In reply to: Need an extra sidebarThe code you’ve given does a check against the logged-in and displayed user. Remove the
ifandendiflines, and it should show for all members.For more information on how to modify your theme to show a left sidebar, you’ll want to reach out to the theme author.
In reply to: Problem in mobile appearance with the toolbar lineVery odd – it appears that this too is caused by your theme, as BuddyPress itself just inherits the mobile styling of the toolbar from WordPress (and the WP toolbar looks fine, as shown by your Dashboard screenshot). Try reaching out to the theme author to see whether they’re able to identify the problem.
In reply to: Where’s the bbpress-Forum?Hi @nikelaos – The bbPress forums are here: https://bbpress.org/forums/
I’m unsure how or whether bbPress allows custom language overrides, so I would suggest asking there. Thanks and good luck!
In reply to: Profile buttons not working (fixed)Excellent! Good luck as you continue to work on your site.
In reply to: Profile buttons not working (fixed)@louisarthur – Thanks for sending me credentials. I’ve logged into your site to have a look.
As you note in your email, there’s no
hrefattribute on these links. It’s not clear to me how this would be the case, but I can give you a starting point for looking into it yourself. Briefly, the buttons will be built without anhrefif the button constructing function passes an emptylink_hrefparameter to theBP_Buttonclass. The functions used in the two cases are different:Message public: https://buddypress.trac.wordpress.org/browser/tags/2.9.2/src/bp-activity/bp-activity-template.php?marks=3090#L3079
Message privé: https://buddypress.trac.wordpress.org/browser/tags/2.9.2/src/bp-messages/bp-messages-template.php?marks=1362#L1360
The logic in each case is different, but since neither is showing up, I’m guessing that one of two things is happening:
1. One of the conditional checks shared between them is failing for some reason:
bp_is_my_profile(),is_user_logged_in().2. Something on your installation – perhaps your theme but probably a plugin (since you said Twenty Seventeen was exhibiting the problem as well) – is filtering both ‘bp_get_send_private_message_link’ and ‘bp_get_send_public_message_link’, and then incorrect returning empty strings.
To test idea #2, you might try – if you can – searching through your codebase for those filter names.
I don’t believe that BuddyPress itself could be configured to do anything like this.
Are you using any other plugins that might perform redirects, or restrict access to content?
What’s your setting at Dashboard > Settings > Reading “Your Homepage displays”? I wonder if there’s something funny happening there.
In reply to: Profile Image Widget QuestionThanks, @Julia_B! Please do follow up when the Avada folks have had a chance to look at your issue. If BP is doing something wrong, we’d like to know about it, and your experience could be a useful resource for others in the future 🙂
In reply to: Lightbox plugins not working on profile avatars?Profile avatar markup is generally pretty different from the markup used for the content of posts and pages. It’s likely that the plugins are written in such a way that they don’t recognize avatars as the kinds of images that ought to be expandable.
Can you share links to one or two of the plugins you’ve tried? They all work a bit differently, but looking at one might give us a hint of how they can be extended to recognize BP avatars. It’s likely that it’s just a line or two of code to customize it in such a way.
In reply to: Profile buttons not working (fixed)> Could it be a problem in the generate button link function ?
It’s possible, but it’s definitely not a problem with BP in the most general sense. I’m looking right now at an installation that is running Twenty Seventeen, and the buttons in question are clickable. It *could* be that you have another plugin that is somehow modifying the markup so as to make the buttons unclickable. Here’s what the markup for these buttons should look like (this specific example is the ‘Public Message’ button, but they are all similar):
<a href="http://example.com/activity/?r=username&_wpnonce=97df4e3389" class="activity-button mention">Public Message</a>Does yours look similar to this? If not, then there must be a plugin or some JS interfering.
If possible, you could send me login credentials (my buddypress.org username @ gmail.com) so that I could see from a logged-in user’s point of view.
In reply to: Different sidebars for groupsHi @hlubi – Generally, the sidebar is controlled by the WP theme you’re using. See sidebar.php. You’ll likely need to make your modifications in that file (probably in a child theme, if you’re not already using one).
Exactly what modifications you make depends heavily on how you want the sidebars to differ. If you have a small number of groups, and you want the sidebar to be totally customized for each one, sidebar.php might look something like this:
if ( bp_is_group() ) { $group_id = bp_get_current_group_id(); switch ( $group_id ) { case 1 : // group 1 sidebar break; case 2 : // group 2 sidebar break; } } else { // existing sidebar code }You could even register separate sidebars for each group, so that they can be managed separately in wp-admin. (This solution obviously won’t work well if you have lots and lots of groups.)
If you just want to have some group-specific content in the sidebar, you can use BP’s “current group” functions in sidebar.php. For example:
if ( bp_is_group() ) { $current_group = groups_get_current_group(); printf( 'This is the sidebar for group %s', esc_html( $current_group->name ) ); }This way, you’d have the same *type* of data on each group’s sidebar, but the specific data would be pulled dynamically based on which group is being shown.
@willallen83 You’re welcome! Please feel free to report back here – or update the codex page – once you’ve got updated instructions. Good luck!
@852cmd Hm, that string – ‘Error! Please upload Profile Picture’ – doesn’t come from BuddyPress. This should be your clue: whatever code is generating that string is probably also doing the blocking itself. Try searching your codebase – including your theme – for this error message.
In reply to: Profile buttons not working (fixed)When you say “impossible to select”, exactly what does it mean? When you hover over the buttons, does your cursor change (to a hand, for example), or do you see a color change? If not, this could be a CSS issue that’s causing them to appear behind some other element, and thus making them unclickable.
From the screenshot you’ve shared, I don’t see any indication that these buttons are failing for a reason related to a JS error. The Mixed Content warning shouldn’t affect it.
The thing about these buttons is that they are not supposed to be JS-powered. They’re regular links. So if it’s impossible to click them, it’s likely that they’re being somehow obscured in the markup.
If you’re fetching user data – like First Name and Last Name – from an external provider like LinkedIn, then you can use that data to concatenate a value for BP’s Name field. This could be done in JS (Name would perhaps be a hidden field, and filled in after the connection had been made to the LinkedIn API). Or it could happen on the server, based on data passed from LinkedIn, in which case you’d have to interfere with the way that BP’s validation works so that Name isn’t required to create an account (see
bp_core_validate_user_signup()). But you’ll always want to be sure that Name is filled in, whether before or after the account is created, because BP uses this value throughout the site to populate navigation, headers, title elements, etc.You can perform an action on the first user login using the ‘bp_first_activity_for_member’ hook.
Hi @willallen83 – I’m afraid I haven’t integrated with s2member in many years, so I can’t provide exact advice. But briefly, it appears that the code above is meant to sync the
$s2member_fieldsfields – which I assume are defined somewhere in s2member – to the corresponding members of the$xprofile_fieldsarray. The latter fields are created in Dashboard > Users > Profile fields; make sure the names (like ‘Last Name’) match exactly, or the lookup will fail.Note also that it may be more reliable to fetch user info from the values passed by the ‘wp_login’ hook to the function. So something like this:
function s2_profile_field_update( $user_login, $user ) { //Array of xprofile field names $xprofile_fields = array('Last Name','Country','Introduce yourself to Aisha Salem'); //Array of s2member field slugs $s2member_fields = array('last_name','user_country','member_letter_aisha'); //Populates BP with S2 info get_currentuserinfo(); // if( current_user_is("s2member_level1") ) { for($i = 0; $i < sizeof($xprofile_fields); $i++) { if(xprofile_get_field_data($xprofile_fields[i], $user->id) == '' && get_user_field($s2member_fields[i]) != '' ) { xprofile_set_field_data($xprofile_fields[i], $user->id, get_user_field($s2member_fields[i]) ); } } // } }Note that, according to this code, it’ll only update the BP xprofile fields if they’re empty. You’ll have to remove that check if you always want s2member values to take precedence.
Beyond this, your best bet for figuring out why this is not working is to place some debug statements at various points. Use
error_log()or good old-fashionedvar_dump()to make sure (a) the function is actually firing at ‘wp_login’, (b) the xprofile field values are actually being fetched properly, (c) theget_user_field()function is fetching data properly, and from the correct user https://s2member.com/kb-article/user-custom-fields-via-php-code/#toc-460a2dd2, etc.In reply to: Buddypress does not work right anymoreTo follow up on @shanebp’s advice: It sounds like you’re experiencing problems with AJAX requests. AJAX requests are sent to wp-admin/admin-ajax.php, so your IP-based whitelist must exclude this URL. If your whitelist is built in PHP, something along the lines of the advice above will work. If it’s built in Apache or at the webserver level, be sure to exclude wp-admin/admin-ajax.php.
In reply to: How to turn off Mentions notifications?Hi @ikipac – Do you mean you want to turn them off here on BuddyPress.org? Or on your specific BuddyPress installation? And by ‘notifications’ do you mean the email notifications, or the messages shown under the blue number near the top-right of the screen?
Email preferences are on the Settings panel of a BP profile. Here on buddypress.org, that’s at https://buddypress.org/members/ikipac/settings/notifications/
The screen notifications (behind the blue number) can be turned off on your own BP installation by disabling the Notifications component (Dashboard > Settings > BuddyPress). It’s not possible to disable this feature on your buddypress.org account.
In reply to: Help NeededHi @chhayaparikh1963 – Thanks for the post!
I agree that the ability to post from the front end would be a good improvement for BuddyPress. It’s a bit complex to think about how it might be developed for BP itself, since it’s likely that many BP sites will want the feature implemented in different ways: limiting permissions to specific kinds of users, linking groups to sites within a multisite network, specific taxonomies for posts created from particular front-end contexts, etc. That being said, it’s something that’s long been on the radar of the BP development team. A recent ticket that outlines the issue is https://buddypress.trac.wordpress.org/ticket/6736
In the meantime, I know you said you have checked out all the third-party plugins, but I will say informally that I’ve had pretty good luck with BuddyForms. https://themekraft.com/buddyforms/
In reply to: Problem in mobile appearance with the toolbar lineHello @xkotos – Thanks for the post!
I’m afraid it’s a bit difficult to debug this, as users here do not have login credentials for your site.
In any case, it sounds like this is probably an issue with your theme. It appears that you’re running the maxmuseum theme from Themeforest. I suggest reaching out to theme support, as they’re more likely to be able to identify and fix the issue.
Good luck!