Skip to content

Commit dd322fb

Browse files
author
thebatclaudio
committed
Merge branch 'beltranrengifo-patch-1'
2 parents f6667d5 + 28ee4cd commit dd322fb

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

wp-rest-api-v2-menus.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,10 @@ function wp_api_v2_menus_get_menu_items( $id ) {
140140
$child_items = [];
141141
// pull all child menu items into separate object
142142
foreach ( $menu_items as $key => $item ) {
143+
// add slug to menu items
144+
$slug = basename( get_permalink($item->object_id) );
145+
$item->slug = $slug;
146+
143147
if ( $item->menu_item_parent ) {
144148
array_push( $child_items, $item );
145149
unset( $menu_items[ $key ] );

0 commit comments

Comments
 (0)