private function updateFields($menu, $updateRestaurant) { if (isset($menu->price)) { update_post_meta($menu->id, 'wpcf-precio', $menu->price); } //update_post_meta($menu->id, 'wpcf-menuType',$menu->menuType); //Actualiza los ingredientes wp_set_post_terms($menu->id, $menu->topics, 'ingrediente'); wp_set_post_terms($menu->id, $menu->menuType, 'tipo-de-plato'); if ($updateRestaurant) { update_post_meta($menu->id, '_wpcf_belongs_restaurante_id', $menu->restaurantId); } //Actuliza el numero de platos que tiene el restaurante $restaurantService = new RestaurantService(); $restaurantService->updateNumMenuByType($menu->restaurantId); }