Skip to content

This package extends the node wordpress api to add menu, frontpage and custom post type wrapper.

License

Notifications You must be signed in to change notification settings

yashha/wpapi-extensions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

This package extends the node wordpress api to add menu, frontpage and custom post type wrapper.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •