BuddyPress activity on edit post for a CPT

Use the save_post hook. Try something like: function jude_classified_activity_entry( $post_id, $post, $update ) { $slug = ‘classified’; if ( $slug != $post->post_type ) return; bp_activity_add( // etc ); } add_action( ‘save_post’, ‘jude_classified_activity_entry’, 15, 3 );

Buddypress Welcome Email [closed]

For the activation email, you can use the filter hook in buddypress\bp-members\bp-members-functions.php $message = apply_filters( ‘bp_core_signup_send_validation_email_message’, $message, $user_id, $activate_url ); For example, try this in your theme/functions.php function gavin_welcome_message( $message, $user_id, $activate_url ) { $message=”Gavin says something here… ” . $message; return $message; } add_filter(‘bp_core_signup_send_validation_email_message’, ‘gavin_welcome_message’, 15, 3);

How to do something when user profile rendereing?

I’m not sure I understand your question correctly, but I give it a try… <?php function remove_xprofile_links() { global $current_user; get_currentuserinfo(); $user_id = $current_user->ID; $field = xprofile_get_field_data(3, $user_id); $class=”normal-profile”; if ($field == ‘{whatever}’) { $class=”hidden-profile”; } $html=”<div class=”” .$class . ‘”>’ . $field . ‘</div>’; echo $html; ?> And in css you should have .hidden-profile … Read more

Why BuddyPress fields not saving?

The user_register hook probably fires too early. Try: add_action( ‘bp_core_signup_user’, ‘auto_login_new_user’, 100, 1 ); $user_id is passed by the bp_core_signup_user hook.

Fill the content of newly added Profile Tab (BuddyPress)

Please check the code below. I guess you are facing 404 because it’s not getting the slug & the url properly. add_action( ‘bp_setup_nav’, ‘mb_bp_profile_menu_posts’ ); function mb_bp_profile_menu_posts() { global $bp; bp_core_new_nav_item( array( ‘name’ => ‘My Posts’, ‘slug’ => ‘myposts’, ‘position’ => 11, ‘default_subnav_slug’ => ‘published’, ‘screen_function’ => ‘mb_author_posts’, ‘parent_url’ => bp_displayed_user_domain() . ‘/myposts/’, ‘parent_slug’ => … Read more

Display Recent Posts in BuddyPress Profile

This is quite easy, because you can use author as a parameter with get_posts(). The following snippet retrieves the 5 latest posts by a specific user, whose ID you need to pass. $author_ID = bp_displayed_user_id(); $author_posts = get_posts(‘author=”.$author_ID.”&posts_per_page=5′ ); if($author_posts) { foreach ($author_posts as $author_post) { // do output like echo $author_post->post_title.'<br />’ } }

Buddypress avatar image in database [closed]

BuddyPress does not store the avatar path in the database. It loads avatars using the directory path – usually …/wp-content/uploads/avatars/. For example, the full sized avatar for a member might be …/wp-content/uploads/avatars/1/ef1e70a512662ea4fdca5b2efb6f76ab-bpfull.jpg where 1 is the user_id. Check your BP installation to find the exact path to the avatars.