maximeschoeni / sublanguage

Multilanguage plugin for wordpress
42 stars 13 forks source link

admin-ajax add_post_meta don't translate for not default idiome in the 2.0 #20

Open pulluptech opened 7 years ago

pulluptech commented 7 years ago

$ids = array(1,2,3,4,5); add_action( 'wp_ajax_import_product', 'import_product' ); $key = "_attribs_ids"; add_post_meta($post_id, $key, $ids);

global $sublanguage; // return null

maximeschoeni commented 7 years ago

Please can you verify if the "Use AJAX in Front-End" checkbox is checked in wp_admin > Settings > Sublanguage?

pulluptech commented 7 years ago

I'ts enable...

I found the problem, when i click in sub tab idiome the plugin don't copy the meta values to new one for transalate then, the get_post_meta return a empty array.

maximeschoeni commented 7 years ago

And is your meta_key set to be translatable in the "language options" page of the corresponding post_type?

pulluptech commented 7 years ago

Yes, the meta it's an array

maximeschoeni commented 7 years ago

Right, there was actually a bug when the meta was an array. I think I fixed it. Would you like to download and try the newer version (from github) and confirm me its fixed?