BuddyDev

Search

[Resolved] Redirect to /all-activity

  • Participant
    Level: Master
    Posts: 213
    smart life on #15019

    hi
    `1. I use auto login on active plugin
    2. I use plugin display all-activity to user profile: domain.com/members/username/all-activity
    How do I make BOTH auto login on active + old user every time login success will redirect to domain.com/members/username/all-activity

  • Keymaster
    (BuddyDev Team)
    Posts: 24593
    Brajesh Singh on #15030

    Hi Julai,
    Please use the following code

    
    function buddydev_custom_redirect_to_profile_all_activity( $redirect_to_calculated, $redirect_url_specified, $user ) {
    	if ( ! $user || is_wp_error( $user ) ) {
    		return $redirect_to_calculated;
    	}
    
    	return bp_core_get_user_domain( $user->ID ) . 'all-activity';
    
    }
    
    add_filter( 'login_redirect', 'buddydev_custom_redirect_to_profile_all_activity', 101, 3 );
    
    

    Best regards
    Brajesh

  • Participant
    Level: Master
    Posts: 213
    smart life on #15045

    How do i change return bp_core_get_user_domain( $user->ID ) . ‘all-activity’;

    to custom url: domain.com/activity

  • Keymaster
    (BuddyDev Team)
    Posts: 24593
    Brajesh Singh on #15046

    Please change this line

    
    return bp_core_get_user_domain( $user->ID ) . 'all-activity';
    
    

    to

    
    
    return "domain.com/activity";
    
    

    Regards
    Brajesh

  • Participant
    Level: Master
    Posts: 213
    smart life on #15051

    Now i work with menu

    My theme used this code

    
    if ( bp_is_active( 'activity' ) ) {
    $profile_setting['activity'] = '<class="menu-activity">
        <li><a href="' . bp_loggedin_user_domain() 
            'all-activity/">' . __( "All Activity", "buddypress" )  
            . '</a></li>
    
    About
    <a href="' . bp_loggedin_user_domain() 
            'all-activity/">' . __( "All Activity", "buddypress" )  
            . '</a></li>
    

    How do i change it to domain.com/activity

  • Keymaster
    (BuddyDev Team)
    Posts: 24593
    Brajesh Singh on #15053

    Hi Julia,
    I am not sure what you are doing with code but changing this

    
    
    bp_loggedin_user_domain() . 'all-activity/
    
    

    to

    
    "domain.com/activity"
    
    

    will work.

  • Participant
    Level: Master
    Posts: 213
    smart life on #15054

    It don’t work correct

    Here is my website menu full code

    
    <?php if ( function_exists( 'bp_is_active' ) ): ?>
    								<?php $profile_setting = array();
    
    if ( bp_is_active( 'activity' ) ) {
    $profile['activity'] = '<class="menu-activity">
        <li><a href="' . bp_loggedin_user_domain()
            . 'all-activity/">' . __( "all Activity", "buddypress" )  
            . '</a></li>
        <li><a href="' . bp_loggedin_user_domain() 
            . 'activity/">' . __( "My Activity", "buddypress" ) 
            . '</a></li>
    ';
    }			
    $profile = apply_filters( 'header_dropdown', $profile );?>
    
    

    Now i want to change domain.com/username/activity/all-activity
    to be: domain.com/all-activity

    what is correct code?

  • Keymaster
    (BuddyDev Team)
    Posts: 24593
    Brajesh Singh on #15057

    Please post the code on https://pastebin.com and link me. I might be able to help you.

  • Participant
    Level: Master
    Posts: 213
    smart life on #15060

    Can you please work with email. I don’t know how to us link you profile and here is not allow attachment. For this explain i need send you full detail attachment.

    My email topic: Redirect to /all-activity

  • Keymaster
    (BuddyDev Team)
    Posts: 24593
    Brajesh Singh on #15095

    Marking resolved as per your email.

The topic ‘ [Resolved] Redirect to /all-activity’ is closed to new replies.

This topic is: resolved