• Resolved Imageweymolith

    (@weymolith)


    At the moment, only users at the Admin level have the ability to add snippets from the classic editor menu (top editor bar) on posts and pages.

    I would like users at the Editor level to have this functionality.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi @weymolith,

    Try the following code snippet:

    /**
    * Code Snippets:
    * Allows Editors to manage snippets (in addition to Administrators)
    */
    add_filter( 'code_snippets_cap', 'custom_code_snippets_cap' );
    function custom_code_snippets_cap( $cap ) {
    return 'edit_pages';
    }

    Plugin Author ImageShea Bunge

    (@bungeshea)

    @yordansoares is correct, you can use the code_snippets_cap to control which roles have access to the Code Snippets UI.

    Currently, that means that they will not only be able to insert snippets, but also access the Snippets menu to create, edit, deactivate, and delete snippets as well.

    Is this in-line with what you are after, or are you only wanting to add access to the editor button without providing full access?

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Need to allow users at Editor level to access the code snippet inserter in edit’ is closed to new replies.