diff --git a/includes/RestApi/RestApiFilter.php b/includes/RestApi/RestApiFilter.php index 16465fb60..ddd27d71a 100644 --- a/includes/RestApi/RestApiFilter.php +++ b/includes/RestApi/RestApiFilter.php @@ -187,7 +187,7 @@ public static function wp_onboarding_nav_menu_filter( $response, $args ) { public static function prepare_raw_html_menu( $data, $index ) { // create dummy menu links $menu_navigation_grammar = ''; - foreach ( Patterns::get_dummy_menu_items() as $page_title ) { + foreach ( Patterns::get_dummy_navigation_menu_items() as $page_title ) { $menu_navigation_grammar .= ''; } // need to reset ID else the data saved in the DB gets used @@ -252,11 +252,12 @@ public static function modify_get_pages_response( $response ) { } // make sure we have the number of dummy pages required - $pages = $response->get_data(); - if ( count( $pages ) < count( Patterns::get_dummy_menu_items() ) ) { + $pages = $response->get_data(); + $dummy_items = Patterns::get_dummy_navigation_menu_items(); + if ( count( $pages ) < count( $dummy_items ) ) { $pages = array_pad( $pages, - count( Patterns::get_dummy_menu_items() ), + count( $dummy_items ), array_pop( $pages ) ); } @@ -281,9 +282,10 @@ public static function rename_page( array $page, $index ) { if ( isset( $page['title']['rendered'] ) ) { // changed id so that while rendering the menu link and name are proper $page['id'] = $page['id'] + $index; - $page['title']['rendered'] = Patterns::get_dummy_menu_items()[ $index ]; + $page['title']['rendered'] = Patterns::get_dummy_navigation_menu_items()[ $index ]; $page['menu_order'] = $index; } + return $page; }