Provides support for the WP-API menus plugin to Kasia
npm install kasia-plugin-wp-api-menussh
npm install --save kasia-plugin-wp-api-menus
`
Import
`js
// ES2015
import KasiaWpApiMenusPlugin from 'kasia-plugin-wp-api-menus'
`
`js
// CommonJS
var KasiaWpApiMenusPlugin = require('kasia-plugin-wp-api-menus')
`
Initialise
Pass to Kasia via the plugins option:
`js
const { kasiaReducer, kasiaSagas } = Kasia({
WP,
plugins: [KasiaWpApiMenusPlugin]
})
`
Action creators
`js
import {
fetchMenus, fetchMenu,
fetchThemeLocations, fetchThemeLocation
} from 'kasia-plugin-wp-api-menus'
`
Dispatch the returned action objects with store.dispatch(.
$3
Get all menus available.
Menus will be available at store.wordpress.menus.
$3
Get a single menu.
- __id__ {Number|String} ID or slug of the menu to fetch
Menu will be available at store.wordpress.menus[id].
$3
Get all theme menu locations.
Theme locations will be available at store.wordpress.menusLocations.
$3
Get a single theme menu location.
- __id__ {Number|String} ID or slug of the theme menu location to fetch
Menu will be available at store.wordpress.menuLocations[id].
Universal Applications
`js
import kasiaPluginWpApiMenus from 'kasia-plugin-wp-api-menus'
`
$3
- __WP__ {Object} WP API instance
Returns a single saga generator.
Contributing
All pull requests and issues welcome!
- When submitting an issue please provide adequate steps to reproduce the problem.
- PRs must be made using the standard code style.
- PRs must update the version of the library according to semantic versioning.
If you're not sure how to contribute, check out Kent C. Dodds'
great video tutorials on egghead.io!
Author & License
kasia-plugin-wp-api-menus` was created by Outlandish and is released under the MIT license.