How to use the wpapi.default function in wpapi

To help you get started, we’ve selected a few wpapi examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github outlandishideas / kasia-boilerplate / src / store / wordpress.js View on Github external
/**
 * # Kasia Setup
 */

import { default as _WP } from 'wpapi'
import Kasia from 'kasia'
import KasiaWpMenusPlugin from 'kasia-plugin-wp-api-menus'

import config from '../config'

export const WP = new _WP({ endpoint: config.wpapi })

const { kasiaSagas, kasiaReducer } = Kasia({
  WP,
  plugins: [KasiaWpMenusPlugin],
  contentTypes: [{
      name: 'Reports',
      plural: 'reports',
      slug: 'reports'
  }]
})

export {
  kasiaSagas as wpSagas,
  kasiaReducer as wpReducer
}

wpapi

An isomorphic JavaScript client for interacting with the WordPress REST API

MIT
Latest version published 4 years ago

Package Health Score

50 / 100
Full package analysis

Popular wpapi functions