Last active
September 16, 2024 01:46
-
-
Save bryanwillis/b2e558b395f2018f2eba to your computer and use it in GitHub Desktop.
Gravity Forms User Capabilities / Roles - Using user_has_cap (which is a simpler filter than map_meta_cap), allows Editors to view and manage form entries. #user_has_cap #role #currrent_user_can
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Add Gravity Forms capabilities | |
| */ | |
| add_filter('user_has_cap', | |
| function( $caps ){ | |
| if (! empty( $caps['edit_pages'] ) ) { // user has edit capabilities | |
| $caps['gravityforms_delete_entries'] = true; | |
| $caps['gravityforms_edit_entries'] = true; | |
| $caps['gravityforms_edit_entry_notes'] = true; | |
| $caps['gravityforms_view_entries'] = true; | |
| $caps['gravityforms_view_entry_notes'] = true; | |
| } | |
| return $caps; | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment