Support Forum Support Forum GDPR Cookie Compliance Multisite: hide settings from subsites

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • Premium
    November 03, 2021 @ 8:28 am

    Hi, in multisite is it possible to make the settings available only to the main site (global settings) so that individual settings for subsites cannot be set, menu in subsites needs to be hidden also (that can be achieved with a code snippet but if you know the exact address you can still go there… )

    -VeM-

    Moove Agency
    November 04, 2021 @ 1:54 pm

    Hi Licence,

    Thanks for using our plugins.

    We can prepare such hook. Can you please confirm what you are looking for:

    a) Hide the entire GDPR cookie plugin from the subsites so it can be only managed on the primary site?
    b) Hide only the tab that says ‘Multisite Settings’ on sub sites but the rest of the settings to be editable/visible on subsites?
    c) Or something else?

    Thanks

    Premium
    November 05, 2021 @ 9:05 am

    a)

    We have 5000+ subsites (education) in our installation and we do not want every siteadmin to be able to configure individual site settings. Global settings is fine for us.

    -VeM-

    Moove Agency
    November 05, 2021 @ 10:08 am

    Thanks for clarifying. We’ll work on the hook and let you know when it’s ready.

    Hope this helps.

    Moove Agency
    November 15, 2021 @ 1:09 pm

    Hello,

    We created the following two hooks. Please update your plugin to the latest version and choose one of the following to add to your functions.php:

    1) Hide GDPR banner for normal administrators (only super admin users can make changes)

    add_action( 'gdpr_options_page_cap', function( $capability = 'manage_options' ){
    return 'manage_network_plugins'; });<code></code>

    2) This hook doesn’t hide the plugin in the CMS, but disables all tabs on language sites:

    add_action('gdpr_settings_tab_content', 'gdpr_settings_tab_content_multisite', 10, 2);
    function gdpr_settings_tab_content_multisite( $content, $tab_slug ) {
    // Get main site ID
    
    $main_site_id = get_main_site_id();
    $_blog_id = get_current_blog_id();
    
    // Setting content restriction if is not main site
    if ( $_blog_id !== $main_site_id ) :
    
    ob_start(); ?> <h2><?php esc_html_e('Restricted Content','gdpr-cookie-compliance-addon'); ?></h2> <hr /> <h4>The settings screen is not available in this site, please edit the settings in <a href="<?php echo get_admin_url( $main_site_id, '/admin.php?page=moove-gdpr&tab=multisite-settings' ); ?>" class="gdpr_admin_link">MAIN SITE</a>.</h4> <?php $content = ob_get_clean();
    endif;
    return $content;
    }

    Advanced developers can create their own rules in a multisite environment to restrict / hide the plugin for certain users.

    Hope this helps.

    Premium
    November 16, 2021 @ 10:34 am

    Thank you. The first one is ok, the second one exposes too much (everything from ‘Export/Import setting’ onward can be changed). -VeM-

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

The topic ‘Multisite: hide settings from subsites’ is closed to new replies.