Last active
October 18, 2020 19:29
-
-
Save Shelob9/60538a46cdb02381570718522f2e85e6 to your computer and use it in GitHub Desktop.
Examples of how to change the capabilities for what kind of user can use Caldera Forms admin via the caldera_forms_manage_cap filter SEE: https://calderaforms.com/doc/caldera_forms_manage_cap/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
Allow users with the editor role to use the Caldera Forms admin screen | |
*/ | |
add_filter( 'caldera_forms_manage_cap', function( $cap, $context ) { | |
if( 'admin' == $context ) { | |
return 'edit_pages'; | |
} | |
return $cap; | |
}, 10, 2 ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'caldera_forms_manage_cap', function() { | |
return 'delete_posts'; | |
}, 51 ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
Change capability for editting Caldera Forms entires | |
*/ | |
add_filter( 'caldera_forms_manage_cap', function( $cap, $context ) { | |
if( 'edit-entry' == $context ) { | |
//choose a capability of the role you wish to allow | |
return 'create_posts'; | |
} | |
return $cap; | |
}, 10, 2 ); | |
/** | |
Change capability for deleting Caldera Forms entires | |
*/ | |
add_filter( 'caldera_forms_manage_cap', function( $cap, $context ) { | |
if( 'edit-entry' == $context ) { | |
//choose a capability of the role you wish to allow | |
return 'edit_pages'; | |
} | |
return $cap; | |
}, 10, 2 ); | |
Any luck with this? I haven't been able to resolve this issue.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
any news on that? What to do extactly to allow editors to create and clone forms? Would be great if anybody can help.
No luck with the following code in functions.php: