4.0.5 • Published 7 years ago

kasia-plugin-wp-api-menus v4.0.5

Weekly downloads
5
License
MIT
Repository
github
Last release
7 years ago

Kasia Plugin WP-API Menus

Adds support for the WP-API menus to Kasia

Made with ❤ at @outlandish

js-standard-style

Install

npm install --save kasia-plugin-wp-api-menus

Import

// ES2015
import KasiaWpApiMenusPlugin from 'kasia-plugin-wp-api-menus'
// CommonJS
var KasiaWpApiMenusPlugin = require('kasia-plugin-wp-api-menus')

Initialise

Pass to Kasia via the plugins option:

const { kasiaReducer, kasiaSagas } = Kasia({
  WP,
  plugins: [KasiaWpApiMenusPlugin]
})

Action creators

import { 
  fetchMenus, fetchMenu, 
  fetchThemeLocations, fetchThemeLocation 
} from 'kasia-plugin-wp-api-menus'

Dispatch the returned action objects with store.dispatch(<action>).

actions.fetchMenus()

Get all menus available.

Menus will be available at store.wordpress.menus.

actions.fetchMenu(id)

Get a single menu.

  • id {Number|String} ID or slug of the menu to fetch

Menu will be available at store.wordpress.menus[id].

actions.fetchThemeLocations()

Get all theme menu locations.

Theme locations will be available at store.wordpress.menusLocations.

actions.fetchThemeLocation(id)

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

import kasiaPluginWpApiMenus from 'kasia-plugin-wp-api-menus'

kasiaPluginWpApiMenus.preload(WP)

  • 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.

4.0.5

7 years ago

4.0.4

7 years ago

4.0.3

7 years ago

4.0.1

7 years ago

3.1.2

7 years ago

3.1.1

7 years ago

3.1.0

7 years ago

3.0.2

8 years ago

3.0.1

8 years ago

3.0.0

8 years ago

2.0.2

8 years ago

2.0.0

8 years ago

1.0.0

8 years ago