Menu Order Not Maintained
-
You’re providing the argument
menu-order
towp_insert_post()
rather than the correctmenu_order
, and as such, the order of the duplicated menu is not correct.I currently have the following workaround in place:
add_filter('wp_insert_post_data', function ($data, $postarr) { if ($data['post_type'] === 'nav_menu_item' && isset($postarr['menu-order'])) { $data['menu_order'] = (int) $postarr['menu-order']; } return $data; }, 10, 2);
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Menu Order Not Maintained’ is closed to new replies.