Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
The client was experiencing issues with translating slugs for a custom post type slug that comes from the plugin Citadela, that was showing up on WPML->Settings->Post Types Translation.

Solution:
Firstly, we recommended that any code changes should indeed be made in the child theme to prevent them from being overwritten during plugin updates. Regarding the slug translation issue, we provided the following steps:

1. Navigate to the file

/wp-content/plugins/citadela-directory/plugin/cpt/item/CitadelaItem.php

.
2. On line 31, locate the following code:

add_action('init', array(__CLASS__, 'citadelaOnInit'), 20, 0);

3. Change it to:

add_action('init', array(__CLASS__, 'citadelaOnInit'), 0);

4. After making the change, go to WPML -> Settings -> Custom post type translation -> Items (citadela-item), enter the translation for "lieu", and click "Save".

We also emphasized the importance of having a full backup of the website before making any updates or changes.

Please note that this solution might be irrelevant due to being outdated or not applicable to your case. If the issue persists, we highly recommend checking related known issues, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If necessary, do not hesitate to open a new support ticket for further assistance at WPML support forum.

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Tagged: 

This topic contains 30 replies, has 2 voices.

Last updated by Marsel Nikolli 9 months, 3 weeks ago.

Assisted by: Marsel Nikolli.

Author Posts
December 21, 2023 at 2:49 pm #15111483

Marsel Nikolli

It should be set to private now.

Thanks,
Marsel

December 22, 2023 at 4:28 pm #15119831

Marsel Nikolli

Hi,

Thank you for providing the access, I was also managed to get a copy using the Duplicator plugin.

Could you please tell me how I can access to the maps in order to check the issue?

Thanks,
Marsel

December 22, 2023 at 6:36 pm #15121575

Mary

Ok, so I had mentioned this before and I am reconfirming: you'll have to work on our "live" (but not public) site, not the staging site or a copy, because the maps don't appear on the staging site. There's a warning saying it's a trial version of the plugin and that we need to purchase another membership of the plugin to make it work on these copy sites.

The maps are supposed to appear here and here:
hidden link
hidden link

On our live site, you can see them here:
hidden link
hidden link

December 26, 2023 at 9:54 am #15129331

Marsel Nikolli

Hi,

Thanks for the update and sorry for the late reply due to Christmas holidays.

I didn't check the "live" (but not public) site before as I remember you were working on it, anyway I will check the maps there and will get back at you as soon as possible.

Thanks,
Marsel

December 30, 2023 at 2:20 am #15137840

Mary

Ok thanks. I'm not working on the site due to the holidays. I will work again on it starting on Thurs. Jan 4. Thanks!

January 3, 2024 at 5:28 pm #15148256

Marsel Nikolli

Hi,

I wish you a Happy New Year!

I was able to test further the issue locally and on a sandbox website using the Trial version of the Citadela theme/plugin. To further investigate the issue I escalated it to the 2nd tier support team.

I'll update you as soon as I have an update from the team.

* Note: I gave your "Live" (not yet production website) login details to the team in case any checking will be needed on your website.

Thank you and kind regards,
Marsel

January 9, 2024 at 1:02 pm #15164547

Marsel Nikolli

Hi,

I've got an update form the team and they suggested to try the workaround below:
- Go to: wp-content/plugins/citadela-directory/plugin/includes/CitadelaDirectoryFunctions.php
In the code: \CitadelaDirectoryFunctions::guessMapEndpoint find the following:

$queryString = build_query( $data );

		return site_url() . "/wp-json/citadela-directory/map-data/points/{$postType}?{$queryString}";
    }

and change it to:

		if (ICL_SITEPRESS_VERSION) {
			$data['lang'] = apply_filters( 'wpml_current_language', null );
		}
        $queryString = build_query( $data );

		return site_url() . "/wp-json/citadela-directory/map-data/points/{$postType}?{$queryString}";
    }

After, please check if the issue with the map persists and let me know.

* Note: Please make sure you have a full backup of your website before making any changes on your website.

Looking forward to your reply,
Marsel

January 9, 2024 at 7:19 pm #15166271

Mary

Hi Marsel, this fixed the issue! Thanks so much, I really appreciate it. Is this something I should do in the child theme instead of directly in the plugin folder?

Now I think the only issue left is the slug. Is this something you can test on the sandbox website you created?

January 10, 2024 at 10:54 am #15168119

Marsel Nikolli

Hi,

Glad to hear that the issue with the map is resolved.
You'll need to keep the code on the plugin file as instructed on the previous reply.

I'll do a final test locally with the slug issue and will let you know as soon as I am done.

Thanks,
Marsel

January 22, 2024 at 4:20 pm #15212813

Mary

Hi, I got a notice that support is waiting for my response, so I just want to check in to see if you found anything about the slug issue. Thanks!

January 23, 2024 at 4:21 pm #15218248

Marsel Nikolli

Hi,

I apologize for the delay on the response.

I did manage to test locally, but unfortunately, without success. I just checked the staging site you provided earlier: hidden link.

Would it be possible to update the plugins on that setup (as there are a few pending) and check if the issue persists and let me know?

If it does persist, I'll need to escalate the problem to the 2nd tier support team.

---

* On the duplicator package and on the staging site mentioned above, I noticed that you have installed the "Loco translate" plugin, are you using it for any specific purpose on the website?

Looking forward to your reply,
Marsel

January 26, 2024 at 9:33 pm #15231745

Mary

Hi, so the site you mentioned is the production site, but it's not yet available to the public. I updated the plugins there, and pushes the changes to the staging site:

Production (but not really "live")
hidden link

Staging (requires password): hidden link

I believe I had installed Loco when I wasn't able to translate some strings in WPML. I've deactivated it and didn't see any impact so far. So it's now deactivated in both site listed above.

The slug issue remains.

January 29, 2024 at 10:55 am #15237441

Marsel Nikolli

Hi,

Thank you for the clarification, could you please confirm if its on to use the staging setup to further escalate the issue?

* I need to escalate the issue to the 2nd tier support team to check it further.

Looking forward to your reply,
Marsel

January 29, 2024 at 4:07 pm #15239641

Mary

Yes, you can use the staging setup (requires password): hidden link"
I think you have all the info from previous messages.

January 30, 2024 at 11:31 am #15242939

Marsel Nikolli

Hi,

The issue is escalated to the 2nd tier support team, I will update you as soon as I have a feedback from the team.

Regards,
Marsel