تخطي الملاحة
Sun Mon Tue Wed Thu Fri Sat
12:00 – 20:00 12:00 – 20:00 12:00 – 20:00 12:00 – 20:00 12:00 – 20:00 - -
- - - - - - -

المنطقة الزمنية الداعمة: Asia/Karachi (GMT+05:00)

الوسوم: 

يحتوي هذا الموضوع رد واحد ، لديه 1صوت.

آخر تحديث بواسطة hissamK-2 قبل 3 أشهر.

يساعده: Noman.

مؤلف المقالات
نوفمبر 7, 2024في 11:44 ص #16376830

hissamK-2

Background of the issue:
I am using WPML with a WordPress site at الرابط المخفي. I am trying to get the permalink for a translated post. I am using a WP query to get posts from the database and then creating an array to store data in Elastic Search. I have tried using the documentation's suggested methods: $object_id = apply_filters('wpml_object_id', $post->ID, $post->post_type); $post_link = apply_filters('wpml_permalink', get_the_permalink($post->ID), $language_code); I tried both combinations with post id and $object_id.

Symptoms:
I am unable to get the permalink for a specific post ID using the methods suggested in the documentation.

Questions:
How can I get the permalink for a translated post using WPML?
What is the correct way to use wpml_object_id and wpml_permalink filters?

الموضوع '[مغلق] How to get Permalink for translated POST ' مغلق أمام الردود الجديدة.