Do you need to allow Editor users on your site to access WPForms? By default, WPForms access is restricted to users that have full administrative privileges on your site. This is by design and recommended for security purposes.
However, in some cases you might want to to allow site Editors access to manage your forms and entries. In this tutorial, we’ll show you how to expand WPForms access to Editors.
To provide Editors with access to WPForms, you’ll need the code snippet shown below:
1 | /** |
2 | * Change WPForms capability requirement. |
3 | * |
4 | * @param string $cap |
5 | * @return string |
6 | */ |
7 | function wpforms_custom_capability( $cap ) { |
8 |
9 | // unfiltered_html by default means Editors and up. |
10 | // See more about WordPress roles and capabilities |
12 | return 'unfiltered_html' ; |
13 | } |
14 | add_filter( 'wpforms_manage_cap' , 'wpforms_custom_capability' ); |
For details on how to easily add custom code like this to your site, please see WPBeginner’s tutorial on custom code snippets.
'unfiltered_html'
on multisite). For example, 'moderate_comments'
would be a good option (assuming your site is using default Editor capabilities).Please see the WordPress Codex if you’d like more alternative options.That’s it! Once this code is in place, any users with an Editor role on your site will gain access to WPForms.
Next, would you like to learn about all of the options available for entry management? Be sure to check out our complete guide to entries for details on CSV exports, printing entries, and more.