Skip Navigation

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.

Elementor users - please update WPML to the latest version to maintain compatibility. More details here - https://wpml.org/changelog/2024/12/wpml-4-6-15-critical-update-for-elementor-sites/
Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 17:00 10:00 – 17:00 10:00 – 17:00 10:00 – 17:00 10:00 – 17:00 -
- 18:00 – 19:00 18:00 – 19:00 18:00 – 19:00 18:00 – 19:00 18:00 – 19:00 -

Supporter timezone: Asia/Kathmandu (GMT+05:45)

Tagged: 

This topic contains 0 replies, has 0 voices.

Last updated by Shekhar Bhandari 5 days, 14 hours ago.

Assisted by: Shekhar Bhandari.

Author Posts
December 16, 2024 at 4:24 am

barjD-2

Background of the issue:
I am trying to add a translation to a custom post type 'post', and to have that translation adopt the taxonomies from the original language post.

I have tried the solution on this thread: https://wpml.org/forums/topic/taxonomy-hierarchy-synchronization-not-working/.

I went to WPML > Support > Troubleshooting > Click on [Post or post type] Synchronize posts taxonomies.

I have also checked that under WPML > Settings, 'Copy taxonomy to translations' is turned on.

Please note our WP Memory limit in our wp-config.php file is set to:

define('WP_MEMORY_LIMIT', '256M');
define( 'WP_MAX_MEMORY_LIMIT', '256M');

I am not sure why your plugin reads it as 40M

Symptoms:
When I translated a new post and clicked 'Publish', the taxonomies were not synced.

Questions:
Why are the taxonomies not syncing for new translations after publishing?
Is there a different step required to ensure taxonomies sync automatically for future translations?

December 16, 2024 at 5:52 am
December 16, 2024 at 6:15 am #16515823

Shekhar Bhandari
Supporter

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Hello there,

Please add the following to your child theme functions.php as a workarround and see if it helps:


function fixposttype() {
	global $sitepress, $wpml_term_translations;
	$post_type = "trustee";
	$test      = new WPML_REST_Posts_Hooks( $sitepress, $wpml_term_translations );
	add_filter( "rest_prepare_$post_type", array( $test, 'prepare_post' ), 10, 2 );
}

fixposttype();

Also, I would like to let you know that the issue is now escalated to our developers.

Look forward to your reply.

Thanks

December 16, 2024 at 7:10 pm #16518641

barjD-2

I have applied the code provided to functions.php and clicked to "Update file," as shown in the screenshot attached.

This solution works for now.

Thank you for letting me know the issue has been escalated.

Screenshot 2024-12-16 at 11.06.52 AM.png
December 17, 2024 at 3:38 am #16519487

Shekhar Bhandari
Supporter

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Glad to know that it helped.

December 20, 2024 at 8:40 am #16532522

barjD-2

I got an email asking if I still needed help. Since the core issue is not resolved, I prefer to leave this ticket open until we no longer need the code provided for the interim.

December 20, 2024 at 8:42 am #16532546

Shekhar Bhandari
Supporter

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Sure, I will set the ticket to correct status.