PluginProbe
WPVR – 360 Panorama viewer and Virtual Tour Builder for WordPress / 9.1.3
WPVR – 360 Panorama viewer and Virtual Tour Builder for WordPress v9.1.3
9.1.3 9.1.2 9.1.1 9.1.0 9.0.3 9.0.2 9.0.1 9.0.0 8.5.79 8.5.78 8.5.77 8.5.76 8.5.75 8.5.74 8.5.73 8.5.72 8.5.71 8.5.70 8.5.69 8.5.68 8.5.35 8.5.36 8.5.37 8.5.38 8.5.39 All 222 releases
← All changes | src/Api/Services/TourService.php +8 -0 9.0.09.1.3 View file →
@@ -22,8 +22,11 @@
22 22 return $this->transformer->toApi( $raw );
23 23 }
24 24
25 25 public function update( int $tour_id, array $api_data ): bool {
26 + $api_data['tourId'] = $tour_id;
27 + $api_data['id'] = $tour_id;
28 +
26 29 // Read existing panodata first so we can preserve pro-managed fields
27 30 // that the free transformer does not handle.
28 31 $existing_raw = $this->repository->find( $tour_id );
29 32
@@ -37,8 +40,13 @@
37 40 // Merge: existing supplies fields unknown to the new editor; transformed
38 41 // values overwrite fields the current plan is allowed to manage.
39 42 if ( is_array( $existing_raw ) && ! empty( $existing_raw ) ) {
40 43 $raw = array_merge( $existing_raw, $raw );
44 + }
45 +
46 + // If not a video tour, remove any stale video ID from existing data
47 + if ( ( $raw['tour-type'] ?? '' ) !== 'video' ) {
48 + unset( $raw['vidid'] );
41 49 }
42 50
43 51 // If the request carries proData (future React pro panels will send this),
44 52 // run the same filter the legacy AJAX stack uses so pro plugin saves its fields.