File: /home/lindsa/public_html/wp-content/themes/generatepress_neo/functions.php
<?php
/**
* Generate child theme functions and definitions
*
* @package Generate
*/
function grant_gforms_editor_access() {
$role = get_role( 'editor' );
$role->add_cap( 'gform_full_access' );
}
// Tie into the 'after_switch_theme' hook
add_action( 'after_switch_theme', 'grant_gforms_editor_access' );
/**
* Remove Gravity Forms capabilities from Editor role.
* Runs when this theme is deactivated (in favor of another).
*
* @access public
* @return void
*/
function revoke_gforms_editor_access() {
$role = get_role( 'editor' );
$role->remove_cap( 'gform_full_access' );
}
// Tie into the 'switch_theme' hook
add_action( 'switch_theme', 'revoke_gforms_editor_access' );