That’s interesting! And can be easily done using our filters. Simply add this code to your functions.php file in your theme and change the $id_of_main_site to the id of the site in question:
function mpd_filter_sites_to_one($args){
$id_of_main_site = 2 // Change this to the id of your 'main' site;;
$args['ID'] = $id_of_main_site;
return $args;
}
add_action('mpd_get_sites_args','mpd_filter_sites_to_one');
In order to allow
all users no matter their role
simply set Minimum user role allowed to use MPD to Subscriber in the plugin settings page. Have fun! And thanks for using this plugin! ๐
Sorry forgot to mention this will ONLY work if you are running WordPress 4.6.1.
As uses WordPress new (awesome) get_sites class!
Presuming this one is resolved as not heard anything in a few days. ๐
Thread Starter
krkjee
(@krkjee)
Sorry for my late response. I just got the email-notification.
I’ll take a look at it.
Thank you so much!
Thread Starter
krkjee
(@krkjee)
I get the following:
Parse error: syntax error, unexpected ‘$args’ (T_VARIABLE) in /wp-content/themes/themename/functions.php on line 211
Line 211 is: $args[‘ID’] = $id_of_main_site;
Make sure there is a semi colon at the end of the line:
$id_of_main_site = 2;
Thread Starter
krkjee
(@krkjee)
Okay, it removed the error, but i can’t post. The main site isn’t showing.
It is showing when Iยดm logged in as admin, not edit even though I have followed your guide through settings.
-
This reply was modified 6 years, 2 months ago by
krkjee.
Sorry I don’t understand what you mean. Can you clarify further?
Thread Starter
krkjee
(@krkjee)
I’ll try ๐
The semi colon; fixed the error I got from line 211.
The function I want is currently working, but only for Administrators even though I have change the settings as you have explained.
I think there maybe other user capability issues at play if you set to subscriber. Try changing the minimum role to author or contributor or even editor.