maximeschoeni / sublanguage

Multilanguage plugin for wordpress
42 stars 13 forks source link

Add translated title and content in /wp-json/wp/v2/posts #23

Open hbooo opened 7 years ago

hbooo commented 7 years ago

Hello,

I'm trying to add translated title and content of posts in mysite.com/wp-json/wp/v2/posts but I can't find where to modify it,

Can anyone help me pointing which file in need to modify?

I tried to add 'show_in_rest' => true, in register_post_type array's in compat/sublanguage.php but it doesn't seems to work

Thanks in advance

maximeschoeni commented 7 years ago

Hello,

Are you using rest api?

hbooo commented 7 years ago

Hello,

Yes I am

I have correct my first post (show_in_rest instead of show_in_menu)

maximeschoeni commented 7 years ago

Sorry I haven't really checked this rest api so far... I need to have a look.

Can't you just pass a "language" parameter into the url? like "&language=xx" ?

hbooo commented 7 years ago

I already tried but I got a 404