Background of the issue:
I am trying to localize JavaScript with the translated URL using WPML. I am using the following code: apply_filters( 'wpml_permalink', get_the_permalink( $id), 'fr' );.
Note: The CPT titles are translated, and the translated URLs work elsewhere as expected.
Symptoms:
The function wpml_permalink is returning the original URL in the correct language directory instead of the fully translated URL. I am passing /myslug/in-english/ and getting /fr/myslug/in-english/, but I want /fr/myslug/en-anglais/.
Questions:
Will wpml_permalink only work as I wish at certain points in the request lifecycle?
ניהול הסכמה לקובצי Cookie
אנו משתמשים בקובצי Cookie כדי לייעל את האתר והשירותים שלנו. הסכמתך מאפשרת לנו לעבד נתונים כגון התנהגות גלישה. אי הסכמה עשויה להשפיע על תכונות מסוימות.
פונקציונלי
תמיד פעיל
נדרש כדי שהאתר שלנו יפעל ויתקשר בצורה נכונה.
העדפות
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
סטטיסטיקה
אנו משתמשים בהם כדי לנתח את הנתונים הסטטיסטיים של האתר שלנו. המידע שנאסף הוא אנונימי לחלוטין. האחסון או הגישה הטכנית שמשמשים באופן בלעדי לצרכים סטטיסטיים אנונימיים. ללא זימון, הסכמה וולונטרית מצד ספק שירותי האינטרנט שלך, או רשומות נוספות מצד שלישי, המידע המאוחסן או המוחזר למטרה זו בלבד לא ניתן בדרך כלל לשימוש לצורך זיהויך.
שיווק
קובצי Cookie אלה עוקבים אחר הגלישה שלך כדי לספק מודעות רלוונטיות עבורך.