Skip to content
lloc edited this page Nov 3, 2011 · 3 revisions

Has MSLS something like icl_object_id in WPML?

Short answer: No.

Long answer: I'm not sure if the Multisite Language Switcher has really to deal with that. I've seen some customized WordPress-themes which had some old-fashioned static functionality to create content in the sidebar. In this case you could need something like that (or you could modify something in your theme).

Here is an example how you can request the category_id in the current blog when you know just the ID of the category of the standard blog:

function my_get_category_id( $id ) {
    if ( class_exists( 'MslsBlogCollection' ) ) {
        $blogs = MslsBlogCollection::instance();
        if ( $blogs->get_current_blog_id() != BLOG_ID_CURRENT_SITE ) {
            $language = $blogs->get_current_blog()->get_language();
            switch_to_blog( BLOG_ID_CURRENT_SITE );
            $mydata = new MslsCategoryOptions( $id );
            $id = $mydata->__get( $language );
            restore_current_blog();
        }
    }
    return $id;
}

Read on here:

Clone this wiki locally