This thread is resolved. Here is a description of the problem and solution.
Problem:
If I duplicate the page that is set as privacy policy in WordPress Dashboard > Settings > Privacy, it does not allow me to add the page to the translated menu.
Solution:
Add the code below to functions.php file of your theme and it will be fixed:
add_filter( 'option_' . 'wp_page_for_privacy_policy', 'translate_privacy_policy_page'); function translate_privacy_policy_page($value){ if (apply_filters( 'wpml_element_has_translations', NULL, $value, 'page' )) { $value = apply_filters( 'wpml_object_id', $value, 'page', TRUE ); } return $value; }
This issue happens only if you duplicate the privacy policy page.
This is the technical support forum for WPML - the multilingual WordPress plugin.
Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.
Tagged: Bug
This topic contains 8 replies, has 2 voices.
Last updated by henrikR-17 1 year, 7 months ago.
Assisted by: Christopher Amirian.
Author | Posts |
---|---|
May 24, 2023 at 7:06 pm #13710873 | |
henrikR-17 |
I have created a Privacy Policy Page, and "translated" it by asking WPML to duplicate it. Now I want a link to it in a footer, so I try to create a menu and add the Privacy Policy Page to the menu. But when I press Save Menu, the Privacy Policy Page is removed from the menu, making it empty again. I am more or less following this guide: I have attached screen shots from before and after pressing the Save Menu button. Note, that many posts and pages on my site have an old 'Privacy policy' link imported from an old HTML website. |
May 25, 2023 at 8:08 am #13713439 | |
Christopher Amirian Supporter
Languages: English (English ) Timezone: Asia/Yerevan (GMT+04:00) |
Hi there, To make sure if WPML has anything to do with the issue please deactivate WPML Multilingual CMS and WPML Media plugins temporarily. Check if the issue is there, if yes, then it is not related to WPML. If the issue is gone when WPML is deactivated, please check for a possible plugin conflict: - IMPORTANT STEP! Create a backup of your website. Or better approach will be to test this on a copy/staging version of the website to avoid any disruption of a live website. Thanks. |
May 25, 2023 at 5:56 pm #13718575 | |
henrikR-17 |
Well... Deactivating WPML Media and WPML Multilingual CMS solved the problem... So I am afraid WPML is (part of) the problem. 🙂 |
May 26, 2023 at 6:33 am #13719891 | |
Christopher Amirian Supporter
Languages: English (English ) Timezone: Asia/Yerevan (GMT+04:00) |
Hi there, Thank you for following the steps. The typical troubleshooting is: - IMPORTANT STEP! Create a backup of your website. Or better approach will be to test this on a copy/staging version of the website to avoid any disruption of a live website. But I am not sure if this will help in your case scenario. For now please kindly follow the second part which is WPML plugins without other third party ones. If the issue still persists, please provide us with the login information of a copy/staging version of your website. That way we can troubleshoot without affecting the live website. If your website is under 1G we can give you the means to copy your website to our server. Please make the next reply as private. Thanks. |
May 26, 2023 at 1:03 pm #13723389 | |
henrikR-17 |
Dear WPML Already before this latest bug, I have had to conclude that WordPress is a fundamentally flawed and sick and inconsistent system that will never REALLY work. The only equally sick and fundamentally flawed software system I can recall was FAT32 and MS-DOS and the earliest versions of MS-Windows. I have tried deactivating 12 plugins - one at a time. That didn't solve anything. I have attached the list of plugins I deactivated. I did not deactivate essential plugins like Wordfence and Astra Pro. Considering that I have already had to conclude that WP is fundamentally flawed and impossible to make work, I cannot waste more time trying to make it work. The decision to learn WP in order to move my website from simple HTML to WP is one of the worst decisions I have taken in my life! I deeply regret it. I can give you a Duplicator copy of the whole site, if you want to experiment. Best regards, |
May 28, 2023 at 8:22 am #13727231 | |
Christopher Amirian Supporter
Languages: English (English ) Timezone: Asia/Yerevan (GMT+04:00) |
Hi Henrik, Sorry that you have such an experience. Yes, it will help if you give us a copy of the website for further investigation. Here is how to do so: https://wpml.org/faq/provide-supporters-copy-site/ Also, I'd appreciate it if you could give the login information by setting the next reply as private. |
May 28, 2023 at 11:36 am #13727791 | |
Christopher Amirian Supporter
Languages: English (English ) Timezone: Asia/Yerevan (GMT+04:00) |
Hi there, Thank you for the site copy. I reported this to the second-tier support. I will get back to you as soon as I have an update. |
May 29, 2023 at 1:48 pm #13732983 | |
Christopher Amirian Supporter
Languages: English (English ) Timezone: Asia/Yerevan (GMT+04:00) |
Hi there, Our awesome second-tier support found a workaround. Please follow the steps below: - Add the code below to your theme's functions.php file: add_filter( 'option_' . 'wp_page_for_privacy_policy', 'translate_privacy_policy_page'); function translate_privacy_policy_page($value){ if (apply_filters( 'wpml_element_has_translations', NULL, $value, 'page' )) { $value = apply_filters( 'wpml_object_id', $value, 'page', TRUE ); } return $value; } Then try to add the Privacy Policy page and it will work. The issue is escalated to our developers and the workaround above is temporary till aa permanent fix is available. Please inform us of the result. |
May 29, 2023 at 7:45 pm #13735197 | |
henrikR-17 |
I realized that I don't need a "Menu" in the footer, just a link (the same in all languages), which could be done with a 'Widget' in the 'Footer builder' in the theme customizer. So I did that instead. 🙂 |