Skip to content

Commit 784f9fa

Browse files
committed
Merge branch 'feature/menu-endpoints'
2 parents 189a40b + a077f2b commit 784f9fa

File tree

5 files changed

+7
-5
lines changed

5 files changed

+7
-5
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,11 @@ Gets a WordPress Menu by slug. Accepts no parameters.
135135

136136
Returns the following JSON Response in each item object:
137137

138+
- ID
138139
- menu_order
139140
- title
140141
- url
141142
- target
142143
- description
143144
- classes (array)
145+
- menu item parent

better-wp-endpoints.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Plugin Name: Better WordPress Endpoints
44
Plugin URI: https://github.com/factor1/better-wp-endpoints/
55
Description: Serves up slimmer WordPress Rest API endpoints, with some great enhancements.
6-
Version: 0.1.1
6+
Version: 0.1.2
77
Author: Eric Stout, Factor1 Studios
88
Author URI: https://factor1studios.com/
99
License: GPL3

includes/wp_nav_menus.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@ function bwe_get_menus() {
2525
$slim_menu_items = array();
2626

2727
foreach ($menu_items as $key => $menu_item) {
28-
// create a new object for a smaller response
2928
$items = new stdClass();
3029

31-
// get menu item data and add it to our new object
30+
$items->ID = $menu_item->ID;
3231
$items->menu_order = $menu_item->menu_order;
3332
$items->title = $menu_item->title;
3433
$items->url = $menu_item->url;
3534
$items->target = $menu_item->target;
3635
$items->description = $menu_item->description;
3736
$items->classes = $menu_item->classes;
37+
$items->menu_item_parent = $menu_item->menu_item_parent;
3838

3939
array_push($slim_menu_items, $items);
4040
}

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "better-wp-endpoints",
3-
"version": "0.1.1",
3+
"version": "0.1.2",
44
"description": "Serves up slimmer WordPress Rest API endpoints.",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)