Changeset 3349251
- Timestamp:
- 08/24/2025 12:47:34 PM (6 months ago)
- Location:
- syncbooking
- Files:
-
- 152 added
- 6 edited
-
tags/1.20.0 (added)
-
tags/1.20.0/admin (added)
-
tags/1.20.0/admin/css (added)
-
tags/1.20.0/admin/css/syncbooking-admin.css (added)
-
tags/1.20.0/admin/js (added)
-
tags/1.20.0/admin/js/syncbooking-admin.js (added)
-
tags/1.20.0/admin/js/webflow-uncompressed.js (added)
-
tags/1.20.0/admin/js/webflow.js (added)
-
tags/1.20.0/admin/sync-booking-retrivedata.php (added)
-
tags/1.20.0/admin/tabs (added)
-
tags/1.20.0/admin/tabs/connect.php (added)
-
tags/1.20.0/assets (added)
-
tags/1.20.0/assets/icons (added)
-
tags/1.20.0/assets/icons/plyr.svg (added)
-
tags/1.20.0/assets/img (added)
-
tags/1.20.0/assets/img/webflow-badge-icon-d2.89e12c322e.svg (added)
-
tags/1.20.0/assets/img/webflow-badge-text-d2.c82cec3b78.svg (added)
-
tags/1.20.0/assets/media (added)
-
tags/1.20.0/assets/media/blank.mp4 (added)
-
tags/1.20.0/php (added)
-
tags/1.20.0/php/bar-sync (added)
-
tags/1.20.0/php/bar-sync/css (added)
-
tags/1.20.0/php/bar-sync/css/menu-bar-4aecde.webflow.css (added)
-
tags/1.20.0/php/bar-sync/css/normalize.css (added)
-
tags/1.20.0/php/bar-sync/css/webflow.css (added)
-
tags/1.20.0/php/bar-sync/form.php (added)
-
tags/1.20.0/php/bar-sync/js (added)
-
tags/1.20.0/php/bar-sync/js/form.js (added)
-
tags/1.20.0/php/bar-sync/js/webflow-uncompressed.js (added)
-
tags/1.20.0/php/bar-sync/js/webflow.js (added)
-
tags/1.20.0/php/syncbooking-template-manage.php (added)
-
tags/1.20.0/php/syncbooking-template.php (added)
-
tags/1.20.0/php/theme-sync (added)
-
tags/1.20.0/php/theme-sync/css (added)
-
tags/1.20.0/php/theme-sync/css/booking-8aa063.webflow.css (added)
-
tags/1.20.0/php/theme-sync/css/normalize.css (added)
-
tags/1.20.0/php/theme-sync/css/webflow.css (added)
-
tags/1.20.0/php/theme-sync/images (added)
-
tags/1.20.0/php/theme-sync/images/2024-10-30_13_31_48-Unbenanntes_Dokument.webp (added)
-
tags/1.20.0/php/theme-sync/images/Facebook-Dark.svg (added)
-
tags/1.20.0/php/theme-sync/images/Facebook.svg (added)
-
tags/1.20.0/php/theme-sync/images/Hapimag-amenities-baby-equipment.webp (added)
-
tags/1.20.0/php/theme-sync/images/Hapimag-amenities-coffee-capsule-machine.png (added)
-
tags/1.20.0/php/theme-sync/images/Hapimag-amenities-cooking-utensils.png (added)
-
tags/1.20.0/php/theme-sync/images/Hapimag-amenities-final-cleaning.webp (added)
-
tags/1.20.0/php/theme-sync/images/Hapimag-amenities-hygiene-essentials.png (added)
-
tags/1.20.0/php/theme-sync/images/Hapimag-amenities-safe.png (added)
-
tags/1.20.0/php/theme-sync/images/Hapimag-amenities-sponge-detergent-and-dish-towel.png (added)
-
tags/1.20.0/php/theme-sync/images/Hapimag-amenities-tv.png (added)
-
tags/1.20.0/php/theme-sync/images/Hapimag-amenities-weekly-change-of-towels-and-linen.webp (added)
-
tags/1.20.0/php/theme-sync/images/Hapimag-amenities-wifi.png (added)
-
tags/1.20.0/php/theme-sync/images/Hapimag-amenitries-hairdryer.png (added)
-
tags/1.20.0/php/theme-sync/images/Hapimag_Rene_Olsacher.jpg (added)
-
tags/1.20.0/php/theme-sync/images/Instagram-Dark.svg (added)
-
tags/1.20.0/php/theme-sync/images/Instagram.svg (added)
-
tags/1.20.0/php/theme-sync/images/NameLogo-1.svg (added)
-
tags/1.20.0/php/theme-sync/images/NameLogo-1_1.svg (added)
-
tags/1.20.0/php/theme-sync/images/NameLogo-2.svg (added)
-
tags/1.20.0/php/theme-sync/images/NameLogo-2_1.svg (added)
-
tags/1.20.0/php/theme-sync/images/NameLogo-3.svg (added)
-
tags/1.20.0/php/theme-sync/images/NameLogo-3_1.svg (added)
-
tags/1.20.0/php/theme-sync/images/NameLogo-4.svg (added)
-
tags/1.20.0/php/theme-sync/images/NameLogo-4_1.svg (added)
-
tags/1.20.0/php/theme-sync/images/NameLogo-5.svg (added)
-
tags/1.20.0/php/theme-sync/images/NameLogo-5_1.svg (added)
-
tags/1.20.0/php/theme-sync/images/NameLogo-6.svg (added)
-
tags/1.20.0/php/theme-sync/images/NameLogo-6_1.svg (added)
-
tags/1.20.0/php/theme-sync/images/NameLogo-7.svg (added)
-
tags/1.20.0/php/theme-sync/images/NameLogo-7_1.svg (added)
-
tags/1.20.0/php/theme-sync/images/NameLogo-8.svg (added)
-
tags/1.20.0/php/theme-sync/images/NameLogo-8_1.svg (added)
-
tags/1.20.0/php/theme-sync/images/Play-Dark.svg (added)
-
tags/1.20.0/php/theme-sync/images/Play.svg (added)
-
tags/1.20.0/php/theme-sync/images/Ripple.svg (added)
-
tags/1.20.0/php/theme-sync/images/Salzburg-Province-Zell_am_See-Bar.webp (added)
-
tags/1.20.0/php/theme-sync/images/Salzburg-Province-Zell_am_See-Children_s-playground.webp (added)
-
tags/1.20.0/php/theme-sync/images/Salzburg-Province-Zell_am_See-Wellness-Terrace-2.webp (added)
-
tags/1.20.0/php/theme-sync/images/Salzburg-Province-Zell_am_See-Wellness-indoor-swimming-pool-p-500.webp (added)
-
tags/1.20.0/php/theme-sync/images/Salzburg-Province-Zell_am_See-Wellness-indoor-swimming-pool.webp (added)
-
tags/1.20.0/php/theme-sync/images/Salzburg-Province-Zell_am_See-holiday-flats-5-p-500.webp (added)
-
tags/1.20.0/php/theme-sync/images/Salzburg-Province-Zell_am_See-holiday-flats-5.webp (added)
-
tags/1.20.0/php/theme-sync/images/Website-GettyImages-165525238.webp (added)
-
tags/1.20.0/php/theme-sync/images/X-Dark.svg (added)
-
tags/1.20.0/php/theme-sync/images/X.svg (added)
-
tags/1.20.0/php/theme-sync/images/account_balance_24dp_5F6368_FILL0_wght300_GRAD0_opsz24-1.svg (added)
-
tags/1.20.0/php/theme-sync/images/add_24dp_5F6368_FILL0_wght400_GRAD0_opsz24-1.svg (added)
-
tags/1.20.0/php/theme-sync/images/air_conditioning_not_available_icon_selected.webp (added)
-
tags/1.20.0/php/theme-sync/images/check_circle_24dp_5F6368_FILL1_wght400_GRAD0_opsz24-1.svg (added)
-
tags/1.20.0/php/theme-sync/images/chevron-down-solid-1-1.svg (added)
-
tags/1.20.0/php/theme-sync/images/chevron-down-solid-1.svg (added)
-
tags/1.20.0/php/theme-sync/images/close_24dp_5F6368_FILL0_wght400_GRAD0_opsz24-2.svg (added)
-
tags/1.20.0/php/theme-sync/images/do_not_disturb_on_24dp_5F6368_FILL1_wght400_GRAD0_opsz24-1.svg (added)
-
tags/1.20.0/php/theme-sync/images/favicon.png (added)
-
tags/1.20.0/php/theme-sync/images/finance_mode_24dp_5F6368_FILL0_wght300_GRAD0_opsz24-1.svg (added)
-
tags/1.20.0/php/theme-sync/images/generic_map_hotel-p-130x130q80.jpg (added)
-
tags/1.20.0/php/theme-sync/images/generic_map_hotel.jpg (added)
-
tags/1.20.0/php/theme-sync/images/loading-p-130x130q80.jpeg (added)
-
tags/1.20.0/php/theme-sync/images/loading.gif (added)
-
tags/1.20.0/php/theme-sync/images/logo-white.png (added)
-
tags/1.20.0/php/theme-sync/images/monitoring_24dp_5F6368_FILL0_wght300_GRAD0_opsz24-1.svg (added)
-
tags/1.20.0/php/theme-sync/images/north_east_24dp_5F6368_FILL0_wght400_GRAD0_opsz24-1.svg (added)
-
tags/1.20.0/php/theme-sync/images/north_east_24dp_5F6368_FILL0_wght400_GRAD0_opsz24-1_1.svg (added)
-
tags/1.20.0/php/theme-sync/images/paid_24dp_5F6368_FILL0_wght300_GRAD0_opsz24-1.svg (added)
-
tags/1.20.0/php/theme-sync/images/remove_24dp_5F6368_FILL0_wght400_GRAD0_opsz24-1.svg (added)
-
tags/1.20.0/php/theme-sync/images/reservation.webp (added)
-
tags/1.20.0/php/theme-sync/images/staticmap.png (added)
-
tags/1.20.0/php/theme-sync/images/sync_24dp_5F6368_FILL0_wght300_GRAD0_opsz24-1.svg (added)
-
tags/1.20.0/php/theme-sync/images/webclip.png (added)
-
tags/1.20.0/php/theme-sync/images/xmark.svg (added)
-
tags/1.20.0/php/theme-sync/js (added)
-
tags/1.20.0/php/theme-sync/js/webflow-touch-uncompressed.js (added)
-
tags/1.20.0/php/theme-sync/js/webflow-touch.js (added)
-
tags/1.20.0/php/theme-sync/js/webflow-uncompressed.js (added)
-
tags/1.20.0/php/theme-sync/js/webflow.js (added)
-
tags/1.20.0/php/theme-sync/js/webfont.js (added)
-
tags/1.20.0/php/theme-sync/page (added)
-
tags/1.20.0/php/theme-sync/page/booking.php (added)
-
tags/1.20.0/php/theme-sync/page/common_functions.php (added)
-
tags/1.20.0/php/theme-sync/page/manage-booking.php (added)
-
tags/1.20.0/php/theme-sync/page/plugin (added)
-
tags/1.20.0/php/theme-sync/page/plugin/webfont.js (added)
-
tags/1.20.0/php/theme-sync/page/plugin/webfontloader.js (added)
-
tags/1.20.0/php/theme-sync/page/website (added)
-
tags/1.20.0/php/theme-sync/page/website/footer.php (added)
-
tags/1.20.0/php/theme-sync/page/website/header.php (added)
-
tags/1.20.0/php/theme-sync/page/website/include (added)
-
tags/1.20.0/php/theme-sync/page/website/include/gallery.php (added)
-
tags/1.20.0/php/theme-sync/page/website/include/js (added)
-
tags/1.20.0/php/theme-sync/page/website/include/js/js_calendar.js (added)
-
tags/1.20.0/php/theme-sync/page/website/include/js/js_sendemail.js (added)
-
tags/1.20.0/php/theme-sync/page/website/include/js/next.js (added)
-
tags/1.20.0/php/theme-sync/page/website/include/js_calendar (added)
-
tags/1.20.0/php/theme-sync/page/website/include/js_calendar/flatpickr (added)
-
tags/1.20.0/php/theme-sync/page/website/include/js_calendar/flatpickr/flatpickr.min.css (added)
-
tags/1.20.0/php/theme-sync/page/website/include/js_calendar/flatpickr/flatpickr.min.js (added)
-
tags/1.20.0/php/theme-sync/page/website/include/js_calendar/glightbox (added)
-
tags/1.20.0/php/theme-sync/page/website/include/js_calendar/glightbox/glightbox.min.css (added)
-
tags/1.20.0/php/theme-sync/page/website/include/js_calendar/glightbox/glightbox.min.js (added)
-
tags/1.20.0/php/theme-sync/page/website/include/js_calendar/glightbox/plyr.css (added)
-
tags/1.20.0/php/theme-sync/page/website/include/js_calendar/glightbox/plyr.js (added)
-
tags/1.20.0/php/theme-sync/page/website/include/parts (added)
-
tags/1.20.0/php/theme-sync/page/website/include/parts/fixed-wrapper.php (added)
-
tags/1.20.0/php/theme-sync/page/website/include/parts/footer.php (added)
-
tags/1.20.0/php/theme-sync/page/website/include/parts/header_functions.php (added)
-
tags/1.20.0/php/theme-sync/page/website/include/parts/navbar-wrapper.php (added)
-
tags/1.20.0/php/theme-sync/page/website/include/pop-up.php (added)
-
tags/1.20.0/php/theme-sync/page/website/manage-booking.php (added)
-
tags/1.20.0/php/theme-sync/page/website/search.php (added)
-
tags/1.20.0/readme.txt (added)
-
tags/1.20.0/sync-bar.php (added)
-
tags/1.20.0/sync-booking-page.php (added)
-
tags/1.20.0/sync-booking.php (added)
-
trunk/php/theme-sync/page/website/header.php (modified) (1 diff)
-
trunk/php/theme-sync/page/website/manage-booking.php (modified) (1 diff)
-
trunk/php/theme-sync/page/website/search.php (modified) (1 diff)
-
trunk/readme.txt (modified) (1 diff)
-
trunk/sync-booking-page.php (modified) (2 diffs)
-
trunk/sync-booking.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
syncbooking/trunk/php/theme-sync/page/website/header.php
r3315503 r3349251 20 20 <link href="<?php echo esc_html($website_plugin_dir);?>/images/favicon.png" rel="shortcut icon" type="image/x-icon"> 21 21 <link href="<?php echo esc_html($website_plugin_dir);?>/images/webclip.png" rel="apple-touch-icon"> 22 <?php wp_head(); ?>22 <?php if (function_exists('syncbooking_print_head_assets')) syncbooking_print_head_assets(); ?> 23 23 </head> -
syncbooking/trunk/php/theme-sync/page/website/manage-booking.php
r3315503 r3349251 58 58 </div> 59 59 </div> 60 <?php wp_footer(); ?>60 <?php if (function_exists('syncbooking_print_footer_assets')) syncbooking_print_footer_assets(); ?> 61 61 </body> -
syncbooking/trunk/php/theme-sync/page/website/search.php
r3335386 r3349251 141 141 </div> 142 142 </div> 143 <?php wp_footer(); ?>143 <?php if (function_exists('syncbooking_print_footer_assets')) syncbooking_print_footer_assets(); ?> 144 144 </body> -
syncbooking/trunk/readme.txt
r3347229 r3349251 3 3 Requires at least: 5.0 4 4 Tested up to: 6.8 5 Stable tag: 1. 19.05 Stable tag: 1.20.0 6 6 Requires PHP: 7.2 7 7 Contributors: automaticbnb -
syncbooking/trunk/sync-booking-page.php
r3315503 r3349251 4 4 function syncbooking_enqueue_assets_only_on_booking_page() { 5 5 if (!is_page()) return; 6 7 6 global $post; 8 7 if (!isset($post)) return; 8 $template_slug = get_page_template_slug($post->ID); 9 if ($template_slug === 'syncbooking-template.php' || $template_slug === 'syncbooking-template-manage.php') { 10 // base paths 11 $calendar_base = plugins_url('php/theme-sync/page/website/include/js_calendar/', syncbooking_PLUGIN_FILE); 12 $css_base = plugins_url('php/theme-sync/css/', syncbooking_PLUGIN_FILE); 13 $js_base = plugins_url('php/theme-sync/page/plugin/', syncbooking_PLUGIN_FILE); 14 $plugin_js_url = plugins_url('php/theme-sync/js/webflow.js', syncbooking_PLUGIN_FILE); 15 $calendar_app_js = plugins_url('php/theme-sync/page/website/include/js/js_calendar.js', syncbooking_PLUGIN_FILE); 16 $next_app_js = plugins_url('php/theme-sync/page/website/include/js/next.js', syncbooking_PLUGIN_FILE); 9 17 10 $template_slug = get_page_template_slug($post->ID); 18 // === PRIMA: tutti gli asset con handle "syncbooking-*" === 19 wp_enqueue_style('syncbooking-normalize', $css_base . 'normalize.css', [], syncbooking_PLUGIN_VERSION); 20 wp_enqueue_style('syncbooking-webflow', $css_base . 'webflow.css', [], syncbooking_PLUGIN_VERSION); 21 wp_enqueue_style('syncbooking-booking', $css_base . 'booking-8aa063.webflow.css', [], syncbooking_PLUGIN_VERSION); 11 22 12 // Agisce solo su queste due pagine 13 if ($template_slug === 'syncbooking-template.php' || $template_slug === 'syncbooking-template-manage.php') { 23 wp_enqueue_script('syncbooking-webfont-loader', esc_url(syncbooking_PLUGIN_URL . 'php/theme-sync/js/webfont.js'), ['jquery'], syncbooking_PLUGIN_VERSION, true); 24 wp_enqueue_script('syncbooking-webflow-touch', plugin_dir_url(__FILE__) . 'php/theme-sync/js/webflow-touch.js', ['jquery'], syncbooking_PLUGIN_VERSION, true); 25 wp_enqueue_script('syncbooking-next-app', $next_app_js, ['jquery'], syncbooking_PLUGIN_VERSION, true); 26 wp_enqueue_script('syncbooking-js-sendemail', plugins_url('php/theme-sync/page/website/include/js/js_sendemail.js', syncbooking_PLUGIN_FILE), ['jquery'], syncbooking_PLUGIN_VERSION, true); 14 27 15 // ✅ JS & CSS Calendar 28 // Localize/inline correlati a handle "syncbooking-*" 29 $syncbooking_structure_data = get_option('syncbooking_website_data'); 30 $website_data = $syncbooking_structure_data; // stesso get_option usato sotto dall'utente 31 wp_localize_script('syncbooking-js-sendemail', 'syncbooking_email_data', [ 32 'api_retrivedata' => esc_js($website_data['api_retrivedata'] ?? ''), 33 'api_endpoint' => 'https://booking.syncbooking.com/api-send-email/' 34 ]); 35 wp_add_inline_script('syncbooking-webfont-loader', 'WebFont.load({google:{families:["DM Sans:300,regular,500,600,700,800,900","DM Mono:300,regular,500"]}});'); 36 37 // === DOPO: gli altri asset (non "syncbooking-*") === 16 38 wp_enqueue_script('jquery'); // Carica sempre jQuery per primo! 17 18 $calendar_base = plugins_url('php/theme-sync/page/website/include/js_calendar/', syncbooking_PLUGIN_FILE);19 39 wp_enqueue_style('flatpickr-css', $calendar_base . 'flatpickr/flatpickr.min.css', [], syncbooking_PLUGIN_VERSION); 20 40 wp_enqueue_script('flatpickr-js', $calendar_base . 'flatpickr/flatpickr.min.js', ['jquery'], syncbooking_PLUGIN_VERSION, true); 21 22 41 wp_enqueue_style('glightbox-css', $calendar_base . 'glightbox/glightbox.min.css', [], syncbooking_PLUGIN_VERSION); 23 42 wp_enqueue_script('glightbox-js', $calendar_base . 'glightbox/glightbox.min.js', ['jquery'], syncbooking_PLUGIN_VERSION, true); 43 wp_enqueue_script('webfont-loader', $js_base . 'webfont.js', ['jquery'], syncbooking_PLUGIN_VERSION, false); 44 wp_enqueue_script('webflow-js', $plugin_js_url, ['jquery'], syncbooking_PLUGIN_VERSION, true); 24 45 25 // ✅ Webflow CSS/JS per THEME 26 $css_base = plugins_url('php/theme-sync/css/', syncbooking_PLUGIN_FILE); 27 $js_base = plugins_url('php/theme-sync/page/plugin/', syncbooking_PLUGIN_FILE); 46 // Solo ora posso enqueuare quello che dipende da flatpickr/glightbox/webflow 47 wp_enqueue_script('syncbooking-calendar-app', $calendar_app_js, ['jquery','flatpickr-js','glightbox-js','webflow-js'], syncbooking_PLUGIN_VERSION, true); 28 48 29 wp_enqueue_style('syncbooking-normalize', $css_base . 'normalize.css', [], syncbooking_PLUGIN_VERSION); 30 wp_enqueue_style('syncbooking-webflow', $css_base . 'webflow.css', [], syncbooking_PLUGIN_VERSION); 31 wp_enqueue_style('syncbooking-booking', $css_base . 'booking-8aa063.webflow.css', [], syncbooking_PLUGIN_VERSION); 32 33 wp_enqueue_script('webfont-loader', $js_base . 'webfont.js', ['jquery'], syncbooking_PLUGIN_VERSION, false); 34 35 $plugin_js_url = plugins_url('php/theme-sync/js/webflow.js', syncbooking_PLUGIN_FILE); 36 wp_enqueue_script( 37 'webflow-js', 38 $plugin_js_url, 39 ['jquery'], 40 syncbooking_PLUGIN_VERSION, 41 true 42 ); 43 44 // ✅ JS personalizzati, tutti dipendono almeno da jQuery! 45 $calendar_app_js = plugins_url('php/theme-sync/page/website/include/js/js_calendar.js', syncbooking_PLUGIN_FILE); 46 wp_enqueue_script( 47 'syncbooking-calendar-app', 48 $calendar_app_js, 49 ['jquery', 'flatpickr-js', 'glightbox-js', 'webflow-js'], 50 syncbooking_PLUGIN_VERSION, 51 true 52 ); 53 54 // Next Tab/Room (nuovo) 55 $next_app_js = plugins_url('php/theme-sync/page/website/include/js/next.js', syncbooking_PLUGIN_FILE); 56 wp_enqueue_script( 57 'syncbooking-next-app', 58 $next_app_js, 59 ['jquery'], 60 syncbooking_PLUGIN_VERSION, 61 true 62 ); 63 64 // Email 65 wp_enqueue_script( 66 'syncbooking-js-sendemail', 67 plugins_url('php/theme-sync/page/website/include/js/js_sendemail.js', syncbooking_PLUGIN_FILE), 68 ['jquery'], 69 syncbooking_PLUGIN_VERSION, 70 true 71 ); 72 73 // WebFont Loader da file locale (già sopra, ma se serve doppio, ok) 74 wp_enqueue_script( 75 'syncbooking-webfont-loader', 76 esc_url(syncbooking_PLUGIN_URL . 'php/theme-sync/js/webfont.js'), 77 ['jquery'], 78 syncbooking_PLUGIN_VERSION, 79 true 80 ); 81 82 // Touch 83 wp_enqueue_script( 84 'syncbooking-webflow-touch', 85 plugin_dir_url(__FILE__) . 'php/theme-sync/js/webflow-touch.js', 86 ['jquery'], 87 syncbooking_PLUGIN_VERSION, 88 true 89 ); 90 91 // Passaggio dati PHP → JS 92 $syncbooking_structure_data = get_option('syncbooking_website_data'); 49 // Localize/inline rimanenti 93 50 wp_localize_script('syncbooking-calendar-app', 'syncbooking_structure_data', [ 94 51 'structure_id' => esc_js($syncbooking_structure_data['id'] ?? 1), … … 97 54 'total_rooms' => intval($syncbooking_structure_data['total_rooms'] ?? 1), 98 55 ]); 56 wp_add_inline_script('webflow-js', 'window.$ = window.jQuery;', 'before'); 99 57 100 $website_data = get_option('syncbooking_website_data');101 wp_localize_script('syncbooking-js-sendemail', 'syncbooking_email_data', [102 'api_retrivedata' => esc_js($website_data["api_retrivedata"] ?? ''),103 'api_endpoint' => 'https://booking.syncbooking.com/api-send-email/'104 ]);105 106 // Script inline per Google Fonts107 wp_add_inline_script(108 'syncbooking-webfont-loader',109 'WebFont.load({110 google: {111 families: ["DM Sans:300,regular,500,600,700,800,900","DM Mono:300,regular,500"]112 }113 });'114 );115 wp_add_inline_script(116 'webflow-js',117 'window.$ = window.jQuery;',118 'before'119 );120 // Aggiunta CSS inline con root variables121 58 if (!empty($website_data)) { 122 $brand_primary = sanitize_hex_color($website_data['brand_primary'] ?? '#a55c5b');123 $brand_secondary = sanitize_hex_color($website_data['brand_secondary'] ?? '#ffffff');59 $brand_primary = sanitize_hex_color($website_data['brand_primary'] ?? '#a55c5b'); 60 $brand_secondary = sanitize_hex_color($website_data['brand_secondary'] ?? '#ffffff'); 124 61 $menu_button_link_color = sanitize_hex_color($website_data['menu_button_link_color'] ?? '#333333'); 125 126 $css = ":root { 127 --syncbooking_maincolor: {$brand_primary} !important; 128 --syncbooking_textcolor: {$brand_secondary} !important; 129 --syncbooking_buttoncolor: {$menu_button_link_color} !important; 130 --syncbooking_barfont: {$brand_secondary} !important; 131 }"; 132 62 $css = ":root{--syncbooking_maincolor:{$brand_primary}!important;--syncbooking_textcolor:{$brand_secondary}!important;--syncbooking_buttoncolor:{$menu_button_link_color}!important;--syncbooking_barfont:{$brand_secondary}!important;}"; 133 63 wp_add_inline_style('syncbooking-normalize', $css); 134 64 } 135 65 } 136 66 } 67 68 // --- Helper: riconosce le pagine con i template SyncBooking 69 function syncbooking_is_sync_page(): bool { 70 if (!is_page()) return false; 71 global $post; 72 if (!$post) return false; 73 $slug = get_page_template_slug($post->ID); 74 return in_array($slug, ['syncbooking-template.php','syncbooking-template-manage.php'], true); 75 } 76 77 /** 78 * Stampa SOLO i CSS/JS pensati per l'HEAD (al posto di wp_head()). 79 * Usa gli handle già enqueued dalla tua funzione. 80 */ 81 function syncbooking_print_head_assets() { 82 if (!syncbooking_is_sync_page()) { wp_head(); return; } 83 84 // Allow-list: SOLO i tuoi CSS e gli script head 85 $ALLOW_STYLES = [ 86 'syncbooking-normalize', 87 'syncbooking-webflow', 88 'syncbooking-booking', 89 'flatpickr-css', 90 'glightbox-css', 91 ]; 92 $ALLOW_SCRIPTS_HEAD = [ 93 'jquery', // enqueued in head 94 'webfont-loader', // enqueued in head (false -> head) 95 // NB: lasciamo fuori i tuoi script "syncbooking-*" che sono in footer 96 ]; 97 // Quelli di footer (li dichiariamo qui per far conoscere dipendenze al sistema) 98 $ALLOW_SCRIPTS_FOOT = [ 99 'webflow-js','flatpickr-js','glightbox-js', 100 'syncbooking-calendar-app','syncbooking-next-app', 101 'syncbooking-js-sendemail','syncbooking-webflow-touch', 102 'syncbooking-webfont-loader', // rimane così come nel tuo codice 103 ]; 104 105 global $wp_styles, $wp_scripts; 106 107 // Assicurati che l'enqueue sia avvenuto 108 do_action('wp_enqueue_scripts'); 109 110 // STILI: tieni solo quelli consentiti 111 if ($wp_styles instanceof WP_Styles) { 112 $wp_styles->queue = array_values(array_intersect($ALLOW_STYLES, array_keys($wp_styles->registered))); 113 } 114 wp_print_styles(); // stampa solo i CSS in queue 115 116 // SCRIPT: metti in queue sia head che footer, ma ora stampi solo head 117 if ($wp_scripts instanceof WP_Scripts) { 118 $all_my_scripts = array_unique(array_merge($ALLOW_SCRIPTS_HEAD, $ALLOW_SCRIPTS_FOOT)); 119 $wp_scripts->queue = array_values(array_intersect($all_my_scripts, array_keys($wp_scripts->registered))); 120 $wp_scripts->in_footer = $ALLOW_SCRIPTS_FOOT; // il resto andrà nel footer 121 } 122 wp_print_head_scripts(); // stampa solo gli script di head 123 } 124 125 /** 126 * Stampa SOLO i JS di footer (al posto di wp_footer()). 127 */ 128 function syncbooking_print_footer_assets() { 129 if (!syncbooking_is_sync_page()) { wp_footer(); return; } 130 wp_print_footer_scripts(); // stampa solo quelli marcati in_footer 131 } -
syncbooking/trunk/sync-booking.php
r3347229 r3349251 4 4 Plugin URI: http://syncbooking.com/plugin 5 5 Description: Sync All Booking of your Hotel or BnB, and get new bookings!. 6 Version: 1. 19.06 Version: 1.20.0 7 7 Author: SyncBooking.com 8 8 Author URI: http://syncbooking.com/ … … 17 17 define( 'syncbooking_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); 18 18 define( 'syncbooking_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); 19 define( 'syncbooking_PLUGIN_VERSION', "1. 19.0" );19 define( 'syncbooking_PLUGIN_VERSION', "1.20.0" ); 20 20 21 21 global $syncbooking_structure_data;
Note: See TracChangeset
for help on using the changeset viewer.