WordPress.org

Support

Support » Multisite » [Resolved] Multisite Theme Edit

[Resolved] Multisite Theme Edit

  • Greetings,

    I have a multisite installs with six sites and six themes (one for each site). The themes are activated on a per-site basis (super-admin->sites->edit).

    Is there a way to grant to the site admin the permission to edit the theme allowed for his site? It seems that only a super-admin can edit themes, that’s true?

Viewing 15 replies - 1 through 15 (of 23 total)
  • Andrea Rennick

    @andrea_r

    Customer Care at Copyblogger Media and Studiopress

    It seems that only a super-admin can edit themes, that’s true?

    Yep.

    Humm, I see :/

    Any ideas on how to change this? Maybe a plugin like “User Role Editor”?

    Andrea Rennick

    @andrea_r

    Customer Care at Copyblogger Media and Studiopress

    I doubt that plugin has anything to bridge Between a blog administrator and a super admin. I don’t know of any that does.

    What kind of edits are they making? If it;s just css, give them one of these plugins:
    http://wpmututorials.com/plugins/css-editor-plugins/

    I would also like a way to give regular admins (not just super-admins) access to the full-blown theme editor.

    @andrea_r: We have a small network of like-minded sites (one about Tolkien, another about Literature, another one about Books and so on). Every site have his own unique template and we have to give to the Admin of the site the right to edit the template assigned to his site. I’ll try to hack the code and see what I can find/do =]

    Andrea Rennick

    @andrea_r

    Customer Care at Copyblogger Media and Studiopress

    There’s a plugin called Userthemes for mu, but last I had heard it wasn;t quite working in 3.0. that may have changed tho.

    Ok, I did it. It was not pretty, but it works.

    a) In the file menu.php I changed the line

    add_submenu_page('themes.php', _x('Editor', 'theme editor'), _x('Editor', 'theme editor'), 'edit_themes', 'theme-editor.php');

    to

    add_submenu_page('themes.php', _x('Editor', 'theme editor'), _x('Editor', 'theme editor'), 'switch_themes', 'theme-editor.php');

    b) In the file theme-editor.php I changed the line

    $themes=get_themes();

    to

    $themes=get_allowed_themes();

    Andrea Rennick

    @andrea_r

    Customer Care at Copyblogger Media and Studiopress

    Inserting standard disclaimer here that people with open signups really *really* do not want to do this. 😉

    didn’t help for me

    You do not have sufficient permissions to edit templates for this site.

    that’s what I see on theme editor page,
    admin user have all theme capabilities on this site …

    Hi

    In order to allow blog admins to edit only the themes they are using on their blog I just removed form for selecting theme in file theme-editor.php. Now only selected theme is shown in editor.

    Also changed what Bettega mention in menu.php and now I can see edit theme menu item but still get following message:

    “You do not have sufficient permissions to edit templates for this site.”

    Does anybody knows how to get this permisions.

    Thanks

    To add the editor to your MU accounts:

    <?php
    
       /*
    
       Tested Working on WordPress Multisite 3.1
    
       Instructions:
       		1. Place this text in a file in the wp-content/mu-plugins/ folder.
       		2. Make the following edits:
    
       EDIT 1: in wp-admin/theme-editor.php
    
    	   Comment out this line as so:
    
    	 	/*
    		if ( is_multisite() && ! is_network_admin() ) {
    		wp_redirect( network_admin_url( 'theme-editor.php' ) );
    		exit();
    		}
    
       EDIT 2:
    
    	Replace:
    		$themes = get_themes();
    	With:
    		$themes=get_allowed_themes();
    
                    3. Done.
    
    	*/
    
    	add_action('admin_menu', '_add_themes_utility_editor', 102);
    
     	function _add_themes_utility_editor() {
    	// Must use API on the admin_menu hook, direct modification is only possible on/before the _admin_menu hook
    	add_submenu_page('themes.php', _x('Editor', 'theme editor'), _x('Editor', 'theme editor'), 'switch_themes', 'theme-editor.php');}
    
       // get the the role object
       $editor = get_role('administrator');
       // add $cap capability to this role object
       $editor->add_cap('edit_theme_options');
       $editor->add_cap('edit_themes');
    
    ?>

    Hi jroakes.

    Thank you very much. This is exactly what I need.
    Now I can see the editor-Link, bit when I click on it, I get the message:
    “You do not have sufficient permissions to edit templates for this site.”

    The user has the role “Administrator” for this specific blog.

    Is there something else which needs to be done?

    Regards, Markus

    Try doing a hard refresh (ctrl +f5). This is what worked for me. I cannot think of anything else that I did. If something comes to mind I will report back.

    Hi, Another option might be a highly customisable theme like Weaver 2.0
    This is built on the default twenty ten theme but allows the user to make heaps of tweaks to sidebars, css headers, widgets etc etc.
    Only superadmin can edit the theme but the users get huge flexibility. Great theme with good support at wpweaver.info

    @jroakes Thanks for the code. It almost works. The themes link shows up, but I get the following error.

    Fatal error: Cannot redeclare _add_themes_utility_editor() (previously declared in /Volumes/staging/test_site/wp-content/plugins/theme-editor.php:44) in /Volumes/staging/test_site/wp-content/plugins/theme-editor.php on line 44

    In theme-editor.php I only commented out the following:

    if ( is_multisite() && ! is_network_admin() ) {
    		wp_redirect( network_admin_url( 'theme-editor.php' ) );
    		exit();
    		}

    I didn’t notice the closing comment tag, so I assumed it was only this block of code. Also switched to
    $themes=get_allowed_themes();

    Thanks in advance.

Viewing 15 replies - 1 through 15 (of 23 total)
  • The topic ‘[Resolved] Multisite Theme Edit’ is closed to new replies.
Skip to toolbar