get_permalink after switch_to_blog function
-
Hey guys!
We have multisite, that is handles different languages of same site (mainsite.com, mainsite.com/it – for italian version, mainsite.com/de for germany, etc)
We have custom post types on the site (for example “books”) with TRANSLATED url rewrite slug (like mainsite.com/books/book1, mainsite.com/it/libri/prenota1, mainsite.com/de/bucher/buch1) – we add translated slug when register_post_type is launched . Also we store connection between these posts in the database (so they linked).
For such posts we want to show, that they have translated versions.We was trying to use native WP multisite functional like switch_to_blog() and get_permalink() functions, but unfortunately we’ve stacked, as get_permalink() returns link using CURRENT rewrite slug
It shows mainsite.com/it/books/prenota1, mainsite.com/de/books/buch1
when you’re on the main site and mainsite.com/libri/book, mainsite.com/de/libri/buch1
when you’re on Italian version.Is it correct that after switch_to_blog() function permalink structure remains the same? because in such situation using native WP functional is not really useful ??
- The topic ‘get_permalink after switch_to_blog function’ is closed to new replies.