Skip to content

Latest commit

 

History

History
297 lines (230 loc) · 11.8 KB

CHANGELOG.md

File metadata and controls

297 lines (230 loc) · 11.8 KB

Changelog

0.8

  • Add compatibility layer for JsonSerializable. You can now return arbitrary objects from endpoints and use the jsonSerialize() method to return the data to serialize instead of just using the properties of the object.

    (props @rmccue, #24)

  • Fix page parent links to use /pages

    (props @thenbrent, #27)

  • Remove redundant WP_JSON_Pages::type_archive_link() function

    (props @thenbrent, #29)

  • Removed unneeded executable bit on all files

    (props @tierra, #31)

  • Don't include the featured_image property for post types that don't support thumbnails

    (props @phh, #43)

  • Use wp_json_server_before_serve instead of plugins_loaded in the Extending documentation for plugins

    (props @phh, #43)

  • Parse the avatar URL from the get_avatar() function in core, allowing custom avatar implementations

    (props @rachelbaker, #47, #35)

  • Ensure that the author is set if passed

    (props @kuchenundkakao, #44)

  • Clarify the usage of WP_JSON_CustomPostType in plugins

    (props @rmccue, #45)

  • Ensure JSON disabled error messages are translated

    (props @rmccue, #38)

  • Remove extra "Link: " from link headers

    (props @jmusal, #56, #30)

  • Remove redundant get_avatar method in WP_JSON_Posts

    (props @rachelbaker, #35)

  • Rename WP_JSON_Server::get_avatar() to WP_JSON_Server::get_avatar_url()

    (props @rachelbaker, #35)

View all changes

0.7

  • 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 in WP_JSON_CustomPostType (props @thenbrent, #26)

  • Sanitize headers for newlines (props @kokarn, #7)

  • Register rewrite rules during plugin activation (props @pippinsplugins, #17)

View all changes

0.6

  • 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()

View all changes

0.5

  • 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 or edit) (#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 and X-WP-TotalPages headers for information on post/pagination counts (#266)

View all changes

0.4

  • 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() and get_json_url() to plugin.php - This allows using both outside of the API itself (#343)
  • getPost(0) now returns an error rather than the latest post (#344)

View all changes

0.3

  • 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 the json_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.

0.2

  • 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)

View all changes

0.1.2

  • Disable media handling to avoid fatal error (#298)

0.1.1

  • No changes, process error

0.1

  • 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 with edit_posts (#290)
  • Use correct timezones for manual offsets (GMT+10, e.g.) (#279)
  • Allow permanently deleting posts (#292)

View all changes

0.0.4

  • 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.

0.0.3:

  • Now accepts JSON bodies if an endpoint is marked with ACCEPT_JSON