Skip Navigation

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 6 replies, has 2 voices.

Last updated by Laura 2 years, 8 months ago.

Assigned support staff: Laura.

Author Posts
March 15, 2019 at 8:24 am #3351919

WP-Stars

I have the follwing code:

	$categories = get_terms(array(
		'taxonomy' => 'category',
		'orderby'    => 'slug',
                'order'      => 'ASC'
	));
	foreach ($categories as $category) {
...

It always retrieved the terms of the current language. But now all of the terms are retrieved, english and german.
Wordpress 5.1.1
WPML 4.2.4.1
Terms/CPT created with Toolset 2.3.5

March 15, 2019 at 5:21 pm #3355971

Laura
Supporter

Languages: English (English ) Italian (Italiano )

Timezone: Europe/Rome (GMT+01:00)

Hi,

thanks for contacting us.

When did this start to happen, after an update?
I would also need your WPML debug information. You can find it in:
WPML -> Support -> click on debug information link
Then you can copy/paste the text you see in the Debug box I'll enable for the next answer.
More information here: http://wpml.org/faq/provide-debug-information-faster-support/

March 18, 2019 at 7:43 am #3366483

WP-Stars

Thank you for your answer.
Here is the debug information.
I can't tell if it happened after an update, since I don't know since when the problem occurs and when the last update was - but it's likely.

March 18, 2019 at 2:03 pm #3369915

Laura
Supporter

Languages: English (English ) Italian (Italiano )

Timezone: Europe/Rome (GMT+01:00)

Hi,

could you try this and see if it works better?

$categories = get_terms(array(
        'taxonomy' => 'category',
        'orderby'    => 'slug',
                'order'      => 'ASC',
         'suppress_filters' => false
    ));
March 18, 2019 at 2:10 pm #3370105

Laura
Supporter

Languages: English (English ) Italian (Italiano )

Timezone: Europe/Rome (GMT+01:00)

Sorry, I sent my previous message without finishing it.

If this doesn't help, could you try a compatibility issue?

- backup your site
- disable all plugin except WPML and its addons and Toolset
- switch to a default theme like TwentySeventeen
- check if the issue is happening again
- if it's not, reactivate your plugins one by one, checking every time if the issue shows up again
- lastly, reactivate your theme

March 18, 2019 at 2:12 pm #3370139

WP-Stars

Unfortunately this is not working.
Is there any way to get an earlier Version of the wpml Plugin?
I'd like to test if the problem occurred in an earlier version too.
Our Backups only reach to the 15th of February, where version 4.2.4.1 already was.

March 18, 2019 at 2:29 pm #3370249

Laura
Supporter

Languages: English (English ) Italian (Italiano )

Timezone: Europe/Rome (GMT+01:00)

Hi,

previous WPML versions are available here: https://wpml.org/download/wpml-multilingual-cms/?section=changelog

However you can also try a compatibility test as I suggested here: https://wpml.org/forums/topic/get_terms-gets-terms-of-all-languages-instead-of-the-current-language/#post-3370105

The topic ‘[Closed] get_terms gets terms of all languages instead of the current language’ is closed to new replies.