Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add hooks for terms #39

Closed
wants to merge 19 commits into from
Closed

Add hooks for terms #39

wants to merge 19 commits into from

Conversation

soft79
Copy link

@soft79 soft79 commented Feb 24, 2015

get_terms will translate all terms (for example for the tag cloud)
term_description will translate the term description (for example for themes that show the WooCommerce product category description)

get_terms will translate all terms (for example for the tag cloud)
term_description will translate the term description (for example for themes that show the WooCommerce product category description)
@@ -225,6 +225,9 @@ function qtranxf_wpseo_replacements($replacements){
add_filter('link_description', 'qtranxf_useCurrentLanguageIfNotFoundUseDefaultLanguage',0);
add_filter('the_author', 'qtranxf_useCurrentLanguageIfNotFoundUseDefaultLanguage',0);

add_filter('get_terms', 'qtranxf_useCurrentLanguageIfNotFoundUseDefaultLanguage',0);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Filter 'get_terms' is already in the code at line 484 in qtranslate_frontend.php. Did you test it, btw? Since terms are translated with a different method other than useCurrentLanguageIfNotFoundUseDefaultLanguage and I do not see how your filter can work.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did test it. It probably works here because I imported the terms with my W2Q: WPML to qTranslate tool and I wasn't aware that terms were translated a different way. Any reason why terms are treated differently?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, translations of terms are stored differently in database.

mweimerskirch and others added 18 commits March 1, 2015 17:44
…se the translations are not available inside the constructor

Fixes #43
Replaced mysql_real_escape_string with $wpdb->prepare to avoid errors happening under PHP 5.5
Corrected country flag for original 'pt' localization
Corrected text and localization codes from Brazil to native Portuguese (pt_BR to pt_PT)
WordPress have 'pt' and 'pt_BR', pt as native PT and uses _BR sufix for Brazil localization.
* Textarea was not highlighted in Text mode, and in Visual mode only if it was already in Visual mode on page load
* Also fixes the problem of the class name being added multiple times
@tyteen4a03
Copy link

How do I disable this behaviour temporarily? remove_filter seemed to have no effect.

@johnclause
Copy link
Member

@tyteen4a03: which filter? which behaviour? This issue is awfully obsolete and outdated. Please, open a new issue with a step-by-step description of how to reproduce your specific problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants