PluginProbe
WPVR – 360 Panorama viewer and Virtual Tour Builder for WordPress / 9.2.0
WPVR – 360 Panorama viewer and Virtual Tour Builder for WordPress v9.2.0
9.2.0 9.1.4 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 All 224 releases
← All changes | src/Admin/UiModeSwitcher.php +15 -1 9.0.2 → 9.2.0 View file →
@@ -142,9 +142,23 @@
142 142 <script>
143 143 (function() {
144 144 var notice = document.getElementById('wpvr-ui-mode-notice');
145 145 var dismissButton = notice ? notice.querySelector('.wpvr-ui-mode-notice__dismiss') : null;
146 + var switchButton = notice ? notice.querySelector('.wpvr-ui-mode-notice__switch') : null;
146 147
148 + if (switchButton) {
149 + switchButton.addEventListener('click', function() {
150 + // Publishing updates the page URL without rebuilding this notice.
151 + var tourId = parseInt(new URLSearchParams(window.location.search).get('post'), 10);
152 + if (tourId > 0) {
153 + var switchUrl = new URL(switchButton.href);
154 + switchUrl.searchParams.set('context', 'edit');
155 + switchUrl.searchParams.set('tour_id', tourId);
156 + switchButton.href = switchUrl.toString();
157 + }
158 + });
159 + }
160 +
147 161 if (dismissButton) {
148 162 dismissButton.addEventListener('click', function() {
149 163 notice.remove();
150 164 });
@@ -189,9 +203,9 @@
189 203 return $screen->id === self::POST_TYPE;
190 204 }
191 205
192 206 private function get_current_mode(): string {
193 - return get_option( 'wpvr_ui_mode', 'legacy' ) === 'latest' ? 'latest' : 'legacy';
207 + return get_option( 'wpvr_ui_mode', 'latest' ) === 'latest' ? 'latest' : 'legacy';
194 208 }
195 209
196 210 private function get_current_context(): string {
197 211 if ( isset( $_GET['page'] ) && sanitize_key( $_GET['page'] ) === self::PAGE_SLUG ) {