WP REST API multilanguage (over WMPL)
WP REST API multilanguage (over WMPL)
Description
Plugin will allow you to fetch the WP REST API call with a “lang” variable.
It will retrieve the right content from WPML.
Tested with the latest version of:
- WPML 3.2.7
- WP REST API 2.0-beta4
Installation
Install the plugin in your wp-content/plugins/ directory.
Then:
- Activate the plugin through the ‘Plugins’ menu in WordPress
- Make a call to “http://yoursite/wp-json/posts/?lang=it”
Faq
How I can fetch my custom post type in current language?
Add ‘suppress_filters’ => false on get_posts/WP_Query call
get_posts([
‘post_type’ => ‘custom_post’,
‘suppress_filters’ => false
]);
Reviews
Changelog
0.1
- Initial release