Skip to content

Commit bb32c6a

Browse files
committed
Merge commit '795f57fe94f17c333f3d10ac7d346433552a991b' into feature/grunt-options
2 parents e687014 + 795f57f commit bb32c6a

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

theme/inc/sqcdy-base-theme-givewp.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,3 +315,23 @@ function undisableButton() {
315315
wp_add_inline_script( 'jquery', $script, 'before' ); //requires jquery
316316
}
317317
}
318+
319+
// Redirect GiveWP Donor Single Overview to Legacy Overview
320+
// /wp-admin/edit.php?post_type=give_forms&page=give-donors&view=overview&id=1234 TO
321+
// /wp-admin/edit.php?post_type=give_forms&page=give-donors&view=legacy-overview&id=1234
322+
323+
// NOTE: remove this when https://givewp.featureos.app/p/give-manager-role-should-be-able-to-edit-donor-profiles is resolved
324+
add_action( 'admin_init', 'squarecandy_givewp_redirect_donor_overview' );
325+
function squarecandy_givewp_redirect_donor_overview() {
326+
if ( isset( $_GET['post_type'] ) && 'give_forms' === $_GET['post_type'] && isset( $_GET['page'] ) && 'give-donors' === $_GET['page'] && isset( $_GET['view'] ) && 'overview' === $_GET['view'] ) { //phpcs:ignore WordPress.Security.NonceVerification.Recommended
327+
$redirect_url = add_query_arg(
328+
array(
329+
'view' => 'legacy-overview',
330+
),
331+
remove_query_arg( 'view' )
332+
);
333+
wp_safe_redirect( esc_url_raw( $redirect_url ) );
334+
exit;
335+
}
336+
}
337+

0 commit comments

Comments
 (0)