Skip to:
Content

BuddyPress.org

Changeset 7440


Ignore:
Timestamp:
10/17/2013 07:00:39 PM (11 years ago)
Author:
boonebgorges
Message:

Add redirect_to URL param support to groups_screen_group_invites()

This allows custom redirects after the acceptance/rejection of a group
invitation, for increased flexibility when generating Accept/Reject links
throughout BuddyPress.

See #5032

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-groups/bp-groups-screens.php

    r7386 r7440  
    6666        }
    6767
    68         bp_core_redirect( trailingslashit( bp_loggedin_user_domain() . bp_get_groups_slug() . '/' . bp_current_action() ) );
     68        if ( isset( $_GET['redirect_to'] ) ) {
     69            $redirect_to = urldecode( $_GET['redirect_to'] );
     70        } else {
     71            $redirect_to = trailingslashit( bp_loggedin_user_domain() . bp_get_groups_slug() . '/' . bp_current_action() );
     72        }
     73
     74        bp_core_redirect( $redirect_to );
    6975
    7076    } else if ( bp_is_action_variable( 'reject' ) && is_numeric( $group_id ) ) {
     
    7985        }
    8086
    81         bp_core_redirect( trailingslashit( bp_loggedin_user_domain() . bp_get_groups_slug() . '/' . bp_current_action() ) );
     87        if ( isset( $_GET['redirect_to'] ) ) {
     88            $redirect_to = urldecode( $_GET['redirect_to'] );
     89        } else {
     90            $redirect_to = trailingslashit( bp_loggedin_user_domain() . bp_get_groups_slug() . '/' . bp_current_action() );
     91        }
     92
     93        bp_core_redirect( $redirect_to );
    8294    }
    8395
Note: See TracChangeset for help on using the changeset viewer.