function custom_post_rewrite_rule() {
add_rewrite_rule('^post/([^/]+)/?', 'index.php?post_type=post&name=$matches[1]', 'top');
}
add_action('init', 'custom_post_rewrite_rule');
Link to a page where the issue can be seen: скрытая ссылка
Symptoms:
After adding translation to the post, WPML switcher is broken for this post.
Questions:
How can I ensure the correct URLs with /post/ and correct lang slug in the language switcher?
What is the correct solution compatible with WPML for this issue?
Тема '[Закрытые] Can't correct add /post/ before post slug' закрыта для новых ответов.