You could use get_the_msls() and work with the returning array instead of printing the links directly. Would this resolve your problem?
Cheers,
Dennis.
Hi,
Not sure but maybe I lack in understanding here, I was hoping to do something like this
foreach ( array( 1, 2, 3) as $id ) {
//array('orderby' => 'blog_id', 'order' => 'ASC');
$arr[$id] = get_blog_details( $id );
}
//$arr = array('orderby' => 'blog_id', 'order' => 'ASC' );
return $arr;
Note: the commented out lines are attempts in vain to get the sort order optimized.
In terms of using get_the_msls(), how would you go about to create a fully customized language switcher? How do I get the flags,
li>items, etc. and most importantly, how do I set the sort order?
Thanks in advance for your help!
Cheers JP
Do you need just an array with the generated links so give it a try 😉
$arr = get_the_msls();
print_r( $arr );
Or do you need something else?
Ideally the output would be the same as with the_MSLS, so including the divs below. Also I noticed that the function example output the get_the_msls to the navigation menu, which is not what I want since it should have it’s own DIV.
add_filter( 'wp_nav_menu_items', 'my_custom_language_menu', 10, 2 );
How would I change the add_filter above to use get_the_msls with the divs I need in my header?
The desired output is as follows:
<div id="language_selector"><ul class="translation_links">
<li><a href="#" title="fr"><img width="16" height="11" src=".../wp-content/plugins/multisite-language-switcher/flags/fr.png" alt="fr_FR"></a></li>
<li><a href="#/en" title="en"><img width="16" height="11" src=".../wp-content/plugins/multisite-language-switcher/flags/us.png" alt="us"></a></li>
<li><a href="#/ar" title="ar"><img width="16" height="11" src=".../wp-content/plugins/multisite-language-switcher/flags/ar.png" alt="ar"></a>
</li>
</div>
[Moderator Note: Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]