Skip to content

Instantly share code, notes, and snippets.

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 mmizwicki/b1631e1a0324cf3113bd853956a94c0d to your computer and use it in GitHub Desktop.
Save mmizwicki/b1631e1a0324cf3113bd853956a94c0d to your computer and use it in GitHub Desktop.
Add new non-admin user role to access to Gravity Forms
//https://legacy.forums.gravityhelp.com/topic/forms-not-visible-to-editors
// add client role that has access to Gravity Forms (except for settings)
// this role is an addition of the Editor role
if (!get_role('client'))
{
$caps = get_role('editor')->capabilities;
$caps = array_merge($caps, array(
'gravityforms_create_form' => true,
'gravityforms_delete_entries' => true,
'gravityforms_delete_forms' => true,
'gravityforms_edit_entries' => true,
'gravityforms_edit_entry_notes' => true,
'gravityforms_edit_forms' => true,
'gravityforms_edit_settings' => false,
'gravityforms_export_entries' => true,
'gravityforms_view_entries' => true,
'gravityforms_view_entry_notes' => true
));
add_role('client','Client', $caps );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment