wpapi-extensions

[![npm (scoped with tag)](https://img.shields.io/npm/v/wpapi-extensions.svg?style=flat-square)](https://www.npmjs.com/package/wp-nuxt) [![MIT license](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](http://opensource.org/licen

Usage no npm install needed!

<script type="module">
  import wpapiExtensions from 'https://cdn.skypack.dev/wpapi-extensions';
</script>

README

WP-API Extensions

npm (scoped with tag) MIT license

This package extends WP-API (the best wordpress api wrapper for node) to add features like menu and custom post type request functions. You need to install the WUXT Headless WordPress API Extensions extension on your wordpress server.

Installation

WP-API Extensions are available via yarn and npm.

$ yarn add wpapi-extensions
$ npm install --save wpapi-extensions

Notice: This package depends on WP-API.

import WPAPI from 'wpapi';
import { registerWuxt } from 'wpapi-extensions';

const wp = new WPAPI({/* options */});
registerWuxt(wp); // registers all functions

You can alse register the functions seperately:

registerFrontPage(wp);
registerMenu(wp);
registerSlug(wp);
registerCpt(wp);

Usage

await wp.frontPage()
await wp.menu()
await wp.slug()
await wp.cpt('movies')

A good description on the functions is also here

Credits

Credits to @danielauener for creating the inital implementation.