stylight / python-wordpress-json

Thin Python wrapper for the Wordpress REST API
MIT License
42 stars 19 forks source link

fix filters with list values #15

Closed gutomaia closed 5 months ago

gutomaia commented 7 years ago

Given you have WordpressJsonWrapper instance

wp = WordpressJsonWrapper()

if your plugin receives a list value on a filter

wp.get_posts(filter={'filter_list': ['apple', 'tree']})

then your resquest must be something like

curl "GET /wp-json/wp/v2/posts?filter%5Bfilter_list%5D=apple%5B0%5D&filter%5Bfilter_list%5D%5B1%5D=tree"

what means that your query string must be

filter[filter_list]=apple[0]&filter[filter_list][1]=tree

haythamlabrini commented 5 months ago

Too old