-
The response handler object is now passed into the endpoint objects via the constructor, allowing you to avoid excess global state where possible. It's recommended to use this where possible rather than the global object.
(props @rmccue, #2)
-
Fix undefined variables and indices (props @pippinsplugins, #5)
-
Correct call to deactivation hook (props @ericpedia, #9)
-
Check metadata access correctly rather than always hiding for users without the
edit_post_meta
capability (props @kokarn, #10) -
Return all term metadata, rather than just the last one (props @afurculita, #13)
-
Access post metadata from cache where possible - Note, this is a backwards compatibility break, as the format of the metadata has changed. This may change again in the near future, so don't rely on it until 1.0. (props @afurculita, #14)
-
Add term_link to prepare_term (props @afurculita, #15)
-
Fix hardcoded
/pages
references inWP_JSON_CustomPostType
(props @thenbrent, #26) -
Sanitize headers for newlines (props @kokarn, #7)
-
Register rewrite rules during plugin activation (props @pippinsplugins, #17)
- Huge documentation update - Guides on getting started and extending the API are now available for your perusal
- Add generic CPT class - Plugins are now encouraged to extend
WP_JSON_CustomPostType
and get free hooking for common actions. This removes most of the boilerplate that you needed to write for new CPT-based routes and endpoints (#380) - Use defined filter priorities for endpoint registration - It's now easier to inject your own endpoints at a defined point
- Update the schema - Now includes documentation on the Media entity, plus more (#264)
- Add better taxonomy support - You can now query for taxonomies and terms
directly. The routes here might seem strange
(
/posts/types/post/taxonomies/category
for example), but the intention is to future-proof them as much as possible(#275) - Ensure the JSON URL is relative to the home URL (#375)
- Check all date formats for If-Unmodified-Since (#378)
- Register the correct URL for the JS library (#376)
- Correct the usage of meta links (#379)
- Add filters for post type and post status data (#380)
- Separate parent post and parent comment relation (#330()
-
Add support for media - This has been a long time coming, and it's finally at a point where I'm happy to push it out. Good luck. (#272)
-
Separate the post-related endpoints - Post-related endpoints are now located in the
WP_JSON_Posts
class. When implementing custom post type support, it's recommended to subclass this.The various types are now also only registered via hooks, rather than directly in the server class, which should make it easier to override them as well (#348)
-
Add page support - This is a good base if you're looking to create your own custom post type support (#271)
-
Switch from fields to context - Rather than passing in a list of fields that you want, you can now pass in a context (usually
view
oredit
) (#328). -
Always send headers via the server handler - Endpoints are now completely separate from the request, so the server class can now be used for non-HTTP/JSON handlers if needed (#293)
-
Use better error codes for disabled features (#338)
-
Send
X-WP-Total
andX-WP-TotalPages
headers for information on post/pagination counts (#266)
- Add Backbone-based models and collections - These are available to your code
by declaring a dependency on
wp-api
(#270) - Check
json_route
before using it (#336) - Conditionally load classes (#337)
- Add additional test helper plugin - Provides code coverage as needed to the API client tests. Currently unused. (#269)
- Move
json_url()
andget_json_url()
toplugin.php
- This allows using both outside of the API itself (#343) getPost(0)
now returns an error rather than the latest post (#344)
- Add initial comment endpoints to get comments for a post, and get a single comment (#320)
- Return a Post entity when updating a post, rather than wrapping it with useless text (#329)
- Allow filtering the output as well as input. You can now use the
json_dispatch_args
filter for input as well as thejson_serve_request
filter for output to serve up alternative formats (e.g. MsgPack, XML (if you're insane)) - Include a
profile
link in the index, to indicate the JSON Schema that the API conforms to. In the future, this will be versioned.
- Allow all public query vars to be passed to WP Query - Some private query vars
can also be passed in, and all can if the user has
edit_posts
permissions (#311) - Pagination can now be handled by using the
page
argument without messing with WP Query syntax (#266) - The index now generates links for non-variable routes (#268)
- Editing a post now supports the
If-Unmodified-Since
header. Pass this in to avoid conflicting edits (#294) - Post types and post statuses now have endpoints to access their data (#268)
- Disable media handling to avoid fatal error (#298)
- No changes, process error
- Enable the code to be used via the plugin architecture (now uses rewrite rules if running in this mode)
- Design documents are now functionally complete for the current codebase (#264)
- Add basic writing support (#265)
- Filter fields by default - Unfiltered results are available via their
corresponding
*_raw
key, which is only available to users withedit_posts
(#290) - Use correct timezones for manual offsets (GMT+10, e.g.) (#279)
- Allow permanently deleting posts (#292)
- Hyperlinks now available in most constructs under the 'meta' key. At the moment, the only thing under this key is 'links', but more will come eventually. (Try browsing with a browser tool like JSONView; you should be able to view all content just by clicking the links.)
- Accessing / now gives an index which briefly describes the API and gives links to more (also added the HIDDEN_ENDPOINT constant to hide from this).
- Post collections now contain a summary of the post, with the full post available via the single post call. (prepare_post() has fields split into post and post-extended)
- Post entities have dropped post_ prefixes, and custom_fields has changed to post_meta.
- Now supports JSONP callback via the _jsonp argument. This can be disabled separately to the API itself, as it's only needed for cross-origin requests.
- Internal: No longer extends the XMLRPC class. All relevant pieces have been copied over. Further work still needs to be done on this, but it's a start.
- Now accepts JSON bodies if an endpoint is marked with ACCEPT_JSON