wpapi-extensions
TypeScript icon, indicating that this package has built-in type declarations

1.0.12 • Public • Published

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.

Readme

Keywords

none

Package Sidebar

Install

npm i wpapi-extensions

Weekly Downloads

38

Version

1.0.12

License

MIT

Unpacked Size

9.48 kB

Total Files

15

Last publish

Collaborators

  • yasark