You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
http://foo.co.za/wp_api/v1/posts?post_type=foo works, but I'm struggling to get http://foo.co.za/wp_api/v1/posts?post_type=foo&meta_key=bar&meta_value=baz to work.
Any ideas?
PS. Awesome plugin!
The text was updated successfully, but these errors were encountered:
Looking through the documentation and the code, it doesn't appear that meta_key and meta_value are accepted as parameters. Not sure there's a reason why, but it may just not be implemented yet.
after line #107 of api/v1/controllers/Posts.php allows using those url parameters with no further tweaking necessary. Your example query of /wp_api/v1/posts?post_type=foo&meta_key=bar&meta_value=baz should work without a hitch.
To the devs: Is there a reason these fields weren't included in the API? Security concerns or other issues? Any plans to implement better custom field support into the core?
Meta was left out due to security concerns. We wanted to avoid making anything publicly queryable that wsan't normally public in WordPress. The convert_request() method in the posts controller does need to be reworked some to allow new request args to added to the query.
http://foo.co.za/wp_api/v1/posts?post_type=foo
works, but I'm struggling to gethttp://foo.co.za/wp_api/v1/posts?post_type=foo&meta_key=bar&meta_value=baz
to work.Any ideas?
PS. Awesome plugin!
The text was updated successfully, but these errors were encountered: