File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -26,8 +26,8 @@ function wp_api_v2_menus_get_all_menus() {
2626 }
2727 }
2828 }
29-
30- return $ menus ;
29+
30+ return apply_filters ( ' wp_api_v2_menus__menus ' , $ menus) ;
3131}
3232
3333/**
@@ -48,7 +48,7 @@ function wp_api_v2_menu_get_all_locations() {
4848 $ locations ->{$ location_slug }->menu = get_term ( $ menu_id );
4949 }
5050
51- return $ locations ;
51+ return apply_filters ( ' wp_api_v2_menus__locations ' , $ locations) ;
5252}
5353
5454/**
@@ -82,7 +82,7 @@ function wp_api_v2_locations_get_menu_data( $data ) {
8282 }
8383 }
8484
85- return $ menu ;
85+ return apply_filters ( ' wp_api_v2_menus__menu ' , $ menu) ;
8686}
8787
8888/**
@@ -179,7 +179,7 @@ function wp_api_v2_menus_get_menu_items( $id ) {
179179 }
180180 } while (count ($ child_items ));
181181
182- return array_values ($ menu_items );
182+ return apply_filters ( ' wp_api_v2_menus__menu_items ' , array_values ($ menu_items) );
183183}
184184
185185/**
@@ -219,7 +219,7 @@ function wp_api_v2_menus_get_menu_data( $data ) {
219219 }
220220 }
221221
222- return $ menu ;
222+ return apply_filters ( ' wp_api_v2_menus__menu ' , $ menu) ;
223223}
224224
225225add_action ( 'rest_api_init ' , function () {
You can’t perform that action at this time.
0 commit comments