WordPress backend changes

Viewing 18 posts - 1 through 18 (of 18 total)
  • Author
    Posts
  • #46145
    Maurizio
    Participant

    Hi olly, I’m back;)
    I opened a ticket on wpml
    https://www.loom.com/share/510249e4f2f54e09ae5734141a4336a5
    https://wpml.org/it/forums/topic/backend-di-wordpress/ and together with a technician we understood that something is wrong with the compatibility between wpml and wppizza plugin.
    We can clearly see this because the WordPress backend changes language every time the language is changed, and it shouldn’t.
    Can I somehow help you correct this problem?
    Thanks Maurizio.

    #46147
    Olly
    Admin & Mod

    first of all, what versions of wppizza and wpml are we talking about please?

    #46148
    Olly
    Admin & Mod

    forget that question. i watched the video you linked to and figured it out from there what the versions are
    i’ll see what happens when i do this locally here first of all and will get back to you when i know more

    #46154
    Olly
    Admin & Mod

    Assuming you are happy to edit some php files (let me know if that is not the case )
    could you please try the following

    (I dont use WPML really as such , so it would be great if you could let me know if the below solves your problem and does not cause any others elsewhere before I makes this actually part of an update)

    in [your site path]/wp-content/plugins/wppizza/classes/class.wppizza.categories.php you will find at approx line 118 the following codeblock

    
    if(function_exists('icl_get_languages')){
    	global $sitepress;
    	$languages = icl_get_languages();
    	/**loop through non current languages to get categories**/
    	foreach($languages as $lang_code=>$lang_arr){
    		if($lang_code!=ICL_LANGUAGE_CODE){
    			$sitepress->switch_lang($lang_code);
    			/*get cats for that language**/
    			$wpml_sort_cats_lang[$lang_code] = get_categories($args);
    		}
    	}
    	/**make sure we switch back to current language when done**/
    	$sitepress->switch_lang(ICL_LANGUAGE_CODE);
    }
    

    REPLACE that whole codeblock with

    
    if(function_exists('icl_get_languages')){
    	global $sitepress;
    	$languages = icl_get_languages();
    	/**loop through non current languages to get categories**/
    	foreach($languages as $lang_code=>$lang_arr){
    		if($lang_code!=ICL_LANGUAGE_CODE){
    			$sitepress->switch_lang($lang_code);
    			/*get cats for that language**/
    			$wpml_sort_cats_lang[$lang_code] = get_categories($args);
    		}
    		
    		/**make sure we switch back to current language when done**/
    		$sitepress->switch_lang(ICL_LANGUAGE_CODE);				
    	}
    }
    

    i.e move the second ->switch_lang() inside the loop
    let me know if that solves the issue in your case too – seems to work fine when i do this here in a test environment

    #46163
    Maurizio
    Participant

    I made the required changes.
    It only works in part, the main language of the site is in Italian.
    1. Italian (perfect)
    2. English (only a part)
    3. Spanish (only part of it)
    4. Russian (only a part)
    5. French (only a part)

    If you want to experiment with my site, I have a backup of the files and the database, if you need a username and password, tell me which email to send them to.

    #46165
    Olly
    Admin & Mod

    when you are saying “only a part of it”
    which “parts” in particular do not work…
    (admin? frontend? some global text strings ? or particular plugins/themes only ?)

    #46166
    Maurizio
    Participant

    I speak of the WORDPRESS BACKEND.
    But this is safely connected to the problem I have in this post:
    https://www.wp-pizza.com/topic/wpml-string-translation-update/

    https://www.loom.com/share/e4d3609cd6b94dbf986484f2ac50519b

    #46168
    Olly
    Admin & Mod
    This reply has been marked as private.
    #46169
    Maurizio
    Participant
    This reply has been marked as private.
    #46172
    Olly
    Admin & Mod

    i’m a bit confused now
    if I go here:
    https://www.[yoursite].it/wp-admin/plugins.php
    i get different languages in the descriptions (quite probably because the plugins and their descriptions have no IT translation)
    even though WPPizza is DE-activated ???
    So i assume you are not actually referring to this ?!

    if i look at my clone of your site here now i get the same plugins names/descriptions (/wp-admin/plugins.php) as well as the same admin labelling – i.e the stuff on the left like “Media”, “Pagine”, “Prodotti” “Openig Hours” etc etc (/wp-admin)
    regardless of whether wppizza is active or not (i can show you screenshots if you like)

    i must be missing something…:(
    please can you give me a distinct example (some text/heading/label somewhere) that changes/is different
    depending on whether wppizza is activated or not ….

    #46175
    Maurizio
    Participant

    no sorry, I realized that wppizza was disabled, I will make a detailed report. and I send you everything.

    #46174
    Maurizio
    Participant

    Something you did, because now everything works perfectly, let’s see if you have also solved the problem I had in this post.
    https://www.wp-pizza.com/topic/wpml-string-translation-update/
    I’ll tell you if it’s fixed over time.

    #46177
    Maurizio
    Participant
    This reply has been marked as private.
    #46180
    Olly
    Admin & Mod

    thanks for the screenshots. they help a lot and i think i know where the issue is now (just need to find a few variables that are set by WP/WPML)
    will post back here when I think i solved it

    #46190
    Olly
    Admin & Mod
    This reply has been marked as private.
    #46239
    Maurizio
    Participant

    Hi Holly,
    I checked the changes you told me, now I’m happy to tell you that everything works as I wanted.
    I will be able to tell you if with this change, you have also solved the problem:
    https://www.wp-pizza.com/topic/wpml-string-translation-update/

    #46240
    Olly
    Admin & Mod

    Good stuff.
    happy to hear it. I’ll make that part of the next wppizza update.

    Thanks for letting me know / testing the fix

    #46245
    Maurizio
    Participant

    Can I advise you to contact wpml and have it inserted as plugins that are completely compatible with wpml plugin?

    They can put you on their list.

Viewing 18 posts - 1 through 18 (of 18 total)
  • The topic ‘WordPress backend changes’ is closed to new replies.