Forum Replies Created
-
In reply to: Auto join group based on role
If the role is set to vendor and xprofile fields are not involved, then there is a WP hook for that.
Assuming the group_id is 8, try:
function jeffery_join_vendor_group( $user_id, $role, $old_roles ) { if( $role == 'vendor' ) { groups_accept_invite( $user_id, 8 ); } } add_action( 'set_user_role', 'jeffery_join_vendor_group', 11, 3 );This should provide the general idea:
function add_category_automatically($post_ID) { global $post; $author_id = $post->post_author; $dog = xprofile_get_field_data('Dog', $author_id, $multi_format = 'comma'); if( $dog == 'poodle' ) { $cat = 9547; wp_set_object_terms($post_ID, $cat, 'category', true); } } add_action('publish_post', 'add_category_automatically');In reply to: xprofile_avatar_uploaded and bp_core_fetch_avatarThat’s a tricky one. And I don’t have a solution.
It’s probably a timing issue. The hook fires before the dir is updated.
Or maybe bp_core_fetch_avatar is cached.Which version of BP are you using?
The issue may be related to the new approach to avatar uploads using the BP_Attachments class.In reply to: Removing friend requests from the Activity FeedTo prevent new entries, try adding this to your theme functions.php
remove_action( 'bp_register_activity_actions', 'friends_register_activity_actions' );If you are logged in as an administrator, that is normal.
Create a subscriber account to see the difference.
Not sure what you mean by ‘connect’.
Even if you could connect members from different installs, managing their interactions across multiple databases would be difficult.afaik, devs use multisite so that everyone uses the same db.
There are some threads about various multisite + BP approaches, here’s one:
https://buddypress.org/support/topic/resolved-how-multiple-buddypress-sites-with-some-shared-users/In reply to: Buddypress Plugin all files inactive troubleshootingNobody can walk you thru the issue based on your description.
Maybe:
https://buddypress.org/support/topic/activity-ajax-problem-with-bp-default-theme/In reply to: Unable to update user avatar as userThe theme author is over loading the BP templates.
Sounds like the theme hasn’t been updated to work with the latest BP.
Instead of deleting the whole
[your-theme]\buddypress
Try just deleting this file:
[your-theme]\buddypress\members\single\profile\change-avatar.phpIf that doesn’t work, try deleting some more profile related files in
[your-theme]\buddypress.And tell the author about your issues.
In reply to: [Resolved] Add group redirects to 404 error!In reply to: Buddypress Plugin all files inactive troubleshootingIt sounds like ajax is not working on your site.
It can be difficult to diagnose without full access to your installation.Try switching to a standard theme like WP 2013, turn off all other plugins, make sure to refresh your browser cache.
In reply to: Auto assign new member to group upon registrationIt avoids failure and error or warning messages if
$user_idis missing.In reply to: How to Design BP?In reply to: Add custom fields (text) to MediaPress Images?Somebody who has used that plugin and done some some customization, might see this thread, but
your best bet is to ask the plugin author.In reply to: Auto assign new member to group upon registrationIf
$accounttypeis a required field in your Base group, it will not be in usermeta.Untested, but try:
function set_default_group( $user_id ) { if ( empty( $user_id ) ) return; $accounttype = xprofile_get_field_data( 'I am a', $user_id ); if ($accounttype == 'Student') groups_join_group( 1, $user_id ); else groups_join_group( 2, $user_id ); } add_action( 'bp_core_activated_user', 'set_default_group', 11, 1 );In reply to: How to show pending memberships to userYou already have the group ids.
Write a function to show a ‘delete’ button per id.
Write a function to delete that row.In reply to: Admin notificationNot sure what you mean by approval…
Use this hook, from buddypress\bp-groups\bp-groups-actions.php :
do_action( 'groups_group_create_complete', $bp->groups->new_group_id );And write a function that sends an email.
In reply to: Buddypress MessagingSince the issue is in your theme, your best bet is to ask the theme author.
In reply to: How to show pending memberships to userafaik, there is no BP function for that.
You could gather all the group ids like so:function get_all_group_membership_requests( $user_id ) { global $wpdb; $bp = buddypress(); return $wpdb->get_col( $wpdb->prepare( "SELECT group_id FROM {$bp->groups->table_name_members} WHERE user_id = %d AND is_confirmed = 0 AND inviter_id = 0", $user_id ) ); }Use:
$pending_group_ids = get_all_group_membership_requests( bp_loggedin_user_id() );Works for me. Thanks @r-a-y.
You’re talking about the value of
$thisin the filter call inclass BP_Legacy extends BP_Theme_Compat?
add_filter( 'bp_get_activity_action_pre_meta', array( $this, 'secondary_avatars' ), 10, 2 );Good question.
And I’d be interested in the answer.There must be a simple way to disable secondary avatars…
You might want to ask about this on Slack.Meanwhile, this works, not very efficient ‘tho.
Hook is inbp-activity\bp-activity-template.phpfunction remove_secondary_avatar( $item_id ){ $item_id = ''; return $item_id; } add_filter( 'bp_get_activity_secondary_avatar_item_id', 'remove_secondary_avatar' );And this works, but I don’t know why :<
function remove_activity_secondary_avatars( $action, $activity ) { if ( $activity->component = NULL ) { // don't do anything } return $action; } add_filter( 'bp_get_activity_action_pre_meta', 'remove_activity_secondary_avatars', 10, 2 );In reply to: Buddypress MessagingPlease use the
codetag. Edited to remove full path.What versions of WP and BP are you using?
Have you tried switching to a theme like WP 2013 to confirm that the issue is not in your theme?
In reply to: How to update Activation linkI never suggested you remove the ‘old’ folder.
You mean this folder?
buddypress\bp-templates\bp-legacy\buddypress\members\activate.php
If so, no.
And re-read the whole codex page so that you understand what a template overload is.In reply to: How to update Activation linkYou might want to google
printfso that you understand what%sdoes.You can do this:
printf( __( 'Your account was activated successfully! You can now <a href="%s">log in</a> with the username and password you provided when you signed up.', 'buddypress' ), 'http://mydomain.com/my-account/' ); ?>You can also replace the printf with:
echo 'Your account was activated successfully! You can now <a href="http://mydomain.com/my-account/>log in</a> with the username and password you provided when you signed up.';In reply to: Remove BP profile link in BBPressWhy are you using BuddyPress if you use Ultimate Member ?
Have you considered turning off the xprofile component in BP?
You might want to ask on bbPress forums about how to filter the author links in forums.
afaik, The ‘Upload Image’ is not part of BuddyPress.
So it is in your theme or some other plugin.