Support » Plugin: User Role Editor » Grant Editor Allow Full Access to Caldera Forms

  • I can’t figure out how to give a user with Editor permissions to get access to Caldera Forms and be able to create, edit, save and view entries to forms.

    Thanks,
    Pat

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Vladimir Garagulia

    (@shinephp)

    Hi Pat,

    Caldera Forms uses ‘manage_options’ by default.
    It’s possible to replace ‘manage_options’ with any other user capability using custom filter: ‘caldera_forms_manage_cap’:
    caldera-forms/classes/core.php, line #4865:

    
    /**
     * Returns the capability to manage Caldera Forms
     *
     * By default, returns "manage_options" can be filtered with "caldera_forms_manage_cap"
     *
     * @since 1.3.1
     *
     * @param string $context Optional. Context for checking capabilities.
     *
     * @return mixed|void
     */
    public static function get_manage_cap($context = 'admin', $form = false)
    	{
    	if (is_string($form)) {
    		$form = Caldera_Forms_Forms::get_form($form);
    	}
    
    	/**
    	 * Change capability for managing Caldera Forms
    	 *
    	 * @since 1.3.1
    	 *
    	 * @param string $cap A capability. By default "manage_options"
    	 * @param string $context Context to check in.
    	 * @param array|null $form Form config if it was passed.
    	 */
    	return apply_filters('caldera_forms_manage_cap', 'manage_options', $context, $form);
    
    }
    
    

    Thank you but I’d rather not have to remember to apply this patch each time Caldera updates their plugin.

    Plugin Author Vladimir Garagulia

    (@shinephp)

    There is no need to change Caldera Forms source code. You need just add the code below to active theme functions.php file (better to use child theme for that) or setup it as a Must Use plugin:

    
    add_filter('caldera_forms_manage_cap', 'change_cf_manage_cap', 10, 1);
    
    function change_cf_manage_cap( $cap ) {
    
        $cap = 'edit_caldera_forms';
        
        return $cap;
    }
    

    Do not forget to add ‘edit_caldera_forms’ capability 1st. In other case even admin will lose access to Caldera Forms until you grant this capability to him.

    Hi, can you explain, where we must add this : Do not forget to add ‘edit_caldera_forms’ capability 1st. ?

    I add the filter but it doesn’t work to see entries in frontend

    Plugin Author Vladimir Garagulia

    (@shinephp)

    Hi,

    You need to add user capability to a selected user role via ‘Users->User Role Editor’.

    Hi, then I added the code below in theme functions.php

    add_filter('caldera_forms_manage_cap', 'change_cf_manage_cap', 10, 1);
    
    function change_cf_manage_cap( $cap ) {
    
        $cap = 'edit_caldera_forms';
        
        return $cap;
    }

    But I don’t see options about Caldera Form in User Role Editor :/

    https://wordpress.org/support/topic/how-to-allow-subscribers-to-see-entries-in-front-end/

    Plugin Author Vladimir Garagulia

    (@shinephp)

    There is no special options for CF in URE. All you need to do after setting up a filter as above, add new custom capability ‘edit_caldera_forms’ with User Role Editor and grant it to a role, which your user has.

Viewing 7 replies - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.