Skip to content

Instantly share code, notes, and snippets.

@lloc
Created June 22, 2012 09:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lloc/2971541 to your computer and use it in GitHub Desktop.
Save lloc/2971541 to your computer and use it in GitHub Desktop.
Code zum Artikel "Multisite Language Switcher ins Menü einbauen" Part 1
<?php
function my_custom_menu_item( $items, $args ) {
if ( class_exists( 'MslsOutput' ) && 'primary-nav' == $args->theme_location ) {
$obj = new MslsOutput;
foreach ( $obj->get( 0 ) as $item ) {
$items .= '<li>' . $item . '</li>';
}
}
return $items;
}
add_filter( 'wp_nav_menu_items', 'my_custom_menu_item', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment