diff --git a/includes/hooks-buddypress-profile.php b/includes/hooks-buddypress-profile.php index a865167..732139f 100644 --- a/includes/hooks-buddypress-profile.php +++ b/includes/hooks-buddypress-profile.php @@ -432,7 +432,11 @@ function cacsp_profile_action_handler() { return; } - $redirect = bp_displayed_user_domain() . 'papers/'; + if ( false !== strpos( wp_get_referer(), get_post_type_archive_link( 'cacsp_paper' ) ) ) { + $redirect = get_post_type_archive_link( 'cacsp_paper' ); + } else { + $redirect = bp_displayed_user_domain() . 'papers/'; + } switch ( bp_current_action() ) { // delete paper diff --git a/templates/content-directory-social-paper-buddypress.php b/templates/content-directory-social-paper-buddypress.php index 3ae4573..a2eaef9 100644 --- a/templates/content-directory-social-paper-buddypress.php +++ b/templates/content-directory-social-paper-buddypress.php @@ -16,6 +16,8 @@ + +