Advertisement
Guest User

Untitled

a guest
Aug 15th, 2013
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. in my function.php i have :
  2. // WPML
  3. function set_icl_adjust_id_url_filter_off($off){
  4. global $icl_adjust_id_url_filter_off;
  5. $icl_adjust_id_url_filter_off = true;
  6.  
  7. }
  8. add_action('init','set_icl_adjust_id_url_filter_off');
  9.  
  10.  
  11. and i then i do this :
  12. $lang=ICL_LANGUAGE_CODE;
  13. if ($lang=="fr") {
  14. $idFR=$inst->term_id;
  15. // GET THE ORIGINAL ENGLISH ID OF THE INSTRUMENT with the French ID
  16. $idEN= icl_object_id($idFR,'pa_instruments',true,'en');
  17. // GET THE ORIGINAL SLUG WITH THE ENGLISH ID
  18. $slugFR= get_term_by('id',$idFR, 'pa_instruments');
  19. $slugEN= get_term_by('id',$idEN, 'pa_instruments');
  20. echo "<div style='position:absolute;top:".(20*$nn).";left:0;z-index: 999;background:#FFF'> slugEN: ".$slugEN->slug. " <br>slugFR: ".$slugFR->slug." </div>";
  21. $theSlug=$slugEN->slug;
  22. }
  23.  
  24.  
  25. I also tried like sarah proposed with
  26.  
  27. global $sitepress;
  28. remove_filter('get_term', array($sitepress,'get_term_adjust_id'));
  29. $slugEN= get_term_by('id',$idEN, 'pa_instruments');
  30. add_filter('get_term', array($sitepress,'get_term_adjust_id'));
  31.  
  32. but it didn't work...
  33.  
  34. thanks
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement