Different user capability for Verify Users admin page - Pie Register
2018-12-11 22:42:05

Different user capability for Verify Users admin page

Home Forums Pie-Register 2.0 Support Different user capability for Verify Users admin page

This topic contains 3 replies, has 2 voices, and was last updated by  Pie Register 2 years, 5 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #4595

    Joe Hoffman
    Participant

    Hello,
    Currently, the “Unverified Users” page has the capability set to “manage_options” which means you must be an admin to verify users if that option is enabled. However, it would be very helpful if that capability was either ‘edit_users’ or better yet, a custom role. This way, we could enable just the verification functionality in the admin without giving full administrative rights to those users.

    If that’s not possible, is there a filter to overload your AddPanel function to change the capability…or a way to add that page and its functions via add_users_page in a child theme?

    Thank you!

    #4596

    Pie Register
    Keymaster

    Thanks for the feature request,. we will definitely work on this for our future version.. I think you can try something like this in your theme’s function.php

    global $pie_register;
    remove_action( 'admin_menu',  array($pie_register,'AddPanel') );
    add_action('admin_menu','pr_custom_admin_menu');
    function pr_custom_admin_men(){
    //some code here
    }

    hope it helps

    Thanks

    #4597

    Joe Hoffman
    Participant

    Thank you for that code start. Since I didn’t want to change the functionality for all of the admin page, just the Unverified page, here’s what I ended up with:

    add_action('admin_menu','pr_custom_admin_menu');
    function pr_custom_admin_menu(){
        global $pie_register;
        $pie_page_verify = add_users_page( 'Unverified Users', 'Unverified Users', 'edit_users', 'unverified-users2', array($pie_register, 'Unverified') );
                    add_action('admin_print_scripts-' . $pie_page_verify, array($pie_register,'pieregister_admin_scripts_styles'));
    }

    This way, I can add just the Users: Unverified page only for users of a certain capability (in this case, edit_users) that I have assigned to a new user role.

    Thanks for a great plug-in. Looking forward to its continued development.

    #4599

    Pie Register
    Keymaster

    Glad you got it working! feel free to write us if you have any other questions.

    Thanks

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.