Hide GiveWP Menus From Non-Fundraising Staff
Removes the Donations menu from the dashboard for users who cannot view GiveWP reports, keeping editors' menus short on charity sites.
Opens WPIDE on
Code
add_action( 'admin_menu', function () {
if ( defined( 'GIVE_VERSION' ) && ! current_user_can( 'view_give_reports' ) ) {
remove_menu_page( 'edit.php?post_type=give_forms' );
}
}, 999 );
Notes
Give your fundraising team the view_give_reports capability (GiveWP's Worker and Manager roles have it).
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.