How can I create a new menu item that links to an archive of a custom post type?
After searching through the core WordPress files, I found the necessary arguments. The key is setting menu-item-object to be the slug of your post type and the menu-item-type to be post_type_archive. $args = [ ‘menu-item-position’ => $position, ‘menu-item-status’ => ‘publish’, ‘menu-item-parent-id’ => 0, ‘menu-item-object’ => ‘my-post-type’, ‘menu-item-type’ => ‘post_type_archive’ ]; wp_update_nav_menu_item($menuID, 0, $args);