Fix Raw ML term names when i18n config is already initialized#1492
Open
Komarovski wants to merge 1 commit into
Open
Fix Raw ML term names when i18n config is already initialized#1492Komarovski wants to merge 1 commit into
Komarovski wants to merge 1 commit into
Conversation
Fix `qtranxf_get_term_joined()` so that it always restores the complete Raw ML term name from the language values stored in `i18n_config['name']['ts']`. Previously, the Raw ML value was rebuilt only when `i18n_config` had not yet been initialized. If the term object already contained `i18n_config`, its `name` property could remain translated into the currently active language instead of containing the complete multilingual value. This caused taxonomy term fields in the WordPress admin to display only one language after saving, for example: `Wallpapers` instead of: `[:en]Wallpapers[:uk]Шпалери[:]` The updated function initializes `i18n_config` when necessary and then independently rebuilds both: ` $obj->name $obj->i18n_config['name']['ml'] ` from `i18n_config['name']['ts']`. The issue became visible after updating WordPress from 6.8.5 to 7.0.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix
qtranxf_get_term_joined()so that it always restores the complete Raw ML term name from the language values stored ini18n_config['name']['ts'].Previously, the Raw ML value was rebuilt only when
i18n_confighad not yet been initialized. If the term object already containedi18n_config, itsnameproperty could remain translated into the currently active language instead of containing the complete multilingual value.This caused taxonomy term fields in the WordPress admin to display only one language after saving, for example:
Wallpapersinstead of:
[:en]Wallpapers[:uk]Шпалери[:]The updated function initializes
i18n_configwhen necessary and then independently rebuilds both:$obj->name $obj->i18n_config['name']['ml']from
i18n_config['name']['ts'].The issue became visible after updating WordPress from 6.8.5 to 7.0.