Does your site use object cache?
I think this may relate to cache issue on your site.
You can also debug what happens in your site by adding the debug code in core wordpress.
Add to Menu
button calls wp_update_nav_menu_item
function in wp-includes/nav-menu.php
.
You can place a debug code at the begin of the function to see what happens:
function wp_update_nav_menu_item( $menu_id = 0, $menu_item_db_id = 0, $menu_item_data = array() ) {
error_log(
json_encode(
array(
\'method\' => __METHOD__,
\'menu_id\' => $menu_id,
\'menu_item_db_id\' => $menu_item_db_id,
\'menu_item_data\' => $menu_item_data,
)
)
);
Save Menu
button calls wp_update_nav_menu_object
function in wp-includes/nav-menu.php
.
Debug code:
function wp_update_nav_menu_object( $menu_id = 0, $menu_data = array() ) {
error_log(
json_encode(
array(
\'__METHOD__ \' => __METHOD__,
\'menu_id\' => $menu_id,
\'menu_data\' => $menu_data,
)
)
);
Then compare the menu_id
value to the id stores in your database.
// Query to get menu_id:
select * from wp_terms where term_id = `menu_id_value`;
// Query to get menu_items:
select id, post_name from wp_posts where post_type = \'nav_menu_item\';
If there is a cache issue, these values are different.