There are many situations where you don’t want a client to be an Administrator, but would like them to be able to manage forms. As a default, Formidable forms are only editable by Administrators but some simple code can instead open up Formidable to Editors, without having the burden of an extra plugin. Here’s how you do it:
// Grant Formidable Forms access to the 'editor' role
function grant_formidable_access_to_editors() {
// Get the 'editor' role
$editor_role = get_role('editor');
if ( ! is_null( $editor_role ) ) {
// Grant Formidable Forms capabilities
$editor_role->add_cap('frm_view_forms');
$editor_role->add_cap('frm_edit_forms');
$editor_role->add_cap('frm_delete_forms');
$editor_role->add_cap('frm_change_settings');
$editor_role->add_cap('frm_view_entries');
$editor_role->add_cap('frm_delete_entries');
$editor_role->add_cap('frm_edit_entries');
}
}
add_action('init', 'grant_formidable_access_to_editors');
This code snippet retrieves the ‘editor’ role, and then adds the necessary capabilities to manage Formidable Forms. It can either go in your theme / child themes functions.php file or in a small plugin. As always with code changes, this should be carried out on a staging environment and a full backup should be taken before pushing it live.
Conclusion
There you have it, a simple way to allow Editors to manage Formidable Forms without the overhead of a new plugin.