Did you finish the setup of the plugin?
Yes, the plugin had been working for about 1 year. However, recently it has broken and no longer displays the other languages but I haven’t had a chance to fix it yet.
Please describe your setup a little bit because the plugin is not broken. I cannot help if I have to guess what’s going on.
So, please, check
- if you have the latest version
- if you finished the setup and
- if you have not modified the blog_collection-object using a hook
Thanks!
Hi – sorry when I said ‘broken’ I meant on my site not in general!
So:
– Finished the setup – Setup is finished – as I mentioned it was working for around a year. However, now only the link to the ‘current’ language shows up on each page (i.e. US on Us site, Chinese on Chinese site, etc), so maybe something became undone in an update? Looking at the settings under Settings/General and Settings/Multisite Language Switcher everything seems to be complete. Is there a way of checking if I have completed setup?
– Modified the blog_collection – So I remember having to change something here a while ago to get the other languages to show up. I think I changed the msls_blog_collection_construct as described on this page – http://msls.co/hooks-filters-and-actions/.
Thanks, Daniel
OK, do you mind to post the function that modifies the blog_collection? And could you post the IDs of you blogs too?
I’m sorry – I edited it so long ago I am not sure where to find it any more – could you point me in the right direction?
Is is plugins/editor/multisite-language-switcher/includes/MslsBlogCollection.php?
And where would I find blog IDs?
Sorry for the basic questions.
No, it should be a function in the file functions.php. Or make a search in all files for “add_filter( ‘msls_blog_collection_construct’,…”. If you really modified the plugin files (what you should not do) then get first a clean version.
For the IDs:
When you are in /wp-admin/network/sites.php you’ll see a list of the sites in your network. When you go over the sites with your mouse you’ll see links like /wp-admin/network/site-info.php?id=X (X is the ID).
Thanks so much!
Ok, so here is the modifier:
function my_msls_blog_collection_get( $arr ) {
$arr = array();
foreach ( array( 1, 2, 3,) as $id ) {
$arr[$id] = get_blog_details( $id );
}
return $arr;
}
add_filter( ‘msls_blog_collection_construct’, ‘my_msls_blog_collection_get’ );
and the IDs:
http://hillcrestlabs.com/wp-admin/network/site-info.php?id=1
http://hillcrestlabs.com/wp-admin/network/site-info.php?id=2
http://hillcrestlabs.com/wp-admin/network/site-info.php?id=3
OK, all these 3 websites are configured? And all of them have different languages? Please check this!
Hi – I think you may have found the issue! I am using the WordPress Language plugin to make the admin panel language is english even on the other language sites and it looks like that might be defaulting the language to english in all of the sites as it seems to overwrite the Settings/General language setting.
I will follow up with the authors of that plugin to see if I can resolve.
Thanks!
You don’t need this plugin because the Multisite Language Switcher can do that too. Please have a look in the settings of the plugin.