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/**
@@ -199,7 +199,7 @@ function wp_api_v2_menus_get_menu_items( $id ) {
199199 }
200200 } while (count ($ child_items ));
201201
202- return array_values ($ menu_items );
202+ return apply_filters ( ' wp_api_v2_menus__menu_items ' , array_values ($ menu_items) );
203203}
204204
205205/**
@@ -239,7 +239,7 @@ function wp_api_v2_menus_get_menu_data( $data ) {
239239 }
240240 }
241241
242- return $ menu ;
242+ return apply_filters ( ' wp_api_v2_menus__menu ' , $ menu) ;
243243}
244244
245245add_action ( 'rest_api_init ' , function () {
You can’t perform that action at this time.
0 commit comments