Home Forums Support Disable elements

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #206896
    infopublinoce-it

    Hello Tom Greetings from Italy,and compliments for your masterpiece.

    I nedd a solution, Please, to hide Metabox “disable elements” in edit post page for not admin only, so MB should not visible for editor author and so on.

    Can you help me please ?

    B.Regards

    Maurizio

    #206898
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    Currently the metaboxes are only viewable to users with the edit_theme_options capability: https://codex.wordpress.org/Roles_and_Capabilities#Administrator

    You can change this using a filter like this:

    add_filter( 'generate_metabox_capability', function() {
          return 'edit_theme_options';
    } );

    Just replace edit_theme_options with the capability you wish to use, listed at the URL I posted above.

    Adding PHP: https://generatepress.com/knowledgebase/adding-php-functions/

    #1162727
    L

    Perfect thank you!

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