BuddyDev

Search

Replies

  • Participant
    Level: Initiated
    Posts: 3
    saran on #3997

    Hi Brajesh,

    Thank u very much for relying. As expected you put me in right direction. You people are great. Though i wanted to move the profile group into a new main nav tab like Activity, Profile etc. May be i did not elaborate it clearly to you first but with some little changes in your code it was easily achiveable.
    Here i am posting code in case someone else need the same

    function buddydev_modifyy_user_profile_tab() {

    bp_core_new_nav_item( array(
    ‘name’ => ‘My Startup’,
    ‘slug’ => ‘mystartup’,
    ‘screen_function’ => ‘buddydev_screen_profile_data’,
    ‘position’ => 30,
    ‘default_subnav_slug’ => ‘mystartup-sub’,
    ‘show_for_displayed_user’ => true,
    )
    );

    }
    add_action( ‘bp_setup_nav’, ‘buddydev_modifyy_user_profile_tab’, 8 );

    function buddydev_screen_profile_data() {
    //filter loop
    add_filter( ‘bp_after_has_profile_parse_args’, ‘buddydev_filter_args_for_profile_group’ );
    //load loop
    add_action( ‘bp_template_content’, ‘buddydev_show_profile_group_data’);

    bp_core_load_template( ‘members/single/plugins’);
    }

    function buddydev_filter_args_for_profile_group( $args ) {
    ///CHANGE IT
    $args[‘profile_group_id’] = ‘5’; //Your Profile Group ID Here

    return $args;
    }
    //Load the loop
    function buddydev_show_profile_group_data() {
    $profileslug = bp_get_profile_slug();
    if ( bp_is_my_profile() ) :
    echo “Edit“;
    endif;
    bp_get_template_part( ‘members/single/profile/profile-loop’ );
    }
    function hide_profile_group( $grpid ) {
    if ( is_user_logged_in() && !bp_is_profile_edit() ) {
    $myfield = xprofile_get_field_data( ‘My Startup’ );
    $grpid[‘exclude_groups’] = ‘5’;
    }
    return $grpid;
    }
    add_filter( ‘bp_after_has_profile_parse_args’, ‘hide_profile_group’ );

    Your Forum is awesome. Learning a lot from here. Thanks once again 🙂

  • Participant
    Level: Initiated
    Posts: 3
    saran on #3368

    Hi

    Thanks ravi & brajesh for engaging your time and helping me out. Your code works great.
    Please if you can aslo guide me to how to override the core buddypress functions like bp_settings_verify_email_change as i need to change the redirect from settings to profile page after the user dismiss the email change. Many Thanks!!!

  • Participant
    Level: Initiated
    Posts: 3
    saran on #3294

    Hi Brajesh,

    Thanks for replying. I will look forward to your code. It will be a great help. Thanks!!!