Skip to content

Instantly share code, notes, and snippets.

@lloc
Last active March 14, 2021 07:01
Show Gist options
  • Save lloc/1251604 to your computer and use it in GitHub Desktop.
Save lloc/1251604 to your computer and use it in GitHub Desktop.
Multisite Language Switcher: Howto use the "msls_blog_collection_get"-filter
<?php
function my_msls_blog_collection_get( $objects ) {
$objects = array();
$blogs = array( 1 => 'Override English', 2 => 'Override Deutsch', );
foreach ( $blogs as $id => $description ) {
$details = get_blog_details( $id );
if ( is_object( $details ) ) {
$objects[$id] = new MslsBlog( $details, $description );
}
}
return $objects;
}
add_filter( 'msls_blog_collection_construct', 'my_msls_blog_collection_get' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment