Skip to content

Instantly share code, notes, and snippets.

@andrijeski
Forked from nciske/filter-nav-menus.php
Last active December 22, 2015 06:19
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 andrijeski/6430180 to your computer and use it in GitHub Desktop.
Save andrijeski/6430180 to your computer and use it in GitHub Desktop.
<?php
/*** Used this to fix the menu/language issues with Transposh.
* Adding _JAZIK_ to menu custom links will enable getting current language code,
so the menu redirects to proper language URL.
***/
add_filter('wp_nav_menu', 'menu_shortcodes');
function menu_shortcodes( $menu ){
return str_replace('_JAZIK_',preg_replace("~^(?:f|ht)tps?://~i", '', transposh_get_current_language() ), do_shortcode( $menu ) );
}
add_shortcode('test','tester');
function tester(){
return 'Worked!';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment