Skip to content

Instantly share code, notes, and snippets.

@rickalday
Created May 31, 2022 19:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rickalday/ffb27e660cd4b1c7b1d9cf92ef696264 to your computer and use it in GitHub Desktop.
Save rickalday/ffb27e660cd4b1c7b1d9cf92ef696264 to your computer and use it in GitHub Desktop.
Switch Give Donation history to Legacy View for Admins
add_action('admin_init', static function () {
if (isset($_GET['givewp_set_legacy_lists']) && current_user_can('manage_options')) {
$userIds = get_users(['role' => 'Administrator', 'fields' => 'ID']);
foreach ($userIds as $userId) {
update_user_meta($userId, '_give_donations_archive_show_legacy', 1);
update_user_meta($userId, '_give_donors_archive_show_legacy', 1);
update_user_meta($userId, '_give_donation_forms_archive_show_legacy', 1);
}
wp_redirect(remove_query_arg('givewp_set_legacy_lists'));
exit;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment