dbriard
Forum Replies Created
-
Forum: Plugins
In reply to: [Polylang] language switcher and url parametersHi Chouby,
I forgot to thank you for the reply, I will take a look at pll_translation_url, which I didn’t know about.
Thanks!
Forum: Plugins
In reply to: [Polylang] Strange thing Polylang WoocommerceI’ve found where the problem is and a workaround.
in links-permalinks.php
When PageBuilder is disabled:
get_translated_post_types: Array ( [post] => post [page] => page [attachement] => attachment [0] => product [1] => cookielawinfo ) get_translated_taxonomies: Array ( [category] => category [post_tag] => post_tag [0] => product_cat [1] => product_tag [2] => product_shipping_class [3] => pa_print-size [4] => pa_finish [5] => city [6] => country [7] => camera [8] => lens [9] => region [10] => location [11] => aspect [12] => treatment [13] => keyword ) get_filtered_taxonomies: Array ( [post_format] => post_format )When it is enabled:
get_translated_post_types: Array ( [post] => post [page] => page [attachement] => attachment ) get_translated_taxonomies: Array ( [category] => category [post_tag] => post_tag ) get_filtered_taxonomies: Array ( [post_format] => post_format )My workaround is to add the missing types in function.php of my theme
function fix_rewrite_rules($types) { $force_rewrite = array('product', 'country', 'aspect', ...); $types = array_merge($force_rewrite, $types); return $types; } if (function_exists('pll_get_post')) { add_action( 'pll_rewrite_rules', 'fix_rewrite_rules'); }Do you know if it is a problem related to Polylang or PageBuilder?
Forum: Plugins
In reply to: [Polylang] Strange thing Polylang WoocommerceWell, I disabled all the plugins except woocommerce and polylang, then reactivated plugins one by one.
The problem appear when SiteOrigin-PageBuilder is a active! I will look at it more in depth and notify you if I fix the issue.
Forum: Plugins
In reply to: [Hyyan WooCommerce Polylang Integration] Can't display localized product pageHi Hyyan and thanks for the replies!
I tried to disable all the plugin then reactive one by one and it look like its because of SiteOrigin-PageBuilder – the first plugin I ever installed.
I also discover that the problem is related to rewrite rules.
When I activate Polylang (with your plugin disabled) for the first time. I have a lot of rules such as:
[(fr)/product/([^/]+)(/[0-9]+)?/?$] => index.php?product=$matches[2]&page=$matches[3]
But if rules are flushed (for exemple, if I save on Permalinks page), all the Polylang rules are removed (or not added anymore) of the $wp_rewrite->rules array.
Pages and posts translation still work, but all custom taxonomies translation not not work anymore, so its not related to WooCommerce as I thinked in the first place.
You can close the ticket as it is not related to polylang/woocommerce or your plugin.
By the way, if you know how to fix that issue, don’t hesitate π
Best regards and thanks a lot!
Forum: Plugins
In reply to: [Polylang] Strange thing Polylang WoocommerceAfter more search, it look like its related to rewrite rules.
When I activate Polylang for the first time. I have a lot of rules such as:
[(fr)/product/([^/]+)(/[0-9]+)?/?$] => index.php?product=$matches[2]&page=$matches[3]
But if rules are flushed (for exemple, if I save on Permalinks page), all the Polylang rules are removed (or not added anymore) of the $wp_rewrite->rules array.
Pages and posts translation still work, but all custom taxonomies translation not not work anymore. So its not related to WooCommerce.
Is this a know problem in Polylang?
Is there something I can do?Forum: Plugins
In reply to: [Hyyan WooCommerce Polylang Integration] Can't display localized product pageHere are more information.
I added add_action( ‘pre_get_posts’, ..) in my theme function.php and printed $query->query_vars;
When it worked:
Array ( [page] => [product] => print-eiffel-tower [post_type] => product [name] => print-eiffel-tower [attachment] =>When it don’t work:
Array ( [attachment] => tirage-tour-eiffelI have no idea why….
Forum: Plugins
In reply to: [Polylang] Strange thing Polylang WoocommerceHere are more information.
I added add_action( ‘pre_get_posts’, ..) in my theme function.php and printed $query->query_vars;
When it worked:
Array ( [page] => [product] => print-eiffel-tower [post_type] => product [name] => print-eiffel-tower [attachment] =>When it don’t work:
Array ( [attachment] => tirage-tour-eiffelI have no idea why….
Forum: Plugins
In reply to: [Polylang] Media Taxonomy Filtering in Edit pageYes I am using a plugin called Types to categorize my images with taxonomies such as keyword (hierarchical), country, city…. And I modified my thΓ¨me to display dynamic galleries as archives based on these taxonomies. For example: http://www.davidbriard.com/fr/city/paris-fr
Types plugin: https://ww.wp.xz.cn/plugins/types/
Forum: Plugins
In reply to: [Polylang] Media Taxonomy Filtering in Edit pageHi, thanks for your help!
I changed your terms_clauses function by adding:
if ($_GET['lang'] == 'undefined' && isset($_GET['pll_post_id']) && is_numeric($_GET['pll_post_id'])) $lang = $this->model->get_post_language($_GET['pll_post_id']);here:
// FIXME can we simplify how we deal with the admin language filter? // the language filter selection has just changed // test $screen->base to avoid interference between the language filter and the post language selection and the category parent dropdown list elseif (!empty($_GET['lang']) && !(isset($screen) && in_array($screen->base, array('post', 'edit-tags')))) { if ($_GET['lang'] == 'undefined' && isset($_GET['pll_post_id']) && is_numeric($_GET['pll_post_id'])) $lang = $this->model->get_post_language($_GET['pll_post_id']); elseif ($_GET['lang'] != 'all') $lang = $this->model->get_language($_GET['lang']); elseif ($screen->base == 'edit-tags' && isset($args['class'])) $lang = $this->pref_lang; // parent dropdown }I am not sure if it had side-effects… but it works for images.
The non filtering of images-taxonomy, is that a bug? or something that you can fix in future builds? So that I will not need to modify after each update.
I really don’t understand why posts attached to media have a different behavior than normal posts in regards to $_GET[‘lang’].
Thank you. You can consider this post as resolved π
Forum: Plugins
In reply to: [Polylang] Problem translating media in a loopAwesome!
The two tick icons made me think that both langages was set, but in fact none was set π
That work perfectly now, thank you!
I will keep improving by translating the taxonomy with the image at the same time.
Thank a lot!
Forum: Plugins
In reply to: [Polylang] Possible to have a item with several langages?Ok, thanks for your awswer, I will continue to duplicate.
Forum: Plugins
In reply to: [Polylang] Media Taxonomy Filtering in Edit pageHi,
Thanks for the clue.I am looking into terms_clauses.
It look like for media, the language cannot be retrieved.On both pages, $lang is set on line 571, after the comment
// FIXME can we simplify how we deal with the admin language filter?In Edit Post page, $_GET[‘lang’] return “fr”;
In Edit Media page, $_GET[‘lang’] return “undefined”;Any idea how to get the right value in $lang for media? I mean the value in the Language panel drop down list?
The only value with ‘fr’ seems to be $this->pref_lang but I think it is related to the topmost drop down list.
Best regards,
Forum: Plugins
In reply to: [Polylang] url format without langcode for default languageHi Chrystl,
Thanks a lot! I did not see that option :$Forum: Plugins
In reply to: [Polylang] Translating Custom Media TaxonomyThanks a lot for your reply.
I hope the idea is on a good position on your todo list π
And I will take a look at your code to try to deal with my images.