Better management of metaboxes capabilities on Multisite

Home Forums Support Better management of metaboxes capabilities on Multisite

Home Forums Support Better management of metaboxes capabilities on Multisite

  • This topic has 4 replies, 2 voices, and was last updated 8 years ago by Francesco.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #187209
    Francesco

    Hi Tom,

    this is the first time I write here so first of all I wanna declare my LOVE for you theme and all the awesome add ons πŸ˜‰ Superb job!

    I’d like to suggest something to make it play better on multisite.

    When the theme generates metaboxes it requires the minimum permissions as it follows:

    // Set user role - make filterable
    $allowed = apply_filters( 'generate_metabox_capability', 'activate_plugins' );

    But on WP Multisite usually only SuperAdmin can activate plugins – depending from network configuration.

    So, to make sun sites Administrators play with sidebar and footer I need to filter that variable on my child theme.

    // add capability to site admin for gp metaboxes
    add_filter( 'generate_metabox_capability', 'multisite_admin_metabox_capability', 10, 1 );
    function multisite_admin_metabox_capability( $allowed ) {
        $allowed = 'switch_themes';
        return $allowed;
    }

    I think it can be good to allow by default Administrators to edit that metaboxes on multisite.

    Best,
    Francesco

    #187315
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    Thanks for the suggestion! This is why I made it filterable, so people can switch it around.

    So you’re suggesting I use the “switch_themes” capability over the “activate_plugins”?

    What about “edit_theme_options”?

    #187396
    Francesco

    Hi Tom,

    thank you for quick turnaround.

    Yes, exactly that’s my suggestion!

    ‘edit_theme_options’ would be perfect as well πŸ˜‰

    Cheers,
    Francesco

    #187475
    Tom
    Lead Developer
    Lead Developer

    Done πŸ™‚

    Thanks for the suggestion!

    #187477
    Francesco

    Thank you Tom! πŸ˜‰

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