ICL Translations Insert not Working
-
Hi,
I am using the following 4 plugins on my website:
Events Manager
WPML
Events Manager & WPML Compatibility
WooCommerce
WooCommerce MultilingualIn a previous ticket, I mentioned that I would like to replace Google Maps with Baidu Maps (for example while creating a new location)
Instead of changing the plugin code itself, I created a new MetaBox for entering Location and added custom event handlers for address, town and country (required fields). I am using the following filter to save my location:
add_filter( 'em_location_save', 'mm_location_save', 1, 2 ); public function mm_location_save( $result, $EM_Location ) { global $wpdb; update_post_meta( $EM_Location->post_id, '_location_address', $_POST['location_address'] ); update_post_meta( $EM_Location->post_id, '_location_town', $_POST['location_city_town'] ); update_post_meta( $EM_Location->post_id, '_location_latitude', $_POST['location_latitude'] ); update_post_meta( $EM_Location->post_id, '_location_longitude', $_POST['location_longitude'] ); update_post_meta( $EM_Location->post_id, '_location_country', 'CN' ); return $result; }
While my location is saved and I can see it listed in the Locations table in the admin area, I am unable to select it while adding an event.
I researched a bit on this and found out that while the location is getting saved, the POST ID for the location is clashing with an entry in the wp_icl_translations table with an element type of tax_product_cat
Since there is no entry of the location post_id in the wp_icl_translations table, it does not appear in the auto-complete while adding events.
I know this is too long but can anyone shed some light on why this might be happening?
- The topic ‘ICL Translations Insert not Working’ is closed to new replies.