Last active
March 14, 2021 07:01
-
-
Save lloc/1251604 to your computer and use it in GitHub Desktop.
Multisite Language Switcher: Howto use the "msls_blog_collection_get"-filter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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