Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

wpapi

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wpapi - npm Package Versions

12

0.9.1

Diff

Changelog

Source

v0.9.1 Since I Left You

v0.9 brings two long-neglected features to the foreground: media support and browser-side usage. This release is named in homage to The Avalanches' absurdly brilliant Since I Left You.

Media Handling

wp.media() requests now provide a .file() chaining method, which can be used to specify the file system path of a file to upload (in node) or the contents of a file input (in a browser). This permits images and other media to be uploaded to the WordPress site in the same command which creates the media record.

Browserify/Webpack Support

Requiring wpapi as a dependency in a Browserified or Webpacked build now results in a much slimmer file bundle,

Miscellaneous Fixes

  • Irritating warning messages generated on WP instantiation have been removed (reported by @elyobo)
  • registerRoute no longer improperly lowercases camelCased path part setters (reported by @joneslloyd)
  • The WP constructor now throws a nice error if the endpoint property is not a string, not just if it is falsy (props @sdgluck)
  • JSDoc fix (props @sdgluck)

Props

For pull requests and patches: @bt, @sdgluck

For opening issues and asking or discussing questions: @elyobo, @joneslloyd, @mrkrumhausen, @satish9323, @smedegaard, @tommedema, @vtripolitakis, @z-avanes

kadamwhite
published 0.9.0-2 •

kadamwhite
published 0.9.0-1 •

kadamwhite
published 0.9.0-0 •

kadamwhite
published 0.8.0 •

Changelog

Source

v0.8.0 New Eyes

This release makes some key changes, adds some essential functionality, and re-wires things under the hood. I am unilaterally adopting the model of naming releases after albums, because I am releasing this in Vienna and "Mozart's House" by Clean Bandit (New Eyes, track 1) has been stuck in my head throughout WordCamp Europe.

Autodiscovery

Autodiscovery is now supported via the WP.discover method (#181)

Bootstrapping

If you already have the API response object you want to bootstrap with, the .routes property from it can now be passed in when calling WP.site or instantiating a new WP object (also #181, documented #182):

var site = WP.site( 'http://my-endpoint.com/wp-json', endpointJSON.routes );

A script to ease the process of downloading this JSON object was added in PR #175

registerRoute

Arbitrary methods for custom endpoints can now be added without auto-discovery by using the .registerRoute method, which takes the same route configuration strings as register_rest_route in the API core.

Internal Re-Architecture

In #168 the innards of the library were totally gutted and re-written to support auto-discovery, registerRoute and bootstrapping.

Human-Readable names for HTTP verbs

PUT and POST are not the most intuitive words for what they do, and POST in particular caused a lot of semantic confusion with the post object within the WordPress data model. .post has become .create, and .put has become .update.

Upgraded Dependencies

Package dependencies and developer tools have all been updated to the latest version in their respective ranges.

Props

Props and gratitude to the community that submitted code, bugs, issues, questions, or comments that added to & informed this release.

For general advice and conceptual validation: @rmccue

For assisting with the discussion about how to handle autodiscovery and custom route endpoints: @adamsilverstein, @aedensixty, @andreipot, @artoliukkonen, @BenHen75, @chrishutchinson, @elyobo, @gnarf, @ishaan-puniani, @jasonphillips, @joehoyle, @jupitercow, @timmyc

For opening issues and asking questions: @aedensixty, @dasheck0, @jsteranko, @nabeards, @satish9323, @stompweb

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc