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:
- Before proceeding, please make a full backup of your site
- Edit /woocommerce-multilingual/classes/Rest/Wrapper/ProductTerms.php line 75
- Replace the following code:
PHP
$response->data['translations'] = Fns::map( $getTermId, $this->wpmlTermTranslations->get_element_translations( $termTaxonomyId, $trid ) );
- 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 );
