[Решено] Inquiry About Automating URL Structure for Translated Posts
Это форум технической поддержки WPML – плагина для многоязычной WordPress.
Доступно для чтения всем, но только клиенты, купившие WPML, могут оставлять сообщения. Сотрудники WPML отвечают на сообщения форума 6 дней в неделю, 22 часов в сутки.
Сотрудники Службы поддержки сегодня не доступны на форуме Russian. Создайте обращение и мы возьмемся за решение вашего вопроса, как только будем в сети. Благодарим за понимание.
Предыстория вопроса:
I am currently managing a bilingual blog using the WPML plugin at скрытая ссылка. I first create a post in the default language with a URL like site.com/test-post. Then, I create a translation of this post into another language, such as Russian, which by default becomes site.com/ru/testoviy-post. I manually change this URL to match the original, resulting in site.com/ru/test-post. I have tried using the following code to automate this process:
Unfortunately, this solution did not work on my custom theme, nor on the default Twenty Twenty-Four theme.
Симптомы:
The provided code did not work on my custom theme or the default Twenty Twenty-Four theme.
Вопросы:
Is there any built-in functionality within WPML to automate the URL structure for translated posts?
Is there a specific hook or filter in WPML that I can use to achieve this automatically?
Вы также можете активировать опцию Translate (this will include the slug in the translation and not create it automatically from the title) в WPML → Settings → Translated documents options. То есть, при переводе страницы слаг будет добавлен на перевод (а не сгенерирован автоматически с заголовка), где Вы сможете его скопировать с оригинала.
Этот тикет теперь закрыт. Если Вы являетесь клиентом WPML и Вам нужна соответствующая помощь, пожалуйста, откройте новый тикет поддержки.