Home Forums Support Editor roles

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #173742
    marc0s

    Hey Tom,

    I give access to editor user to see the appereance option with this code:

    $role_object = get_role( ‘editor’ );
    $role_object->add_cap( ‘edit_theme_options’ );

    Work fine, but, it possible to hide the Generatepress option in this menu for editor users.

    I don’t want to anybody see the GP Premium code.

    EDITOR MENU OPTION
    Editor menu options

    Thanks for advance

    #173768
    Tom
    Lead Developer
    Lead Developer

    The GeneratePress page will only show for users with the edit_theme_options capability.

    Any reason you’re giving that to editors?

    Let me know πŸ™‚

    #297210
    Chris M.

    Hey Tom!

    I actually have a use-case for this.

    I’ve invited someone to create some Elementor pages on a GeneratePress Premium site.

    But they couldn’t find either of these options as an “Editor”:

    1.) http://d.pr/i/OU3l
    2.) http://d.pr/i/p1Hq

    So I had to upgrade them to “Admin”, which I really do not want to do with certain people on certain projects.

    Any functions.php filters or workarounds here?

    Or maybe a future checkbox in GeneratePress, similar to how Elementor itself has? Like this: http://d.pr/i/FCTh

    Thanks for your help!

    ~ Chris Moore

    #297215
    Chris M.

    Sorry, my use-case wasn’t exactly 100% related to this thread. My apologies…

    But still has to do with the “Editor” role at least… haha

    #297237
    Tom
    Lead Developer
    Lead Developer

    You can adjust the necessary capability to view meta boxes using this filter: https://docs.generatepress.com/article/generate_metabox_capability/

    Let me know if you need more info πŸ™‚

    #297241
    Chris M.

    Thanks Tom!

    What’s the exact code to allow for the 2 boxes I shared in the screenshot above? For the Editor role.

    #297244
    Tom
    Lead Developer
    Lead Developer

    That filter applies to all GP meta boxes.

    So you could do this:

    add_filter( 'generate_metabox_capability','tu_custom_metabox_cap' );
    function tu_custom_metabox_cap() {
        return 'edit_posts';
    }
    #297246
    Chris M.

    Boom! Thank you…

    #297248
    Tom
    Lead Developer
    Lead Developer

    You’re welcome πŸ™‚

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