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: String Translation
Related documentation:
This topic contains 34 replies, has 6 voices.
Last updated by valentinG-8 6 months, 3 weeks ago.
Assigned support staff: Shekhar Bhandari.
Author | Posts |
---|---|
April 21, 2017 at 10:56 am #1258905 | |
Henrik |
I am trying to: Steps to duplicate the issue: |
April 21, 2017 at 12:01 pm #1258954 | |
Henrik |
I was able to implement a temporary work around like this: global $wpml_slug_translation; // Disable post_type_link_filter $wpml_slug_translation->ignore_post_type_link = true; $new_permalink = get_permalink( $post_id ); // Enable post_type_link_filter $wpml_slug_translation->ignore_post_type_link = false; // Manually run post_type_link_filter, the 3rd and 4th arguments causes the cache signature to be different from the one in the cache. $new_permalink = $wpml_slug_translation->post_type_link_filter($new_permalink, $post, 0, 0); However this fix doesn't feel very future proof at all, a more permanent fix from the WPML team would be much appreciated. |
April 24, 2017 at 3:56 am #1259862 | |
Shekhar Bhandari Supporter
Languages: English (English ) Timezone: Asia/Kathmandu (GMT+05:45) |
Hello @henrik, Thank you for contacting WPML support. I'd be happy to help you on this. Could you please provide me further details how you are using the wp_insert_post, are you using wp_insert_post for updating usage? Could you please provide me the whole code that you are using in pastebin.com so I can review it and replicate the issue if necessary? I look forward to your reply. Thanks |
April 24, 2017 at 8:24 am #1259990 | |
Henrik |
The purpose of this code is to print the new URL to the error_log when a post is updated. |
April 25, 2017 at 9:10 am #1261058 | |
Shekhar Bhandari Supporter
Languages: English (English ) Timezone: Asia/Kathmandu (GMT+05:45) |
Hi there, I am working on this issue and will post my feedback soon. Thanks |
April 25, 2017 at 10:27 am #1261131 | |
Shekhar Bhandari Supporter
Languages: English (English ) Timezone: Asia/Kathmandu (GMT+05:45) |
Hi there, I tested this code with few installations and I couldn't replicate the same issue as you explained as I am able to see the correct URL for the post. I also tested the same with save_post action and it's printing me correct results. So, I would request you to test the issue on a new browser and clearing cache too. Also, Please make sure you are using the latest version of WPML and its add-ons. We've released new versions that fix many bugs and errors for some days. You can compare between your site and here: http://wpml.org/my-account/downloads/ NOTE: I look forward to your reply. Thanks |
April 25, 2017 at 11:06 am #1261171 | |
Henrik |
I have put together a plugin that will allow you to replicate the issue: The following plugins are required: The following settings need to be enabled: I can also provide access to a testing site demonstrating the issue. |
April 26, 2017 at 9:28 am #1262033 | |
Shekhar Bhandari Supporter
Languages: English (English ) Timezone: Asia/Kathmandu (GMT+05:45) |
Hi there, Sure, please provide me those details as well as clear steps to reproduce the issue to reproduce it as with the plugin you provided too, I don't find any issue in the future. I need to request temporary access (wp-admin and FTP) to your site in order to be of better help. You will find the needed fields for this below the comment area when you log in to leave your next reply. hidden link This info is private and available to you and supporters only. Read more about this: https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/ Note that: We'd like to request the permission to disable, enable and install themes and plugins for this site. Please accept this? I look forward to your reply. Thanks |
April 27, 2017 at 3:03 am #1262836 | |
Shekhar Bhandari Supporter
Languages: English (English ) Timezone: Asia/Kathmandu (GMT+05:45) |
Hi there, Ok, I tested this on your site and I can retrieve the new permalink there too, so I am confused where is the error. Could you please check this once again? I look forward to your reply. Thanks |
April 27, 2017 at 8:55 am #1263038 | |
Henrik |
My bad, I had not translated the post slug. Which is needed to replicate the issue. |
April 28, 2017 at 5:31 am #1263964 | |
Shekhar Bhandari Supporter
Languages: English (English ) Timezone: Asia/Kathmandu (GMT+05:45) |
Hi there, If you remove the following code from the above code you provided, the issue is not existing, so please remove this and try once. add_action( 'pre_post_update', function() { get_permalink(); }); Look forward to your reply. Thanks |
April 28, 2017 at 11:28 am #1264230 | |
Henrik |
Yes, the point of the plugin is to demonstrate how to replicate the issue. Please see the first paragraph of my first post in this thread for an explanation of why the issue occurs. I believe I have provided enough information to allow a WPML developer to solve the issue. |
May 1, 2017 at 9:14 am #1265323 | |
Shekhar Bhandari Supporter
Languages: English (English ) Timezone: Asia/Kathmandu (GMT+05:45) |
Hi there, I am discussing this issue with our 2nd tier supporters and will respond to you soon. Thanks |
May 3, 2017 at 12:11 pm #1267104 | |
Shekhar Bhandari Supporter
Languages: English (English ) Timezone: Asia/Kathmandu (GMT+05:45) |
Hi there, This is to inform you that I am still discussing this issue with our 2nd tier supporters and will respond to you soon. Thanks |
May 4, 2017 at 8:21 am #1267754 | |
Shekhar Bhandari Supporter
Languages: English (English ) Timezone: Asia/Kathmandu (GMT+05:45) |
Hi @henrik, After a lot of discussing and debugging our 2nd tier support suggest that you can use "save_post" hook instead of "post_updated" hook to get the correct permalink. They also suggested that WPML runs a lot of functions on the save_post hook so it will be nice to use this hook instead of post_updated. Let me know if that helps. Thanks |