Skip to content

Commit ccf902d

Browse files
Merge pull request #38 from FloLech/patch-1
Use post_name instead of basename (Bugfix for static home page)
2 parents f835c0c + 85df628 commit ccf902d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

wp-rest-api-v2-menus.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ function wp_api_v2_menus_get_menu_items( $id ) {
157157

158158
if($item->type == 'post_type') {
159159
// add slug to menu items
160-
$slug = basename( get_permalink($item->object_id) );
160+
$slug = get_post_field( 'post_name', $item->object_id );
161161
$item->slug = $slug;
162162
} else if($item->type == 'taxonomy') {
163163
$cat = get_term($item->object_id);

0 commit comments

Comments
 (0)