Skip to content

Commit

Permalink
Fix the parent menu item field in REST API responses (#34835)
Browse files Browse the repository at this point in the history
  • Loading branch information
talldan committed Sep 15, 2021
1 parent 33e4f1f commit 79be738
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/class-wp-rest-menu-items-controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@ public function prepare_item_for_response( $post, $request ) {

if ( rest_is_field_included( 'parent', $fields ) ) {
// Same as post_parent, expose as integer.
$data['parent'] = (int) $menu_item->post_parent;
$data['parent'] = (int) $menu_item->menu_item_parent;
}

if ( rest_is_field_included( 'menu_order', $fields ) ) {
Expand Down

0 comments on commit 79be738

Please sign in to comment.