File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff 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+
You can’t perform that action at this time.
0 commit comments