• Resolved beermoney

    (@beermoney)


    It seems that only the Admin User Role is allowed to use the plugin. Is there anyway to make it so that other User Roles like, Editors mainly, but even Authors and Contributors? I don’t really want to have to use a User Role editor plugin to accomplish this. Is there some type of simple code that you can make that would allow this to be done, or maybe even add it into the Poll Options?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Lester Chan

    (@gamerz)

    The best way to do accomplish this is still to use a user role editor plugin.

    Alternatively you can modify the code
    https://github.com/lesterchan/wp-polls/blob/master/wp-polls.php#L1888-L1892

    To add on like

    
        // Set 'manage_polls' Capabilities To Author
        $role = get_role( 'author' );
        if( ! $role->has_cap( 'manage_polls' ) ) {
            $role->add_cap( 'manage_polls' );
        }
    

    Then deactivate and activate the plugin again and it should give author role the manage_poll cap.

    Thread Starter beermoney

    (@beermoney)

    Can I use that same code to work for an Editor? Would I just change ‘author’ out to ‘editor’? Editors is who we mainly want to be able to use it.

    Also, what file should this be added to, and should it be placed at the bottom of that file?

    • This reply was modified 8 years, 1 month ago by beermoney.
    Thread Starter beermoney

    (@beermoney)

    I figured out where it need to be placed. wp-polls.php. Thank you for the help.

    Hi, thanks @gamerz for the workaround, but then what when the plugin’s upgraded ?

    Plugin Author Lester Chan

    (@gamerz)

    That is why I recommend Role Editor plugin instead.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Allowing Other User Roles to use WP-Polls’ is closed to new replies.