/* These functions are set to run on init and can be removed after they've run once. There is no need to keep them in the functions file */
/* Credit goes to https://ryanbenhase.com/giving-editors-access-to-gravity-forms/ */
//////////////////
// GRANT ACCESS //
//////////////////
function grant_gforms_editor_access() {
$role = get_role( 'editor' );
$role->add_cap( 'gform_full_access' );
}
add_action( 'init', 'grant_gforms_editor_access' );
///////////////////
// REVOKE ACCESS //
///////////////////
function revoke_gforms_editor_access() {
$role = get_role( 'editor' );
$role->remove_cap( 'gform_full_access' );
}
add_action( 'init', 'revoke_gforms_editor_access' );