• Resolved seank123

    (@seank123)


    I have a user set up as an Editor but the Happy Forms menu is not available to them – only Administrators.

    Is it possible to have it available? Or just the Responses tab would be good!

    Many thanks

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hey there, @seank123! ??

    HappyForms doesn’t include visual controls for that, we’re sorry! It’s totally doable with HappyForms hooks and a bit of PHP though. If you’re up for the challenge (it’s actually simple), just let us know and we’ll be glad to share a snippet.

    Let us know what you think!

    Thread Starter seank123

    (@seank123)

    Thanks for the reply – I’m happy to try a bit of php if you can share it!

    Got it, @seank123!

    Try popping this in your theme functions.php file:

    function happyforms_editor_role_capabilities() {
    	$admin_role = get_role( 'editor' );
    	$capability = happyforms_get_form_controller()->capability;
    	$admin_role->add_cap( $capability );
    }
    
    add_action( 'init', 'happyforms_editor_role_capabilities' );

    That should hopefully do the trick. Let us know how you go!

    Thread Starter seank123

    (@seank123)

    Thanks – that gives me the Happy Forms menu item with All Forms and Add New – but not the Responses link!

    You’re right, @seank123!

    A piece is indeed missing. Try this updated version:

    function happyforms_editor_role_capabilities() {
    	$admin_role = get_role( 'editor' );
    	$form_capability = happyforms_get_form_controller()->capability;
    	$response_capability = happyforms_get_message_controller()->capability;
    	$admin_role->add_cap( $form_capability );
    	$admin_role->add_cap( $response_capability );
    }
    
    add_action( 'init', 'happyforms_editor_role_capabilities' );

    Let us know if that worked!

    Thread Starter seank123

    (@seank123)

    Yes, that works – many thanks!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Visible to other user roles?’ is closed to new replies.