We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f6667d5 commit 28ee4cdCopy full SHA for 28ee4cd
wp-rest-api-v2-menus.php
@@ -140,6 +140,10 @@ function wp_api_v2_menus_get_menu_items( $id ) {
140
$child_items = [];
141
// pull all child menu items into separate object
142
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
+
147
if ( $item->menu_item_parent ) {
148
array_push( $child_items, $item );
149
unset( $menu_items[ $key ] );
0 commit comments