woocommerce / woosidebars

Replace registered sidebars in your WordPress themes using different conditions such as a specific page, a category or even an individual blog post.
https://wordpress.org/plugins/woosidebars/
51 stars 42 forks source link

Fix compatybility with WPML #57

Closed kkarpieszuk closed 6 years ago

kkarpieszuk commented 7 years ago

Hi

I reported incompatibility with WPML to @mattyza by email. He asked me to create this as pull request, so I am doing it roght now

RiaanKnoetze commented 7 years ago

@mendezcode - this is one for you to look into :)

kkarpieszuk commented 7 years ago

hello, do you have any time estimation for this? :)

mendezcode commented 7 years ago

Hello @kkarpieszuk, I've been a bit busy with other things and haven't been able to look into this. I'll take care of this one next week. Apologies for the delay!

kkarpieszuk commented 6 years ago

hi @mattyza

yes, you can do this without switching true/false for suppress_filtrers

just before

$sidebars = get_posts( $args );

please add:

$current_language = apply_filters('wpml_current_language', false);
do_action('wpml_switch_language', 'all' );

and after get_posts switch language back with:

do_action('wpml_switch_language', $current_language );

this way you will also resolve my really stupid error with not checking ICL_LANGUAGE_CODE - replace it with $current_language.

kkarpieszuk commented 6 years ago

p.s. sorry for really late reply. i came here to ping you with reminderbut I found it is you who is waiting. I didn't get email notification that you are waiting, I am sorry once again

kkarpieszuk commented 6 years ago

Hello, I would like to remind you about this one more time :)

kkarpieszuk commented 6 years ago

thank you for fixing this! we will test on our side now