WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] how to make plugin settings same for all sub site (5 posts)

  1. fja3omega
    Member
    Posted 10 months ago #

    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.

  2. SysFailure0x5a
    Member
    Posted 10 months ago #

    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.

  3. David Sader
    Member
    Posted 10 months ago #

    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');

  4. fja3omega
    Member
    Posted 10 months ago #

    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...

  5. fja3omega
    Member
    Posted 9 months ago #

    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
    http://www.yann.com/en/wp-plugins/yd-wpmu-sitewide-options to set multisitewide options
    whew...
    moving on...
    resolved

Reply

You must log in to post.

About this Topic

Tags

No tags yet.