Skip to content

Commit 346fde3

Browse files
committed
add permission_callback to endpoints
1 parent 50e81b7 commit 346fde3

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
@@ -226,20 +226,24 @@ function wp_api_v2_menus_get_menu_data( $data ) {
226226
register_rest_route( 'menus/v1', '/menus', array(
227227
'methods' => 'GET',
228228
'callback' => 'wp_api_v2_menus_get_all_menus',
229+
'permission_callback' => '__return_true'
229230
) );
230231

231232
register_rest_route( 'menus/v1', '/menus/(?P<id>[a-zA-Z0-9_-]+)', array(
232233
'methods' => 'GET',
233234
'callback' => 'wp_api_v2_menus_get_menu_data',
235+
'permission_callback' => '__return_true'
234236
) );
235237

236238
register_rest_route( 'menus/v1', '/locations/(?P<id>[a-zA-Z0-9_-]+)', array(
237239
'methods' => 'GET',
238240
'callback' => 'wp_api_v2_locations_get_menu_data',
241+
'permission_callback' => '__return_true'
239242
) );
240243

241244
register_rest_route( 'menus/v1', '/locations', array(
242245
'methods' => 'GET',
243246
'callback' => 'wp_api_v2_menu_get_all_locations',
247+
'permission_callback' => '__return_true'
244248
) );
245249
} );

0 commit comments

Comments
 (0)