Skip to content Skip to sidebar

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.

This topic contains 1 reply, has 2 voices.

Last updated by Nicolas V. 1 year, 9 months ago.

Author Posts
November 29, 2023 at 6:40 pm #14955259

zakW

Using the following functions and possibly other related functions that retrieve posts terms are returning incorrect results.

- get_terms()
- wp_get_post_terms()
- wp_get_object_terms()

This can be replicated on this page: hidden link. And by using the "select your region" filter. (Please refer to the attached image).

Filtering is not working correctly as that element is relying on injected terms via wp_get_post_terms() on the post's data attribute.

Disabling WPML makes the functionality working as intended. The template file that handles this functionality is this: hidden link

wpml-support ticket.png
December 1, 2023 at 4:10 pm #14974559

Nicolas V.
Supporter

Languages: English (English ) French (Français )

Timezone: America/Lima (GMT-05:00)

Hi,

Welcome to the WPML support forum. Thanks for contacting us.

We are currently handling a high amount of ticket and while waiting for one of my colleagues to help with this ticket, please allow me to walk you through some initial debugging steps.

Could you please have a look at our 'wpml_object_id' hook: https://wpml.org/wpml-hook/wpml_object_id/

And Radu's answer here to see an example: https://wpml.org/forums/topic/get-translated-terms-with-get_the_terms/#post-6482389

Nico

The topic ‘[Closed] get_terms() / wp_get_post_terms() returning incorrect results’ is closed to new replies.