• Resolved fja3omega

    (@fja3omega)


    I just started working on making a multisite in wordpress 3.6
    How do you make it that only the super admin can change the setting of the plugin? I want all the multisites to have the same settings and the sub site admin cannot change it for their site. Where or how do I make it like that. There are no plugin settings in the network administrator so I cant use that. I know about user role editor and the other plugins that control what users can do but I cant find one where the settings will all be the same.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hmm. You might have to do some hacking of the actual plugins source code. I’ll look around as well I might have a need for such a feature.

    Hardcoding your default settings into the plugin, editing the settings page to make your settings read-only – all useful tricks for sure. No magic though.

    For example here’s some typical options set at the top of some awesome plugin:

    //	$myawsomeoption = get_option( 'myawsomeoption' );
    	$myawsomeoption = 'unchanging value of my option instead';

    Maybe later in the plugin you want to show the setting input, but you can make the text area read-only:

    <td class="myawsomeoption-style"><textarea readonly="readonly" name="{$myawsomeoption}">{$myawsomeoption}</textarea></td>

    Alternatively, you can make the settings page appear only to a superadmin, then visit each blog to input your universal settings:

    add_submenu_page(‘settings.php’, ‘My Awesome Plugin’, ‘My Awesome Plugin’, ‘manage_network‘, ‘myawesomeplugin’, ‘myawesomeplugin_page’);

    Thread Starter fja3omega

    (@fja3omega)

    thanks David
    i will try that
    i could also try making my own plugin that would disable the settings for other plugins
    i wish there was a plugin like that…
    back to work then…

    Thread Starter fja3omega

    (@fja3omega)

    did a workaround
    created my own plugin which hides the links in the admin bar and in the admin sidebar for non super admin
    like:

    function remove_wp_nodes() {
    	global $wp_admin_bar;
    if(((!is_super_admin()) || ($user->ID != 0)) || (!is_admin_bar_showing())) {
    	$wp_admin_bar->remove_menu('wp-logo');          // Remove the WordPress logo
    }
    }add_action( 'admin_bar_menu', 'remove_wp_nodes', 999 );

    then used
    https://www.yann.com/en/wp-plugins/yd-wpmu-sitewide-options to set multisitewide options
    whew…
    moving on…
    resolved

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘how to make plugin settings same for all sub site’ is closed to new replies.