Quantcast
Channel: polylang – WordPress.org Forums
Viewing all articles
Browse latest Browse all 11471

aigarinsh on "[Plugin: Polylang] Custom taxonomy rewrite"

$
0
0

OK I managed it myself with an ugly solution which wouldn't work for the main language version where there is no langauge slug if you moved to other country code top-level domain as .lv But for the current situation I can live with that.

Here is the code:

add_filter('pll_the_languages', 'bk_ln_slugs', 10);
function bk_ln_slugs($output) {
  $output = str_replace('.lv/menu-categories','.lv/menu-kategorijas', $output);
  $output = str_replace('.lv/меню-категории','.lv/menu-kategorijas', $output);
  $output = str_replace('en/меню-категории','en/menu-categories', $output);
  $output = str_replace('en/menu-kategorijas','en/menu-categories', $output);
  $output = str_replace('ru/menu-categories','ru/меню-категории', $output);
  $output = str_replace('ru/menu-kategorijas','ru/меню-категории', $output);
  return $output;
}

Viewing all articles
Browse latest Browse all 11471

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>