$this->update_status = 'error';
} else { $this->update_status = 'deleted';
} // @todo send back the IDs for all associated nav menu items deleted, so these settings (and controls) can be removed from Customizer?
} } else { // Handle saving menu items for menus that are being newly-created.
if ( $value['nav_menu_term_id'
] < 0
) { $nav_menu_setting_id =
sprintf( 'nav_menu[%s]',
$value['nav_menu_term_id'
] );
$nav_menu_setting =
$this->manager->
get_setting( $nav_menu_setting_id );
if ( !
$nav_menu_setting || !
( $nav_menu_setting instanceof WP_Customize_Nav_Menu_Setting
) ) { $this->update_status = 'error';
$this->update_error =
new WP_Error( 'unexpected_nav_menu_setting'
);
return;
} if ( false ===
$nav_menu_setting->
save() ) { $this->update_status = 'error';
$this->update_error =
new WP_Error( 'nav_menu_setting_failure'
);
return;
}