Redirect back to the page a user was on before login in Charitable

Redirect back to the page a user was on before login in Charitable on child sites.

Snippet Type

Execute on Child Sites

Snippet

function ed_charitable_redirect_to_previous_page_after_login( $args ) {
    $referrer = wp_get_referer();

    if ( false != $referrer ) {
        $args['redirect'] = $referrer;
    }
    
    return $args;
}

add_filter( 'charitable_login_form_args', 'ed_charitable_redirect_to_previous_page_after_login' );

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.