5 votes

How to override BuddyPress 3.0 bp-nouveau theme files?

I know it is an old question but im pasting this here in case someone is looking for the same answer. Overloading Template Compatibility theme files Template compatibility also runs a check to see if ...
cdrck's user avatar
  • 51
5 votes
Accepted

BuddyPress: Allow only one email domain to register

Finally, I found the solution. Here is the code if anyone has the same issue and want to refer it. Using Action function wf_validate_email_domain() { global $bp; $email = $bp->...
pixelngrain's user avatar
  • 1,400
4 votes
Accepted

How to delete user roles?

$wp_roles = new WP_Roles(); // create new role object $wp_roles->remove_role('name_of_role'); If you need to check the name_of_role use $wp_roles->get_names(); you will get an array of ...
bynicolas's user avatar
  • 2,269
4 votes
Accepted

How can visitors redirect wp-admin to the homepage?

The codex entry for the admin_init hook has an example showing you how to do this. /** * Restrict access to the administration screens. * * Only administrators will be allowed to access the admin ...
DaveLak's user avatar
  • 1,027
4 votes
Accepted

How do I find the bbpress forum ID for a forum in a buddypress group?

The forum id for a group is stored in the {yourprefix}_bp_groups_groupsmeta table where group_id is the group id and the key is forum_id and the value is a serialized array. Instead of a shortcode, ...
jannp's user avatar
  • 141
3 votes

how to get current user name by user_id in buddypress?

This may not be an answer to this question, but in the end I reached for this question when I am looking for a way to fetch the display name for the user through the ID $user_displayname = get_user_by(...
Mohamed Slimane's user avatar
3 votes
Accepted

add_filter : Passing an array instead of the callback function?

You can pass as the callback argument anything which is callable by PHP definition, something that might actually change between PHP versions. In this specific case the array($o,$m) type of notation ...
Mark Kaplun's user avatar
  • 23.3k
3 votes

How to override BuddyPress 3.0 bp-nouveau theme files?

Inside your wordpress theme (hopefully a custom or child theme) create a "buddypress" folder. Then you can override files from the /plugins/buddypress/bp-templates/[buddypress theme] folder. But you ...
Jeremy Muckel's user avatar
3 votes

Buddypress update user avatar image via REST

I finally found a SOLUTION and i want to post it because can be useful for someone! public function update_user_avatar() { global $json_api; if (!$json_api->query->user_id) { $...
Biagio Pietro Capece's user avatar
2 votes

Replacing default display name to login name

Based on this this answer: add_action( 'wp_login', 'wpse_9326315_format_user_display_name_on_login' ); function wpse_9326315_format_user_display_name_on_login( $username ) { $user = get_user_by(...
GDY's user avatar
  • 428
2 votes
Accepted

The acction hook stop working if i move it from plugin file to theme's functions.php file

Think about what you've written: The acction hook stop working if i move it from plugin file to theme's functions.php file And: bp_includes is buddypress action and hooked on plugins_loaded ...
s_ha_dum's user avatar
  • 65.1k
2 votes
Accepted

How to get all logged in user id in buddypress

This $bp->loggedin_user->id will only give you a single id, of the current logged in user. btw - it also requires use of the $bp global. You don't need to use that global. Use ...
shanebp's user avatar
  • 5,062
2 votes
Accepted

Buddypress activity id

That function is called right in entry.php as follows: <li class="<?php bp_activity_css_class(); ?>" id="activity-<?php bp_activity_id(); ?>"> Note that bp_activity_id() will echo ...
shanebp's user avatar
  • 5,062
2 votes
Accepted

Save buddypress xprofile data to author meta

Use this action hook found in buddypress/bp-xprofile/classes/class-bp-xprofile-profiledata.php do_action_ref_array( 'xprofile_data_after_save', array( $this ) ); You'll need to use the actual ...
shanebp's user avatar
  • 5,062
2 votes

User logged-in from front end is logged out automatically accessing wp-admin

have you tried by setting the second argument of wp_signon() to true or blank? set false will prevent wp_signon() from setting secure cookie which is essential for accessing wp-admin if your using ssl....
Kudratullah's user avatar
2 votes
Accepted

Delete images uploaded by 'Subscriber' role

Here's some code which pulls all subscriber IDs, then pulls all attachments from those subscribers and attempts to delete them. If it can't delete them it'll write to the error log letting you know. $...
Howdy_McGee's user avatar
  • 20.6k
2 votes

BuddyPress User Profile Menu

I solved it with my own effort. function bp_remove_nav_item() { global $bp; $current_user = wp_get_current_user(); $role_name = $current_user->roles[0]; if($role_name==='...
083N's user avatar
  • 31
2 votes

How to delete user roles?

A nice, user-friendly way of deleting your custom roles is using the Members plugin. Once you install and activate it, go to Users > Roles and here you can delete an custom roles that you do not need,...
Ethan O'Sullivan's user avatar
2 votes

Fire curl command everytime new user is created

//This action hook allows you to access data for a new user immediately after they are added to the database. The user id is passed to hook as an argument. do_action( 'user_register', $user_id ); ...
Douglas.Sesar's user avatar
2 votes

Set maximum number of letters limit on xprofile fields

Try this code, if it will helps: function filtered_profile_data( $args ) { $data = bp_get_member_profile_data( $args ); $defaults = array( 'field' => false, // Field name 'user_id' => ...
Vijay Baria's user avatar
2 votes

New Post Notifications for Users - BUDDYPRESS

If you check the function for 'publish_post' action. function bp_post_published_notification( $post_id, $post ) { $author_id = $post->post_author; /* Post author ID. */ if ( bp_is_active( ...
JItendra Rana's user avatar
2 votes

How to display posts in hyperlink with nested slugs?

This can be achieved by adding rewrite rules. First, add the query vars that will store the custom values in our rules: function wpd_family_query_var( $query_vars ) { $query_vars[] = 'wpd_family'...
Milo's user avatar
  • 78.4k
2 votes
Accepted

Showing content to specific BuddyPress Member Types

Your answer is on the codex page link in your question. // Get the member type of user 5412. $member_type = bp_get_member_type( 5412 ); So you could do something like this: $member_type = ...
shanebp's user avatar
  • 5,062
2 votes

Duplicate New User Registration notices (BuddyPress and bbPress both installed)

I fixed this with suggestion from here: https://buddypress.org/support/topic/how-can-i-hide-new-registered-member-update-from-activity-streams/ Adding this to functions.php removed one of the copies: ...
user960873's user avatar
2 votes
Accepted

Patient portal using wordpress

Yes its possible to link a file to buddypress member as admin. An important piece of the API is the BP_Attachment class. You can extend it to be ready to receive user submitted files, validate these ...
Prashant Rawal's user avatar
2 votes
Accepted

How to add a count in a custom tab in a Buddypress group

You are using the BP Nouveau templates, correct? Span tag works fine in the Legacy templates. In Nouveau, all links are stripped of span tags. See the calls to function _bp_strip_spans_from_title ...
shanebp's user avatar
  • 5,062
2 votes
Accepted

Buddypress: "Auto load" specific usermeta in WP?

WordPress already does this When you fetch a user post or term WP will auto-fetch all of its meta and store it in WP Cache. This way if you need to use any of that post/term/users meta it's already ...
Tom J Nowell's user avatar
  • 58.9k
1 vote
Accepted

Change user slug in Buddypress

Place the following code in your theme's functions.php file: add_filter( 'bp_core_enable_root_profiles', '__return_true' ); I hope this helps.
Prasad Nevase's user avatar
1 vote
Accepted

How to add an error or notification to an activity?

With enough digging I figured it out. First off you must save your error message to as activity meta data like so: public function send_team_notification($activity) { $message = $this->...
Xtremefaith's user avatar
1 vote

is it possible to crop cover images in buddypress?

The cover picture is not intended to be cropped. When you use this feature, the component tells you which min. image size should be used. If it comes up or not is depends largely of your theme and wp ...
Thilak's user avatar
  • 125

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