Ryan McCue
Forum Replies Created
-
Forum: Plugins
In reply to: [WP REST API (WP API)] Filter by meta key/valueMeta queries aren’t currently supported, as there are numerous concerns (privacy, etc) that we need to sort out. We’re looking into it though. π
You can check for the
JSON_REQUESTconstant;trueindicates that the current request is an API request.Forum: Plugins
In reply to: [WP REST API (WP API)] Create commentsThis is not currently supported, but we’re looking into adding it in a future release.
Forum: Plugins
In reply to: [WP REST API (WP API)] How to get all child categories of a parent category?This is a known issue and we’re looking into implementing it in a future release.
Forum: Plugins
In reply to: [WP REST API (WP API)] Crashes wordpress 3.4.2The plugin is only compatible with WordPress 3.9 and newer, sorry!
Note that
tag_idis not a public query variable, but is a private query variable. This is why the query variable does work once you authenticate. I’m not entirely sure why it’s private, but that’s what WordPress core marks it as, so we follow their lead.If you’d like, file a bug on our issue tracker about this and we can look into tracking it down.
Forum: Plugins
In reply to: [WP REST API (WP API)] Is filter "offset" working?You should be able to use the
pageparameter instead. See also this pull request.Forum: Plugins
In reply to: [WP REST API (WP API)] Oauth1The OAuth 1.0a process is pretty standard, but also a bit complicated to explain. I’d recommend using an existing library in whatever language you’re working with.
The OAuth Bible may be able to help here (we use three-legged OAuth 1.0a).
Forum: Plugins
In reply to: [WP REST API (WP API)] Unable to make the Filters workI’m not sure exactly what
field_statusis here, but you need to use query vars marked as public for WP Query.Note that meta queries are not currently supported; see #479.
Forum: Plugins
In reply to: [WP REST API (WP API)] Why no prefixes on post field names?This is a conscious design decision. The API is intended for both internal and external clients, so we remove the prefixes, since they’re really an internal implementation detail.
Forum: Plugins
In reply to: [WP REST API (WP API)] WPML support(I answered this one over on GitHub.)
Forum: Plugins
In reply to: [WP REST API (WP API)] Getting JSONP to workSorry about this! This is fixed in the current development version and will be included with version 1.2.
Forum: Plugins
In reply to: [WP REST API (WP API)] WP API vs. Jetpack JSON APIWe have a comparison document up on GitHub that goes into some of the details of this. Hope that helps; happy to elaborate!
Forum: Plugins
In reply to: [WP REST API (WP API)] Looping through Custom PostsYou can pass the
typeparameter to/posts:GET /wp-json/posts?type=my-type
Forum: Plugins
In reply to: [WP REST API (WP API)] Save/Edit a commentThere are three ways as I see it. You can hook into the edit post method in one of two ways (json_insert_post or json_pre_insert_post), or you can extend the api with WP_JSON_CustomPostType or WP_JSON_Posts. Extending using posts, see class json media. Extending using custom post type see json page.
The post endpoints shouldn’t need to be involved here. While you can add your own custom endpoints, it’s important to keep in mind that these may not have compatibility with the eventual version included in the API.
Also note that dunar21’s example code from above is not safe to run in production, as it doesn’t touch on sanitisation. A big part of why it takes us a long time to add these new API endpoints is because it takes time to go over every available field and ensure they’re sanitised properly. π