20

For an author's profile link, use bp_core_get_user_domain( $user_id ) to get the URL, and bp_core_get_userlink( $user_id ) to get an HTML link element, including display name. For the xprofile data, use xprofile_get_field_data( $field, $user_id ) $field can be either the name of the field (like 'Biography') or the numerical field id.


11

This is how I would update a field named 'Address': function updateAddress() { global $current_user; get_currentuserinfo(); $newAddress = '123 New Street'; xprofile_set_field_data('Address', $current_user->id, $newAddress); }


9

This is one of the things you won't find in the docs, but only in the source. The source code contains only one usage of this variable. This is in bp-xprofile-template.php line 493. // First, check to see whether the user-entered value matches if ( in_array( $allowed_options, (array) $option_values ) ) { $...


7

You will want to use the $wpdb class to execute a query for users with a certain x-profile field value. I'm no MySQL expert, so someone else likely has a better way to write this query (if you do, please share it and I'll update my code), but here's one approach to it. This approach assumes you know the ID of the the BuddyPress profile field you are ...


6

Since the asker really doesn’t want to post the answer … someone has to do it: SELECT wp_users.ID , wp_users.user_email FROM wp_users LEFT JOIN wp_bp_xprofile_data ON wp_bp_xprofile_data.user_id = wp_users.ID, WHERE wp_bp_xprofile_data.field_id = 8 AND wp_bp_xprofile_data.value = 'yes' field_id = 8 being the Field you want to get (in my ...


5

This will give you the user-specific profile URL: <? echo bp_loggedin_user_domain(); ?> If you'd the link to go to the user's Messages page, just add to the end like so: <? echo bp_loggedin_user_domain().'messages/'; ?>


5

Use wp_redirect() and admin_url() to redirect the user to his profile page if the custom buddypress user meta data isn't completely filled. From another answer, I've seen that there's the following function: bp_get_profile_field_data(). So you can easily build a template tag, that gives you either the full buddy user meta data set, or simply a FALSE back. ...


5

When we post an empty anonymous reply, we get the following errors: The part of BBPress that's responsible for handling this, is the bbp_new_reply_handler() function, in the file /bbpress/includes/replies/functions.php. It contains these lines that are of interest to us: // User is anonymous if ( bbp_is_anonymous() ) { // Filter ...


5

I am not sure why your query is returning more IDs than necessary. The $args for get_users look correct. By default get_users does not support orderby=rand, but you can overwrite that option. See below: function random_user_query( &$query ) { $query->query_orderby = "ORDER BY RAND()"; } // Usage: [random_users how_many = 3] add_shortcode( '...


4

i've been working with buddypress for more than year and half. i'll start with the most significant weakness i had to deal with - spammers and splogs. this is a problem you'll have to face as long as your registration form is open for everyone. i haven't found any working free plugin that can actually help you with it. you can, if you wish, pay for anti-...


4

I think the question is: What do want to accomplish? For a subset of features e.g. an activity stream for your Wordpress Network it works fine in my experience. If you want a full-blown social network, with messaging, events, groups, blogs, forums all working neatly together better invest a good amount of time. Some caveats I've encountered: Lack of ...


4

and here is the almighty output for buddypress 1.5.2! bp_activity_setup_globals bp_activity_setup_nav bp_activity_directory_activity_setup bp_activity_screen_my_activity bp_activity_screen_friends bp_activity_screen_groups bp_activity_screen_favorites bp_activity_screen_mentions bp_activity_screen_notification_settings bp_register_activity_actions ...


4

[Edit - My original answer will only work in the upcoming BP 1.6] Versions of BuddyPress from 1.6 onwards function bbg_change_group_default_extension( $default ) { return 'forum'; } add_filter( 'bp_groups_default_extension', 'bbg_change_group_default_extension' ); Versions of BuddyPress prior to 1.6 For the moment, you'll have to use something like ...


4

BuddyPress is compatible with a WordPress Multisite setup. There are several different ways to set it up. By default, BuddyPress data is stored in a networkwide way. Generally, that means that, within the network of sites, only one site is dedicated to BuddyPress features/content - you might think of this as the "community" site within a larger network of ...


4

As th @kaiser's comment "Btw: A quick search on Google brought this plugin by Themekraft. – kaiser Jul 25 at 14:30" I bought this PLUGIN WooCommerce – BuddyPress Integration: Your Social Network Shop Its working well and fulfills my need Thanks to @kaiser.


4

Maybe you need this: bp_displayed_user_id(). Also see playing with the user’s ID in different contexts in BuddyPress documentation.


4

I found this: Exclude Users from Members directory on a BuddyPress based social network We will need to hook to 'bp_ajax_querystring' filter. The following code will allow to exclude the users from the members directory. They will be still listed in the friends list of other users with whom they are friends with. add_action('bp_ajax_querystring'...


4

Try this function: function get_user_role($user_id){ global $wpdb; $user = get_userdata( $user_id ); $capabilities = $user->{$wpdb->prefix . 'capabilities'}; if ( !isset( $wp_roles ) ){ $wp_roles = new WP_Roles(); } foreach ( $wp_roles->role_names as $role => $name ) { if ( array_key_exists( $role, $...


4

I have created a function to get user role from userid. function get_user_role( $user_id ){ $user_data = get_userdata( $user_id ); if(!empty( $user_data->roles )) return $user_data->roles[0]; return false; } call get_user_role() function to get the role of the user and pass the userid as parameter. It will return user role else will ...


4

I'm from the team that developes BuddyPress Media. Till now, capturing a video involved expensive (in various ways) setups. It depended on flash and silverlight which could reach the hardware (mic and webcam) . Html5 is the way to go, now. However, the support isn't wide enough. This might help you: https://stackoverflow.com/questions/7386675/video-capture-...


4

How to create a new tab in the Buddypress profile link with user posts? 1) create a folder /buddypress/ under your theme directory 2) create bp-custom.php file in the directory. Now your theme folder has a structure --> your Theme Directory/buddypress/bp-custom.php 2.1 Include bp-custom.php file in your theme function.php using include or ...


4

Use the filter hook bp_members_signup_error_message Try: function signup_error_change( $error_message ) { $error_message = str_replace('<div class="error">', '<span class="val-error">', $error_message); $error_message = str_replace('</div>', '</span>', $error_message); return $error_message; } add_filter('...


3

if you put this action you will get the new user_id that wordpress provide when new user register add_action("bp_core_activated_user","bp_autologin_on_activation",40,3); function bp_autologin_on_activation($user_id,$key,$user) { ... } I hope help


3

Check out the BuddyPress Custom Profile Menu plugin. You should be able to add tabs just by creating a regular Wordpress menu.


3

to get the buddypress profile field data use: bp_get_profile_field_data( array( 'field' => 'your-field-slug', 'user_id' => $user_id ) ); to get the avatar look up bp_get_member_avatar(), and for the name there is bp_displayed_user_fullname() but you need to be in the bp_has_members loop for that one.


3

Just a heads-up that you should be using the bp_loggedin_register_page_redirect_to filter to accomplish this, rather than modifying BuddyPress files (which will get overwritten on every upgrade). function bbg_bp_loggedin_register_page_redirect_to( $redirect_to ) { if ( bp_is_component_front_page( 'register' ) ) $redirect_to = bp_get_root_domain()...


3

It's kind of a bit different, but since this thread appears first on Google, it might be usefull for someone else. To get the current logged-in user profile link, just use bp_loggedin_user_domain() Hope that helps.


3

I solved this issue myself, it was quite easy and I'm surprised nobody else supplied an answer. Having said that, the solution is to add a few lines of code that check what the author ID is of the profile you're viewing and compare it to the ID of the currently logged in user. This code goes at the top of members/single/profile.php <?php // Global $...


3

As far as I know bbPress uses custom post types. So all the data are in the regular posts and post_meta tables. A look at the source code should tell you more. From the bbPress Codex: bbPress creates three custom post types and adds them to the navigation menu: Forums, Topics, and Replies. Use these menu items to create and manage your forums.


3

You should be using a filter outside of your template for this: add_filter( 'template_include', 'wpa62226_template_include', 1, 1 ); function wpa62226_template_include( $template ){ if( is_page( 'some-page' ) ) : global $wp_query; $wp_query->set_404(); status_header( 404 ); $template = locate_template( '404.php' ); ...


Only top voted, non community-wiki answers of a minimum length are eligible