Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- in my function.php i have :
- // WPML
- function set_icl_adjust_id_url_filter_off($off){
- global $icl_adjust_id_url_filter_off;
- $icl_adjust_id_url_filter_off = true;
- }
- add_action('init','set_icl_adjust_id_url_filter_off');
- and i then i do this :
- $lang=ICL_LANGUAGE_CODE;
- if ($lang=="fr") {
- $idFR=$inst->term_id;
- // GET THE ORIGINAL ENGLISH ID OF THE INSTRUMENT with the French ID
- $idEN= icl_object_id($idFR,'pa_instruments',true,'en');
- // GET THE ORIGINAL SLUG WITH THE ENGLISH ID
- $slugFR= get_term_by('id',$idFR, 'pa_instruments');
- $slugEN= get_term_by('id',$idEN, 'pa_instruments');
- echo "<div style='position:absolute;top:".(20*$nn).";left:0;z-index: 999;background:#FFF'> slugEN: ".$slugEN->slug. " <br>slugFR: ".$slugFR->slug." </div>";
- $theSlug=$slugEN->slug;
- }
- I also tried like sarah proposed with
- global $sitepress;
- remove_filter('get_term', array($sitepress,'get_term_adjust_id'));
- $slugEN= get_term_by('id',$idEN, 'pa_instruments');
- add_filter('get_term', array($sitepress,'get_term_adjust_id'));
- but it didn't work...
- thanks
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement