Settings Options in Admin [superadmin access only on multisite]

Tagged: 

Author Posts

Abland

Notice: this information was written when Microthemer version 2 was current. On Dec 26th, 2014 version 3 was released with a completely new interface. Some of the information may be redundant, but as much of the functionality remains the same in version 3 we haven't deleted this post.

Hi,

This is nice software. I’m testing things on a WordPress multisite with an Artisteer parent. I’m unsure if this is the correct place to post, but I would suggest having a Settings page added would be a good feature.

Currently, I’ve edited the plugin to only show the “Manage Themes” and “Prefernces” page to the Super Admin (myself). I’m also doing the same with the sidebar widgets “Import Settings” and “Plugin Menu”. For all sites in the multisite environment, each has an admin but I only wish for them to edit the theme I’ve assigned rather than seeing all the others.

A Settings page for the Super Admin to assign what roles can see the available pages would be a good feature.


Sebastian

Hi Abland,

Thanks for the feature suggestion. I’ll set up a dummy WordPress multi-site install so that I can look into that for you.

Cheers,

Sebastian


Abland

Hi, Sebastian,

Thought I should update you on the multi-site use of the plug-in. I’ve tried one parent theme and child themes for all sub-sites and that didn’t work so I’ve placed full themes for each site in the network.
The plug-in is network activated (I also tried activating on a per site basis) and each microtheme is tied to its site’s active theme.
I can see in the source they all are calling in the css and jquery (I’ve called both the plug-in’s jquery and WordPress’ with the same results), but when one microtheme is updated then every theme in the network gets updated with those same changes.
If only one microtheme is active in the entire network, that one changes while the others do not show the change when they are reactivated.
So, all active themes get updated in the network when one is updated, while deactivated themes do not show the changes when reactivated.

I’ll keep poking around and hopefully one of us finds a solution 🙂


Sebastian

Hi Abland,

Thanks for sharing your activity.

I’m sorry I haven’t had a chance to troubleshoot this yet. By the sounds of things, I’m going to have to have a close look at how Mulit-site WordPress assigns plugin resources to individual themes. I’ll post back here with my findings.

Cheers,

Seb


Abland

Hi, Sebastian,

Thanks for your fast response. I’ve been messing with the code for a while and finally came up with the solution – simple in retrospect 😉

In “get-dir-paths.inc.php” approx. line 49 change:

$this->micro_root_dir = $wp_content_dir . ‘/micro-themes/’;
$this->micro_root_url = $wp_content_url . ‘/micro-themes/’;

to:

global $blog_id;
$this->micro_root_dir = $wp_content_dir . ‘/blogs.dir/’ . $blog_id . ‘/micro-themes/’;
$this->micro_root_url = $wp_content_url . ‘/blogs.dir/’ . $blog_id . ‘/micro-themes/’;

Now each blog directory has its own micro-themes folder and active-styles.css and updates to one will not affect any other.

This worked for my multisite setup but it would need some additional if / else to determine whether it was single or multisite install so that either one path or the other would apply.

Thanks again 🙂


Abland

lol – here we go 🙂

if (is_multisite()) {
global $blog_id;
$this->micro_root_dir = $wp_content_dir . ‘/blogs.dir/’ . $blog_id . ‘/micro-themes/’;
$this->micro_root_url = $wp_content_url . ‘/blogs.dir/’ . $blog_id . ‘/micro-themes/’;
} else {
$this->micro_root_dir = $wp_content_dir . ‘/micro-themes/’;
$this->micro_root_url = $wp_content_url . ‘/micro-themes/’;
}


Sebastian

Perfect!

Yes I will add that update with a conditional statement which checks for multi-site on the next release of Microthemer.

Thank you so much for sharing that insight.

Sebastian

You must login or register to reply to this topic.