Changelog
v1.0.2 Recto Verso
Patch release named for Paradis' 2016 LP "Recto Verso".
Changelog
v1.0.1 The Only Constant is Change
This patch release is named for The Only Constant is Change, a track from v1.0 namesake album Emotional Technology by BT.
Changelog
v1.0.0 Emotional Technology
.param()
method signature.settings()
top-level route handler.status()
parameter method mixin.password()
and .sticky()
parameter mixinslodash.reduce
with custom objectReduce
method throughout codebase to reduce browser bundle sizeThis release is named for BT's 2003 album Emotional Technology.
Changelog
v0.12.1 You Only Live Once -Instrumental-
This patch release fixes an issue where valid post type identifiers (or PCRE capture group names) are not properly intercepted and mapped to camelCase path part setters.
Props @gambry
Changelog
v0.12.0 You Only Live Once
This release makes breaking changes to how endpoint filtering methods are bound, specifically reacting to the removal of the ?filter
query parameter which is not present in WordPress 4.7's API endpoints.
New filtering methods:
.categories()
.tags()
Both of these methods support querying by ID only. If a slug is provided it will not work in 4.7, due to the removal of filter
, unless the rest-filter plugin is installed & active on the remote WordPress site.
Deprecated filtering methods:
.category()
(for filtering by associated terms; use .tags()
).tag()
(for filtering by associated terms; use .tags()
)Note: these method names may be retained, but the functionality which delegates to .filter()
to query by term slug will be removed.
Removed filtering methods:
.name()
: use .slug()
(deprecated previously).filter()
: available as a mixin but no longer enabled by default.path()
(for Pages)Props @joaojeronimo, @Ohar, @ryelle
This release is named for w.hatano's latest EP You Only Live Once
Changelog
v0.11.0 Super
The theme for v0.11 is better parameter handling. Several parameters are now supported that apply to all default content routes, and this release also features a complete overhaul of the handling for registering mixins and custom query parameter setters with .registerRoute()
.
Parameter convenience methods
.order()
, .orderby()
, .offset()
, .exclude()
, .include()
, .page()
, .perPage()
and .slug()
are now supported for all request handlers generated by this library, not just for some resources.
Setting Parameters on Custom Routes
The .param( name, val )
method is always available for custom route handler instances, but the convenience of .filter
and other overloaded setters was not available to custom routes without some sleuthing through the code for this library (#203). To remedy this situation, a params
array can now be provided on the registerRoute
configuration object. If a method is available for a parameter (such as filter
), it will be used; if no method exists, a setter for that property will be created:
site.handler = site.registerRoute( 'myplugin/v1', 'collection/(?P<id>)', {
params: [
// Listing any of the parameters with built-in handlers will
// assign that built-in chaining method to the route handler:
'filter',
'author',
// `.customparam()` will be created as well, as a shortcut
// for `.param( 'customparam', val )
'customparam'
]
});
Parameter convenience methods for Beta 14+ & beyond
If you are running the bleeding-edge develop
branch of the API, there is now a .sticky( [boolean] )
method to support the new sticky posts handling recently added to the REST API.
If you are actually running the REST API plugin in the future, this library now also provides a .password()
method for use in setting the password needed to access the content for a password-protected post. (The PR for adding that parameter should land later this week.)
This release is named for the Pet Shop Boys' latest album Super
Props @edygar, @ludoo0d0a, @marcianosr, @sdgluck, and @stephanmax, for issues, PRs, feedback & discussions.
Changelog
v0.10.0 Abaporu
v0.10 standardizes the name of the constructor exposed by this module as "WPAPI", and creates a seam through which HTTP interactions can be customized or overridden. This release is named for Brazilian DJ Gui Boratto's fourth studio album Abaporu (Kompakt, 2014).
Module Naming
The constructor exposed by this module should be referred to as WPAPI
in all cases. This has been updated across the documentation site, source code, and examples within code comments.
There is remaining inconsistency throughout the docs & test suite between whether an instance of WPAPI
is referred to as wp
or as site
; this will not be addressed at this time, the identifier used to hold the WP site client instance is left up to the library consumer.
Custom HTTP Transport Behavior
Custom HTTP transport methods may be provided to inject or short-circuit HTTP behavior for each type of request; methods may be specified via a .transport
property on the configuration object passed to the WP
constructor, or by passing an object of transport methods to the .transport()
method on the instantiated WP
object.
Props @edygar
Changelog
v0.9.3 Frontier Psychiatrist, 85% Instrumental
Built bundles in browser/
did not make it into previous publish!
Changelog
v0.9.2 Frontier Psychiatrist
.toString()
method to WPRequest objects, which returns the full
rendered URI for a query.before
and .after
chaining methods to specify date queriesDeprecated Methods:
._renderURI()
method on WPRequest object (use .toString
).post()
HTTP method on WPRequest object (use .create
).put()
HTTP method on WPRequest object (use .update
)Props for this patch release:
Issues, Bugs, Documentation Requests & Discussion: @BenHen75, @brianloveswords, @gnarf, @ludoo0d0a, @nodeGarden, @preschian, @sdgluck, @tommedema, @vtripolitakis, @wblaircox, @z-avanes