mishmasha
Forum Replies Created
-
Forum: Developing with WordPress
In reply to: get_permalink after switch_to_blog functionThanks, I understand that they are separate. I don’t understand how I can get URL of the linked page by post ID from another blog using another blog permalink structure.
What should I query first?Forum: Developing with WordPress
In reply to: get_permalink after switch_to_blog functionHey Joy! Thanks for the response.
Main thing, I’m getting correct page, except this wrong untraslated rewrite slug. I can show this part (will remove additional checks for better reading)foreach( $language_blogs as $blog_id => $language_id ) { if (!array_key_exists($blog_id, $linked_pages)) continue; switch_to_blog($blog_id); $post_id = $linked_pages[$blog_id]; $url = get_permalink($post_id); $links[$language_id] = $url; restore_current_blog(); }As you can see, I pass correct post ID to the get_permalink function. But it is being built using permalink structure from CURRENT blog, and not the switched one.
So don’t understand if I’m doing something wrong?Hello!
I have the same issue on my site: I’m using WPML and directory for languages.
So I can’t even see renamed login page, as I’m redirecting to frontpage.
Any advices?