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.
2 parents 631d033 + 578c7d5 commit ab34f4eCopy full SHA for ab34f4e
wp-rest-api-v2-menus.php
@@ -28,7 +28,7 @@ function wp_api_v2_menus_get_all_menus() {
28
}
29
30
31
-
+
32
return apply_filters('wp_api_v2_menus__menus', $menus);
33
34
@@ -139,6 +139,12 @@ function wp_api_v2_find_object_by_id( $array, $id ) {
139
*/
140
function wp_api_v2_menus_get_menu_items( $id ) {
141
$menu_items = wp_get_nav_menu_items( $id );
142
143
+ // fallback: if menu_items is null then return empty array
144
+ if($menu_items === false) {
145
+ return [];
146
+ }
147
148
$all_menu_items = $menu_items;
149
150
// check if there is acf installed
0 commit comments