WPML

Overview of the Issue

When you access a taxonomy using the REST API, it displays the wrong ID.

Workaround

This issue is fixed. Updating to the latest version solves it on your site, so you only need this workaround if you can’t update yet.

While we are working on a permanent fix you can try the following workaround:

  1. Before proceeding, please make a full backup of your site
  2. Edit /woocommerce-multilingual/classes/Rest/Wrapper/ProductTerms.php line 75
  3. Replace the following code:
    PHP
    $response->data['translations'] = Fns::map(
    	$getTermId,
    	$this->wpmlTermTranslations->get_element_translations( $termTaxonomyId, $trid )
    );
  4. With
    PHP
    remove_filter( 'terms_clauses', [ $this->sitepress, 'terms_clauses' ], 10 );
    remove_filter( 'get_term', [ $this->sitepress, 'get_term_adjust_id' ], 1 );
    $response->data['translations'] = Fns::map(
    	$getTermId,
    	$this->wpmlTermTranslations->get_element_translations( $termTaxonomyId, $trid )
    );
    add_filter( 'terms_clauses', [ $this->sitepress, 'terms_clauses' ], 10, 3 );
    add_filter( 'get_term', [ $this->sitepress, 'get_term_adjust_id' ], 1 );

All known issues

Still Seeing This Issue?

If updating doesn’t fix it, ask a support question and we’ll look into it with you.