Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi there! I have the same problem. This plugins seems to be deprecated… it’s so sad. I’m trying to fix the issue.

    Try something like this:

    function get_tranlated_url($url){
      $current_sites = wp_get_sites();
      $original_blog_id = get_current_blog_id();
      $translated_url = "";
      foreach($current_sites as $site):
        if($site['blog_id'] != $original_blog_id){
          switch_to_blog( $site['blog_id'] );
          $translated_url = get_permalink(url_to_postid($url));
        }
      endforeach;
      // Switch back to the current blog
      switch_to_blog( $original_blog_id );
      return $translated_url;
    }
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Switcher url with slug not id’ is closed to new replies.