Changeset 3334405
- Timestamp:
- 07/26/2025 02:52:53 AM (7 months ago)
- Location:
- havenlytics
- Files:
-
- 110 added
- 19 edited
-
assets/banner-1544x500.jpg (modified) (previous)
-
assets/banner-772x250.jpg (modified) (previous)
-
assets/icon-256x256.jpg (modified) (previous)
-
assets/screenshot-8.jpg (added)
-
tags/1.0.8 (added)
-
tags/1.0.8/admin (added)
-
tags/1.0.8/admin/assets (added)
-
tags/1.0.8/admin/assets/css (added)
-
tags/1.0.8/admin/assets/css/havenlytics-metabox.css (added)
-
tags/1.0.8/admin/assets/css/leaflet (added)
-
tags/1.0.8/admin/assets/css/leaflet/leaflet.css (added)
-
tags/1.0.8/admin/assets/js (added)
-
tags/1.0.8/admin/assets/js/havenlytics-metabox.js (added)
-
tags/1.0.8/admin/assets/js/leaflet (added)
-
tags/1.0.8/admin/assets/js/leaflet/leaflet.js (added)
-
tags/1.0.8/admin/class-admin-assets.php (added)
-
tags/1.0.8/havenlytics.php (added)
-
tags/1.0.8/includes (added)
-
tags/1.0.8/includes/class-init.php (added)
-
tags/1.0.8/includes/class-meta-fields.php (added)
-
tags/1.0.8/includes/class-post-type.php (added)
-
tags/1.0.8/includes/class-property-views.php (added)
-
tags/1.0.8/includes/class-shortcodes.php (added)
-
tags/1.0.8/includes/functions-core.php (added)
-
tags/1.0.8/includes/modals (added)
-
tags/1.0.8/includes/modals/modal-agent.php (added)
-
tags/1.0.8/includes/modals/modal-brochure.php (added)
-
tags/1.0.8/includes/modals/modal-enquiry.php (added)
-
tags/1.0.8/includes/modals/modal-epc.php (added)
-
tags/1.0.8/includes/modals/modal-floorplan.php (added)
-
tags/1.0.8/includes/modals/modal-map.php (added)
-
tags/1.0.8/includes/modals/modal-mortgage-calculator.php (added)
-
tags/1.0.8/includes/modals/modal-viewing.php (added)
-
tags/1.0.8/includes/modals/modal-virtual-tour.php (added)
-
tags/1.0.8/languages (added)
-
tags/1.0.8/languages/havenlytics.pot (added)
-
tags/1.0.8/public (added)
-
tags/1.0.8/public/assets (added)
-
tags/1.0.8/public/assets/css (added)
-
tags/1.0.8/public/assets/css/havenlytics-mortgage-calculator.init.css (added)
-
tags/1.0.8/public/assets/css/havenlytics-property-featured-carousel.css (added)
-
tags/1.0.8/public/assets/css/havenlytics-property-grid.css (added)
-
tags/1.0.8/public/assets/css/havenlytics-property-list.css (added)
-
tags/1.0.8/public/assets/css/havenlytics-property-popups.css (added)
-
tags/1.0.8/public/assets/css/havenlytics-property-related-carousel.css (added)
-
tags/1.0.8/public/assets/css/havenlytics-property-single.css (added)
-
tags/1.0.8/public/assets/css/havenlytics-property-video.css (added)
-
tags/1.0.8/public/assets/css/havenlytics-root-style.css (added)
-
tags/1.0.8/public/assets/img (added)
-
tags/1.0.8/public/assets/img/layers-2x.png (added)
-
tags/1.0.8/public/assets/img/layers.png (added)
-
tags/1.0.8/public/assets/img/marker-icon.png (added)
-
tags/1.0.8/public/assets/img/no-thumb.png (added)
-
tags/1.0.8/public/assets/img/video-placeholder.png (added)
-
tags/1.0.8/public/assets/js (added)
-
tags/1.0.8/public/assets/js/havenlytics-frontend-popups.js (added)
-
tags/1.0.8/public/assets/js/havenlytics-frontend-scripts.js (added)
-
tags/1.0.8/public/assets/js/havenlytics-map.js (added)
-
tags/1.0.8/public/assets/js/havenlytics-mortgage-calculator.init.js (added)
-
tags/1.0.8/public/assets/plugins (added)
-
tags/1.0.8/public/assets/plugins/bootstrap (added)
-
tags/1.0.8/public/assets/plugins/bootstrap/css (added)
-
tags/1.0.8/public/assets/plugins/bootstrap/css/bootstrap.min.css (added)
-
tags/1.0.8/public/assets/plugins/bootstrap/css/leaflet.css (added)
-
tags/1.0.8/public/assets/plugins/bootstrap/js (added)
-
tags/1.0.8/public/assets/plugins/bootstrap/js/bootstrap.bundle.min.js (added)
-
tags/1.0.8/public/assets/plugins/bootstrap/js/leaflet.js (added)
-
tags/1.0.8/public/assets/plugins/fontawesome (added)
-
tags/1.0.8/public/assets/plugins/fontawesome/css (added)
-
tags/1.0.8/public/assets/plugins/fontawesome/css/all.min.css (added)
-
tags/1.0.8/public/assets/plugins/fontawesome/css/fontawesome.min.css (added)
-
tags/1.0.8/public/assets/plugins/fontawesome/webfonts (added)
-
tags/1.0.8/public/assets/plugins/fontawesome/webfonts/fa-brands-400.ttf (added)
-
tags/1.0.8/public/assets/plugins/fontawesome/webfonts/fa-brands-400.woff2 (added)
-
tags/1.0.8/public/assets/plugins/fontawesome/webfonts/fa-regular-400.ttf (added)
-
tags/1.0.8/public/assets/plugins/fontawesome/webfonts/fa-regular-400.woff2 (added)
-
tags/1.0.8/public/assets/plugins/fontawesome/webfonts/fa-solid-900.ttf (added)
-
tags/1.0.8/public/assets/plugins/fontawesome/webfonts/fa-solid-900.woff2 (added)
-
tags/1.0.8/public/assets/plugins/fontawesome/webfonts/fa-v4compatibility.ttf (added)
-
tags/1.0.8/public/assets/plugins/fontawesome/webfonts/fa-v4compatibility.woff2 (added)
-
tags/1.0.8/public/assets/plugins/jspdf (added)
-
tags/1.0.8/public/assets/plugins/jspdf/html2canvas.min.js (added)
-
tags/1.0.8/public/assets/plugins/jspdf/jspdf.umd.min.js (added)
-
tags/1.0.8/public/assets/plugins/leaflet (added)
-
tags/1.0.8/public/assets/plugins/leaflet/css (added)
-
tags/1.0.8/public/assets/plugins/leaflet/css/leaflet.css (added)
-
tags/1.0.8/public/assets/plugins/leaflet/js (added)
-
tags/1.0.8/public/assets/plugins/leaflet/js/leaflet.js (added)
-
tags/1.0.8/public/assets/plugins/owl.carouse (added)
-
tags/1.0.8/public/assets/plugins/owl.carouse/css (added)
-
tags/1.0.8/public/assets/plugins/owl.carouse/css/owl.carousel.min.css (added)
-
tags/1.0.8/public/assets/plugins/owl.carouse/js (added)
-
tags/1.0.8/public/assets/plugins/owl.carouse/js/owl.carousel.min.js (added)
-
tags/1.0.8/public/assets/plugins/theia-sticky-sidebar (added)
-
tags/1.0.8/public/assets/plugins/theia-sticky-sidebar/ResizeSensor.js (added)
-
tags/1.0.8/public/assets/plugins/theia-sticky-sidebar/theia-sticky-sidebar.js (added)
-
tags/1.0.8/public/class-frontend-assets.php (added)
-
tags/1.0.8/public/class-frontend.php (added)
-
tags/1.0.8/readme.txt (added)
-
tags/1.0.8/templates (added)
-
tags/1.0.8/templates/hvnly_property-single.php (added)
-
tags/1.0.8/templates/property-card-grid.php (added)
-
tags/1.0.8/templates/property-card-list.php (added)
-
tags/1.0.8/templates/property-card.php (added)
-
tags/1.0.8/uninstall.php (added)
-
trunk/admin/assets/css/havenlytics-metabox.css (modified) (9 diffs)
-
trunk/admin/assets/js/havenlytics-metabox.js (modified) (3 diffs)
-
trunk/havenlytics.php (modified) (2 diffs)
-
trunk/includes/class-init.php (modified) (4 diffs)
-
trunk/includes/class-meta-fields.php (modified) (24 diffs)
-
trunk/includes/class-property-views.php (added)
-
trunk/includes/class-shortcodes.php (added)
-
trunk/includes/modals/modal-mortgage-calculator.php (added)
-
trunk/public/assets/css/havenlytics-mortgage-calculator.init.css (added)
-
trunk/public/assets/css/havenlytics-property-popups.css (modified) (3 diffs)
-
trunk/public/assets/css/havenlytics-root-style.css (modified) (1 diff)
-
trunk/public/assets/js/havenlytics-frontend-scripts.js (modified) (1 diff)
-
trunk/public/assets/js/havenlytics-mortgage-calculator.init.js (added)
-
trunk/public/assets/plugins/jspdf (added)
-
trunk/public/assets/plugins/jspdf/html2canvas.min.js (added)
-
trunk/public/assets/plugins/jspdf/jspdf.umd.min.js (added)
-
trunk/public/class-frontend-assets.php (modified) (1 diff)
-
trunk/public/class-frontend.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (3 diffs)
-
trunk/templates/hvnly_property-single.php (modified) (2 diffs)
-
trunk/templates/property-card-grid.php (modified) (2 diffs)
-
trunk/templates/property-card-list.php (modified) (1 diff)
-
trunk/templates/property-card.php (modified) (1 diff)
-
trunk/uninstall.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
havenlytics/trunk/admin/assets/css/havenlytics-metabox.css
r3332499 r3334405 868 868 869 869 /* Featured Toggle */ 870 .havenlytics_property_featured .havenlytics-featured-toggle {870 .havenlytics_property_featured .havenlytics-featured-toggle, .havenlytics_property_calculator .havenlytics-calculator-toggle { 871 871 position: relative; 872 872 display: inline-flex; … … 876 876 } 877 877 878 .havenlytics_property_featured .havenlytics-featured-toggle input {878 .havenlytics_property_featured .havenlytics-featured-toggle input, .havenlytics_property_calculator .havenlytics-calculator-toggle input { 879 879 opacity: 0; 880 880 width: 0; … … 883 883 } 884 884 885 .havenlytics_property_featured .havenlytics-featured-slider {885 .havenlytics_property_featured .havenlytics-featured-slider ,.havenlytics_property_calculator .havenlytics-calculator-slider { 886 886 position: relative; 887 887 display: inline-block; … … 894 894 } 895 895 896 .havenlytics_property_featured .havenlytics-featured-slider:before {896 .havenlytics_property_featured .havenlytics-featured-slider:before , .havenlytics_property_calculator .havenlytics-calculator-slider:before{ 897 897 position: absolute; 898 898 content: ""; … … 909 909 910 910 /* Active state - Primary color */ 911 .havenlytics_property_featured input:checked+.havenlytics-featured-slider { 911 .havenlytics_property_featured input:checked+.havenlytics-featured-slider, 912 .havenlytics_property_calculator input:checked+.havenlytics-calculator-slider { 912 913 background-color: var(--havenlytics-primary, #6C60FE); 913 914 } 914 915 915 .havenlytics_property_featured input:checked+.havenlytics-featured-slider:before { 916 .havenlytics_property_featured input:checked+.havenlytics-featured-slider:before, 917 .havenlytics_property_calculator input:checked+.havenlytics-calculator-slider:before { 916 918 transform: translateX(30px); 917 919 background: var(--havenlytics-bg-white, #FFFFFF); … … 919 921 920 922 /* Hover state - Secondary color */ 921 .havenlytics_property_featured .havenlytics-featured-toggle:hover input:not(:checked)+.havenlytics-featured-slider { 923 .havenlytics_property_featured .havenlytics-featured-toggle:hover input:not(:checked)+.havenlytics-featured-slider, 924 .havenlytics_property_calculator .havenlytics-calculator-toggle:hover input:not(:checked)+.havenlytics-calculator-slider { 922 925 background-color: var(--havenlytics-secondary, #764ba2); 923 926 } 924 927 925 .havenlytics_property_featured .havenlytics-featured-toggle:hover input:checked+.havenlytics-featured-slider { 928 .havenlytics_property_featured .havenlytics-featured-toggle:hover input:checked+.havenlytics-featured-slider, 929 .havenlytics_property_calculator .havenlytics-calculator-toggle:hover input:checked+.havenlytics-calculator-slider { 926 930 background-color: var(--havenlytics-btnPrimaryHover, #5944f0); 927 931 } 928 932 929 933 /* Pulse animation using primary color */ 930 .havenlytics_property_featured input:checked+.havenlytics-featured-slider { 934 .havenlytics_property_featured input:checked+.havenlytics-featured-slider , 935 .havenlytics_property_calculator input:checked+.havenlytics-calculator-slider { 931 936 animation: havenlyticsFeaturedPulse 0.8s 1; 932 937 } … … 947 952 948 953 /* On/Off labels */ 949 .havenlytics_property_featured .havenlytics-featured-label { 954 .havenlytics_property_featured .havenlytics-featured-label , 955 .havenlytics_property_calculator .havenlytics-calculator-label { 950 956 display: flex; 951 957 font-size: var(--havenlytics-labelSize, 0.8rem); … … 954 960 } 955 961 956 .havenlytics_property_featured .havenlytics-featured-on { 962 .havenlytics_property_featured .havenlytics-featured-on , 963 .havenlytics_property_calculator .havenlytics-calculator-on { 957 964 color: var(--havenlytics-success, #00B46A); 958 965 display: none; 959 966 } 960 967 961 .havenlytics_property_featured .havenlytics-featured-off { 968 .havenlytics_property_featured .havenlytics-featured-off , 969 .havenlytics_property_calculator .havenlytics-calculator-off { 962 970 color: var(--havenlytics-alert, #FF4D4F); 963 971 } 964 972 965 .havenlytics_property_featured input:checked~.havenlytics-featured-label .havenlytics-featured-on { 973 .havenlytics_property_featured input:checked~.havenlytics-featured-label .havenlytics-featured-on , 974 .havenlytics_property_calculator input:checked~.havenlytics-calculator-label .havenlytics-calculator-on { 966 975 display: inline; 967 976 } 968 977 969 .havenlytics_property_featured input:checked~.havenlytics-featured-label .havenlytics-featured-off { 978 .havenlytics_property_featured input:checked~.havenlytics-featured-label .havenlytics-featured-off , 979 .havenlytics_property_calculator input:checked~.havenlytics-calculator-label .havenlytics-calculator-off { 970 980 display: none; 971 981 } 972 982 973 983 /* Bounce animation */ 974 .havenlytics_property_featured .havenlytics-toggle-animate .havenlytics-featured-slider:before { 984 .havenlytics_property_featured .havenlytics-toggle-animate .havenlytics-featured-slider:before, 985 .havenlytics_property_calculator .havenlytics-toggle-animate .havenlytics-calculator-slider:before { 975 986 animation: havenlyticsFeaturedBounce 0.4s; 976 987 } … … 997 1008 998 1009 #havenlytics_property_featured button.handle-order-higher, 999 #havenlytics_property_featured button.handle-order-lower{display: none !important;} 1010 #havenlytics_property_featured button.handle-order-lower, 1011 #havenlytics_property_calculator button.handle-order-higher, 1012 #havenlytics_property_calculator button.handle-order-lower 1013 {display: none !important;} -
havenlytics/trunk/admin/assets/js/havenlytics-metabox.js
r3332499 r3334405 381 381 382 382 // Initialize slider positions 383 $('.havenlytics_property_featured .havenlytics-featured-toggle input ').each(function() {384 const slider = $(this).siblings('.havenlytics-featured-slider ');383 $('.havenlytics_property_featured .havenlytics-featured-toggle input, .havenlytics_property_calculator .havenlytics-calculator-toggle input').each(function() { 384 const slider = $(this).siblings('.havenlytics-featured-slider, .havenlytics-calculator-slider'); 385 385 const position = this.checked ? 30 : 0; 386 386 slider[0].style.setProperty('--current-position', position + 'px'); … … 388 388 389 389 // Toggle interaction 390 $('.havenlytics_property_featured .havenlytics-featured-toggle input ').on('change', function() {391 const toggle = $(this).closest('.havenlytics-featured-toggle ');392 const slider = $(this).siblings('.havenlytics-featured-slider ');390 $('.havenlytics_property_featured .havenlytics-featured-toggle input, .havenlytics_property_calculator .havenlytics-calculator-toggle input').on('change', function() { 391 const toggle = $(this).closest('.havenlytics-featured-toggle, .havenlytics-calculator-toggle'); 392 const slider = $(this).siblings('.havenlytics-featured-slider, .havenlytics-calculator-slider'); 393 393 const position = this.checked ? 30 : 0; 394 394 … … 406 406 // Add pulse effect when checked 407 407 if (this.checked) { 408 slider.addClass('havenlytics-featured-pulse ');408 slider.addClass('havenlytics-featured-pulse havenlytics-toggle-animate'); 409 409 setTimeout(() => { 410 slider.removeClass('havenlytics-featured-pulse ');410 slider.removeClass('havenlytics-featured-pulse havenlytics-toggle-animate'); 411 411 }, 800); 412 412 } -
havenlytics/trunk/havenlytics.php
r3333158 r3334405 4 4 Plugin URI: https://wordpress.org/plugins/havenlytics/ 5 5 Description: A property listing plugin for WordPress that allows users to easily manage and display property listings. 6 Version: 1.0. 76 Version: 1.0.8 7 7 Author: Havenlytics 8 8 Author URI: https://havenlytics.com … … 30 30 31 31 // Define constants 32 define('HVNLY_PROPERTY_VERSION', '1.0. 7');32 define('HVNLY_PROPERTY_VERSION', '1.0.8'); 33 33 define('HVNLY_PROPERTY_URL', plugin_dir_url(__FILE__)); 34 34 define('HVNLY_PROPERTY_PATH', plugin_dir_path(__FILE__)); -
havenlytics/trunk/includes/class-init.php
r3315596 r3334405 57 57 { 58 58 // Load core functionality here 59 require_once HVNLY_PROPERTY_PATH . 'includes/class-shortcodes.php'; 60 require_once HVNLY_PROPERTY_PATH . 'includes/class-property-views.php'; 59 61 require_once HVNLY_PROPERTY_PATH . 'includes/class-post-type.php'; 60 62 require_once HVNLY_PROPERTY_PATH . 'includes/class-meta-fields.php'; … … 69 71 add_action('admin_enqueue_scripts', array($this, 'enqueue_admin_assets')); 70 72 71 // instantiate Hvnly_Property_Frontend 73 74 // instantiate Hvnly_Property_Views 75 Hvnly_Property_Views::init(); 76 77 // instantiate Hvnly_Shortcodes 78 Hvnly_Shortcodes::init(); 79 80 // instantiate Hvnly_Property_Frontend 72 81 new Hvnly_Property_Frontend(); 73 82 … … 135 144 } 136 145 } 137 146 /** 147 * Create required pages on plugin activation. 148 */ 149 private function create_required_pages() 150 { 151 $pages = [ 152 [ 153 'title' => __('Grid Property', 'havenlytics'), 154 'shortcode' => '[havenlytics_grid]', 155 'option_key' => 'hvnly_property_grid_page_id', 156 ], 157 [ 158 'title' => __('List Property', 'havenlytics'), 159 'shortcode' => '[havenlytics_list]', 160 'option_key' => 'hvnly_property_list_page_id', 161 ], 162 [ 163 'title' => __('Mortgage Calculator', 'havenlytics'), 164 'shortcode' => '[havenlytics_mortgage_calculator]', 165 'option_key' => 'hvnly_mortgage_calculator_page_id', 166 ], 167 168 ]; 169 170 foreach ($pages as $page) { 171 $existing_id = get_option($page['option_key']); 172 173 if ($existing_id && get_post($existing_id)) { 174 continue; 175 } 176 177 // Safe WP_Query alternative to get_page_by_title (deprecated) 178 $query = new WP_Query([ 179 'post_type' => 'page', 180 'post_status' => 'publish', 181 'posts_per_page' => 1, 182 'title' => $page['title'], 183 'fields' => 'ids', 184 ]); 185 186 if ($query->have_posts()) { 187 $found_id = $query->posts[0]; 188 update_option($page['option_key'], $found_id); 189 update_post_meta($found_id, '_hvnly_property_auto_created', true); 190 continue; 191 } 192 193 // Insert new page 194 $page_id = wp_insert_post([ 195 'post_title' => $page['title'], 196 'post_content' => $page['shortcode'], 197 'post_status' => 'publish', 198 'post_type' => 'page', 199 'post_author' => get_current_user_id(), 200 ]); 201 202 if (! is_wp_error($page_id)) { 203 update_option($page['option_key'], $page_id); 204 update_post_meta($page_id, '_hvnly_property_auto_created', true); 205 } 206 } 207 } 138 208 139 209 /** … … 142 212 public static function activate() 143 213 { 144 self::get_instance()->init_post_types(); 214 $instance = self::get_instance(); 215 $instance->init_post_types(); 216 $instance->create_required_pages(); 145 217 flush_rewrite_rules(); 146 218 } -
havenlytics/trunk/includes/class-meta-fields.php
r3332499 r3334405 126 126 'high' 127 127 ); 128 // Calculator Property 129 add_meta_box( 130 'havenlytics_property_calculator', 131 __('Active Calculator', 'havenlytics'), 132 array(__CLASS__, 'havenlytics_render_calculator_metabox'), 133 'hvnly_property', 134 'side', 135 'high' 136 ); 128 137 } 129 138 … … 138 147 139 148 ?> 140 <div class="havenlytics-meta-container">141 <div class="havenlytics-meta-field">142 <div class="havenlytics-meta-label">143 <label for="havenlytics_short_description"><?php esc_html_e('Short Description', 'havenlytics'); ?></label>144 145 </div>146 <div class="havenlytics-meta-input">147 <textarea style="height: 100px;" id="havenlytics_short_description" name="_havenlytics_short_description"148 class="havenlytics-large-text"><?php echo esc_textarea($short_description); ?></textarea>149 </div>150 </div>151 152 153 154 </div>155 <?php149 <div class="havenlytics-meta-container"> 150 <div class="havenlytics-meta-field"> 151 <div class="havenlytics-meta-label"> 152 <label for="havenlytics_short_description"><?php esc_html_e('Short Description', 'havenlytics'); ?></label> 153 154 </div> 155 <div class="havenlytics-meta-input"> 156 <textarea style="height: 100px;" id="havenlytics_short_description" name="_havenlytics_short_description" 157 class="havenlytics-large-text"><?php echo esc_textarea($short_description); ?></textarea> 158 </div> 159 </div> 160 161 162 163 </div> 164 <?php 156 165 } 157 166 … … 177 186 ); 178 187 ?> 179 <div class="havenlytics-meta-container">180 181 <div class="havenlytics-meta-field">182 <div class="havenlytics-meta-label">183 <label for="havenlytics_currency"><?php esc_html_e('Currency', 'havenlytics'); ?></label>184 </div>185 <div class="havenlytics-meta-input">186 <select id="havenlytics_currency" name="_havenlytics_currency">187 <option value=""><?php esc_html_e('Select Currency', 'havenlytics'); ?></option>188 <?php188 <div class="havenlytics-meta-container"> 189 190 <div class="havenlytics-meta-field"> 191 <div class="havenlytics-meta-label"> 192 <label for="havenlytics_currency"><?php esc_html_e('Currency', 'havenlytics'); ?></label> 193 </div> 194 <div class="havenlytics-meta-input"> 195 <select id="havenlytics_currency" name="_havenlytics_currency"> 196 <option value=""><?php esc_html_e('Select Currency', 'havenlytics'); ?></option> 197 <?php 189 198 $options = array( 190 199 'USD' => __('US Dollar', 'havenlytics'), … … 212 221 foreach ($options as $key => $label) : 213 222 ?> 214 <option value="<?php echo esc_attr($key); ?>" <?php selected($values['currency'], $key); ?>>215 <?php echo esc_html($label); ?>216 </option>217 <?php endforeach; ?>218 </select>219 </div>220 </div>221 222 <div class="havenlytics-meta-field">223 <div class="havenlytics-meta-label">224 <label for="havenlytics_price"><?php esc_html_e('Price', 'havenlytics'); ?></label>225 226 </div>227 <div class="havenlytics-meta-input">228 <input type="text" id="havenlytics_price" name="_havenlytics_price"229 value="<?php echo esc_attr($values['price']); ?>" class="havenlytics-regular-text" />230 </div>231 </div>232 233 <div class="havenlytics-meta-field">234 <div class="havenlytics-meta-label">235 <label for="havenlytics_bedrooms"><?php esc_html_e('Bedrooms', 'havenlytics'); ?></label>236 </div>237 <div class="havenlytics-meta-input">238 <input type="number" id="havenlytics_bedrooms" name="_havenlytics_bedrooms"239 value="<?php echo esc_attr($values['bedrooms']); ?>" min="0" step="1" class="havenlytics-small-text" />240 </div>241 </div>242 243 <div class="havenlytics-meta-field">244 <div class="havenlytics-meta-label">245 <label for="havenlytics_bathrooms"><?php esc_html_e('Bathrooms', 'havenlytics'); ?></label>246 </div>247 <div class="havenlytics-meta-input">248 <input type="number" id="havenlytics_bathrooms" name="_havenlytics_bathrooms"249 value="<?php echo esc_attr($values['bathrooms']); ?>" min="0" step="0.5"250 class="havenlytics-small-text" />251 </div>252 </div>253 254 <div class="havenlytics-meta-field">255 <div class="havenlytics-meta-label">256 <label for="havenlytics_sqft"><?php esc_html_e('Square Footage', 'havenlytics'); ?></label>257 </div>258 259 <div class="havenlytics-meta-input">260 <input type="number" id="havenlytics_sqft" name="_havenlytics_sqft"261 value="<?php echo esc_attr($values['sqft']); ?>" min="0" step="1" class="havenlytics-regular-text" />262 </div>263 </div>264 265 <div class="havenlytics-meta-field">266 <div class="havenlytics-meta-label">267 <label for="havenlytics_address"><?php esc_html_e('Address', 'havenlytics'); ?></label>268 </div>269 <div class="havenlytics-meta-input">270 <input type="text" id="havenlytics_address" name="_havenlytics_address"271 value="<?php echo esc_attr($values['address']); ?>" class="havenlytics-large-text" />272 </div>273 </div>274 275 <div class="havenlytics-meta-field">276 <div class="havenlytics-meta-label">277 <label for="havenlytics_year_built"><?php esc_html_e('Year Built', 'havenlytics'); ?></label>278 </div>279 <div class="havenlytics-meta-input">280 <input type="number" id="havenlytics_year_built" name="_havenlytics_year_built"281 value="<?php echo esc_attr($values['year_built']); ?>" min="1800"282 max="<?php echo esc_attr(gmdate('Y')); ?>" class="havenlytics-small-text" />283 </div>284 285 286 </div>287 288 <div class="havenlytics-meta-field">289 <div class="havenlytics-meta-label">290 <label for="havenlytics_property_type"><?php esc_html_e('Property Type', 'havenlytics'); ?></label>291 </div>292 <div class="havenlytics-meta-input">293 <select id="havenlytics_property_type" name="_havenlytics_property_type">294 <option value=""><?php esc_html_e('Select Type', 'havenlytics'); ?></option>295 <?php223 <option value="<?php echo esc_attr($key); ?>" <?php selected($values['currency'], $key); ?>> 224 <?php echo esc_html($label); ?> 225 </option> 226 <?php endforeach; ?> 227 </select> 228 </div> 229 </div> 230 231 <div class="havenlytics-meta-field"> 232 <div class="havenlytics-meta-label"> 233 <label for="havenlytics_price"><?php esc_html_e('Price', 'havenlytics'); ?></label> 234 235 </div> 236 <div class="havenlytics-meta-input"> 237 <input type="text" id="havenlytics_price" name="_havenlytics_price" 238 value="<?php echo esc_attr($values['price']); ?>" class="havenlytics-regular-text" /> 239 </div> 240 </div> 241 242 <div class="havenlytics-meta-field"> 243 <div class="havenlytics-meta-label"> 244 <label for="havenlytics_bedrooms"><?php esc_html_e('Bedrooms', 'havenlytics'); ?></label> 245 </div> 246 <div class="havenlytics-meta-input"> 247 <input type="number" id="havenlytics_bedrooms" name="_havenlytics_bedrooms" 248 value="<?php echo esc_attr($values['bedrooms']); ?>" min="0" step="1" class="havenlytics-small-text" /> 249 </div> 250 </div> 251 252 <div class="havenlytics-meta-field"> 253 <div class="havenlytics-meta-label"> 254 <label for="havenlytics_bathrooms"><?php esc_html_e('Bathrooms', 'havenlytics'); ?></label> 255 </div> 256 <div class="havenlytics-meta-input"> 257 <input type="number" id="havenlytics_bathrooms" name="_havenlytics_bathrooms" 258 value="<?php echo esc_attr($values['bathrooms']); ?>" min="0" step="0.5" 259 class="havenlytics-small-text" /> 260 </div> 261 </div> 262 263 <div class="havenlytics-meta-field"> 264 <div class="havenlytics-meta-label"> 265 <label for="havenlytics_sqft"><?php esc_html_e('Square Footage', 'havenlytics'); ?></label> 266 </div> 267 268 <div class="havenlytics-meta-input"> 269 <input type="number" id="havenlytics_sqft" name="_havenlytics_sqft" 270 value="<?php echo esc_attr($values['sqft']); ?>" min="0" step="1" class="havenlytics-regular-text" /> 271 </div> 272 </div> 273 274 <div class="havenlytics-meta-field"> 275 <div class="havenlytics-meta-label"> 276 <label for="havenlytics_address"><?php esc_html_e('Address', 'havenlytics'); ?></label> 277 </div> 278 <div class="havenlytics-meta-input"> 279 <input type="text" id="havenlytics_address" name="_havenlytics_address" 280 value="<?php echo esc_attr($values['address']); ?>" class="havenlytics-large-text" /> 281 </div> 282 </div> 283 284 <div class="havenlytics-meta-field"> 285 <div class="havenlytics-meta-label"> 286 <label for="havenlytics_year_built"><?php esc_html_e('Year Built', 'havenlytics'); ?></label> 287 </div> 288 <div class="havenlytics-meta-input"> 289 <input type="number" id="havenlytics_year_built" name="_havenlytics_year_built" 290 value="<?php echo esc_attr($values['year_built']); ?>" min="1800" 291 max="<?php echo esc_attr(gmdate('Y')); ?>" class="havenlytics-small-text" /> 292 </div> 293 294 295 </div> 296 297 <div class="havenlytics-meta-field"> 298 <div class="havenlytics-meta-label"> 299 <label for="havenlytics_property_type"><?php esc_html_e('Property Type', 'havenlytics'); ?></label> 300 </div> 301 <div class="havenlytics-meta-input"> 302 <select id="havenlytics_property_type" name="_havenlytics_property_type"> 303 <option value=""><?php esc_html_e('Select Type', 'havenlytics'); ?></option> 304 <?php 296 305 $property_types = array( 297 306 'single_family' => __('Single Family', 'havenlytics'), … … 304 313 foreach ($property_types as $key => $label) : 305 314 ?> 306 <option value="<?php echo esc_attr($key); ?>" <?php selected($values['property_type'], $key); ?>>307 <?php echo esc_html($label); ?>308 </option>309 <?php endforeach; ?>310 </select>311 </div>312 </div>313 314 <div class="havenlytics-meta-field">315 <div class="havenlytics-meta-label">316 <label for="havenlytics_mls_number"><?php esc_html_e('MLS Number', 'havenlytics'); ?></label>317 </div>318 <div class="havenlytics-meta-input">319 <input type="text" id="havenlytics_mls_number" name="_havenlytics_mls_number"320 value="<?php echo esc_attr($values['mls_number']); ?>" class="havenlytics-regular-text" />321 </div>322 </div>323 324 <div class="havenlytics-meta-field">325 <div class="havenlytics-meta-label">326 <label for="havenlytics_garage"><?php esc_html_e('Garage Spaces', 'havenlytics'); ?></label>327 </div>328 <div class="havenlytics-meta-input">329 <input type="number" id="havenlytics_garage" name="_havenlytics_garage"330 value="<?php echo esc_attr($values['garage']); ?>" min="0" step="1" class="havenlytics-small-text" />331 </div>332 </div>333 334 <div class="havenlytics-meta-field">335 <div class="havenlytics-meta-label">336 <label for="havenlytics_status"><?php esc_html_e('Status', 'havenlytics'); ?></label>337 </div>338 <div class="havenlytics-meta-input">339 <select id="havenlytics_status" name="_havenlytics_status">340 <option value=""><?php esc_html_e('Select Status', 'havenlytics'); ?></option>341 <?php315 <option value="<?php echo esc_attr($key); ?>" <?php selected($values['property_type'], $key); ?>> 316 <?php echo esc_html($label); ?> 317 </option> 318 <?php endforeach; ?> 319 </select> 320 </div> 321 </div> 322 323 <div class="havenlytics-meta-field"> 324 <div class="havenlytics-meta-label"> 325 <label for="havenlytics_mls_number"><?php esc_html_e('MLS Number', 'havenlytics'); ?></label> 326 </div> 327 <div class="havenlytics-meta-input"> 328 <input type="text" id="havenlytics_mls_number" name="_havenlytics_mls_number" 329 value="<?php echo esc_attr($values['mls_number']); ?>" class="havenlytics-regular-text" /> 330 </div> 331 </div> 332 333 <div class="havenlytics-meta-field"> 334 <div class="havenlytics-meta-label"> 335 <label for="havenlytics_garage"><?php esc_html_e('Garage Spaces', 'havenlytics'); ?></label> 336 </div> 337 <div class="havenlytics-meta-input"> 338 <input type="number" id="havenlytics_garage" name="_havenlytics_garage" 339 value="<?php echo esc_attr($values['garage']); ?>" min="0" step="1" class="havenlytics-small-text" /> 340 </div> 341 </div> 342 343 <div class="havenlytics-meta-field"> 344 <div class="havenlytics-meta-label"> 345 <label for="havenlytics_status"><?php esc_html_e('Status', 'havenlytics'); ?></label> 346 </div> 347 <div class="havenlytics-meta-input"> 348 <select id="havenlytics_status" name="_havenlytics_status"> 349 <option value=""><?php esc_html_e('Select Status', 'havenlytics'); ?></option> 350 <?php 342 351 $statuses = array( 343 352 'for_sale' => __('For Sale', 'havenlytics'), … … 349 358 foreach ($statuses as $key => $label) : 350 359 ?> 351 <option value="<?php echo esc_attr($key); ?>" <?php selected($values['status'], $key); ?>>352 <?php echo esc_html($label); ?>353 </option>354 <?php endforeach; ?>355 </select>356 </div>357 </div>358 </div>359 <?php360 <option value="<?php echo esc_attr($key); ?>" <?php selected($values['status'], $key); ?>> 361 <?php echo esc_html($label); ?> 362 </option> 363 <?php endforeach; ?> 364 </select> 365 </div> 366 </div> 367 </div> 368 <?php 360 369 } 361 370 … … 380 389 ); 381 390 ?> 382 <div class="havenlytics-meta-container">383 <div class="havenlytics-meta-field">384 <div class="havenlytics-meta-label">385 <label for="havenlytics_lot_size"><?php esc_html_e('Lot Size', 'havenlytics'); ?></label>386 </div>387 <div class="havenlytics-meta-input">388 <input type="text" id="havenlytics_lot_size" name="_havenlytics_lot_size"389 value="<?php echo esc_attr($values['lot_size']); ?>" class="havenlytics-small-text" />390 <select id="havenlytics_lot_unit" name="_havenlytics_lot_unit">391 <?php391 <div class="havenlytics-meta-container"> 392 <div class="havenlytics-meta-field"> 393 <div class="havenlytics-meta-label"> 394 <label for="havenlytics_lot_size"><?php esc_html_e('Lot Size', 'havenlytics'); ?></label> 395 </div> 396 <div class="havenlytics-meta-input"> 397 <input type="text" id="havenlytics_lot_size" name="_havenlytics_lot_size" 398 value="<?php echo esc_attr($values['lot_size']); ?>" class="havenlytics-small-text" /> 399 <select id="havenlytics_lot_unit" name="_havenlytics_lot_unit"> 400 <?php 392 401 $units = array( 393 402 'sqft' => __('Sq Ft', 'havenlytics'), … … 397 406 foreach ($units as $key => $label) : 398 407 ?> 399 <option value="<?php echo esc_attr($key); ?>" <?php selected($values['lot_unit'], $key); ?>>400 <?php echo esc_html($label); ?>401 </option>402 <?php endforeach; ?>403 </select>404 </div>405 </div>406 407 <div class="havenlytics-meta-field">408 <div class="havenlytics-meta-label">409 <label for="havenlytics_hoa_fee"><?php esc_html_e('HOA Fee', 'havenlytics'); ?></label>410 </div>411 <div class="havenlytics-meta-input">412 <input type="text" id="havenlytics_hoa_fee" name="_havenlytics_hoa_fee"413 value="<?php echo esc_attr($values['hoa_fee']); ?>" class="havenlytics-small-text" />414 <select id="havenlytics_hoa_period" name="_havenlytics_hoa_period">415 <?php408 <option value="<?php echo esc_attr($key); ?>" <?php selected($values['lot_unit'], $key); ?>> 409 <?php echo esc_html($label); ?> 410 </option> 411 <?php endforeach; ?> 412 </select> 413 </div> 414 </div> 415 416 <div class="havenlytics-meta-field"> 417 <div class="havenlytics-meta-label"> 418 <label for="havenlytics_hoa_fee"><?php esc_html_e('HOA Fee', 'havenlytics'); ?></label> 419 </div> 420 <div class="havenlytics-meta-input"> 421 <input type="text" id="havenlytics_hoa_fee" name="_havenlytics_hoa_fee" 422 value="<?php echo esc_attr($values['hoa_fee']); ?>" class="havenlytics-small-text" /> 423 <select id="havenlytics_hoa_period" name="_havenlytics_hoa_period"> 424 <?php 416 425 $periods = array( 417 426 'monthly' => __('Monthly', 'havenlytics'), … … 421 430 foreach ($periods as $key => $label) : 422 431 ?> 423 <option value="<?php echo esc_attr($key); ?>" <?php selected($values['hoa_period'], $key); ?>>424 <?php echo esc_html($label); ?>425 </option>426 <?php endforeach; ?>427 </select>428 </div>429 </div>430 431 <div class="havenlytics-meta-field">432 <div class="havenlytics-meta-label">433 <label for="havenlytics_tax_amount"><?php esc_html_e('Annual Tax Amount', 'havenlytics'); ?></label>434 </div>435 <div class="havenlytics-meta-input">436 <input type="text" id="havenlytics_tax_amount" name="_havenlytics_tax_amount"437 value="<?php echo esc_attr($values['tax_amount']); ?>" class="havenlytics-regular-text" />438 </div>439 </div>440 441 <div class="havenlytics-meta-field">442 <div class="havenlytics-meta-label">443 <label for="havenlytics_tax_year"><?php esc_html_e('Tax Year', 'havenlytics'); ?></label>444 </div>445 <div class="havenlytics-meta-input">446 447 448 449 <input type="number" id="havenlytics_tax_year" name="_havenlytics_tax_year"450 value="<?php echo esc_attr($values['tax_year']); ?>" min="2000"451 max="<?php echo esc_attr(gmdate('Y')); ?>" class="havenlytics-small-text" />452 </div>453 </div>454 455 <div class="havenlytics-meta-field">456 <div class="havenlytics-meta-label">457 <label for="havenlytics_zoning"><?php esc_html_e('Zoning', 'havenlytics'); ?></label>458 </div>459 <div class="havenlytics-meta-input">460 <input type="text" id="havenlytics_zoning" name="_havenlytics_zoning"461 value="<?php echo esc_attr($values['zoning']); ?>" class="havenlytics-regular-text" />462 </div>463 </div>464 465 <div class="havenlytics-meta-field">466 <div class="havenlytics-meta-label">467 <label for="havenlytics_heating"><?php esc_html_e('Heating', 'havenlytics'); ?></label>468 </div>469 <div class="havenlytics-meta-input">470 <select id="havenlytics_heating" name="_havenlytics_heating">471 <option value=""><?php esc_html_e('Select Type', 'havenlytics'); ?></option>472 <?php432 <option value="<?php echo esc_attr($key); ?>" <?php selected($values['hoa_period'], $key); ?>> 433 <?php echo esc_html($label); ?> 434 </option> 435 <?php endforeach; ?> 436 </select> 437 </div> 438 </div> 439 440 <div class="havenlytics-meta-field"> 441 <div class="havenlytics-meta-label"> 442 <label for="havenlytics_tax_amount"><?php esc_html_e('Annual Tax Amount', 'havenlytics'); ?></label> 443 </div> 444 <div class="havenlytics-meta-input"> 445 <input type="text" id="havenlytics_tax_amount" name="_havenlytics_tax_amount" 446 value="<?php echo esc_attr($values['tax_amount']); ?>" class="havenlytics-regular-text" /> 447 </div> 448 </div> 449 450 <div class="havenlytics-meta-field"> 451 <div class="havenlytics-meta-label"> 452 <label for="havenlytics_tax_year"><?php esc_html_e('Tax Year', 'havenlytics'); ?></label> 453 </div> 454 <div class="havenlytics-meta-input"> 455 456 457 458 <input type="number" id="havenlytics_tax_year" name="_havenlytics_tax_year" 459 value="<?php echo esc_attr($values['tax_year']); ?>" min="2000" 460 max="<?php echo esc_attr(gmdate('Y')); ?>" class="havenlytics-small-text" /> 461 </div> 462 </div> 463 464 <div class="havenlytics-meta-field"> 465 <div class="havenlytics-meta-label"> 466 <label for="havenlytics_zoning"><?php esc_html_e('Zoning', 'havenlytics'); ?></label> 467 </div> 468 <div class="havenlytics-meta-input"> 469 <input type="text" id="havenlytics_zoning" name="_havenlytics_zoning" 470 value="<?php echo esc_attr($values['zoning']); ?>" class="havenlytics-regular-text" /> 471 </div> 472 </div> 473 474 <div class="havenlytics-meta-field"> 475 <div class="havenlytics-meta-label"> 476 <label for="havenlytics_heating"><?php esc_html_e('Heating', 'havenlytics'); ?></label> 477 </div> 478 <div class="havenlytics-meta-input"> 479 <select id="havenlytics_heating" name="_havenlytics_heating"> 480 <option value=""><?php esc_html_e('Select Type', 'havenlytics'); ?></option> 481 <?php 473 482 $options = array( 474 483 'forced_air' => __('Forced Air', 'havenlytics'), … … 480 489 foreach ($options as $key => $label) : 481 490 ?> 482 <option value="<?php echo esc_attr($key); ?>" <?php selected($values['heating'], $key); ?>>483 <?php echo esc_html($label); ?>484 </option>485 <?php endforeach; ?>486 </select>487 </div>488 </div>489 490 <div class="havenlytics-meta-field">491 <div class="havenlytics-meta-label">492 <label for="havenlytics_cooling"><?php esc_html_e('Cooling', 'havenlytics'); ?></label>493 </div>494 <div class="havenlytics-meta-input">495 <select id="havenlytics_cooling" name="_havenlytics_cooling">496 <option value=""><?php esc_html_e('Select Type', 'havenlytics'); ?></option>497 <?php491 <option value="<?php echo esc_attr($key); ?>" <?php selected($values['heating'], $key); ?>> 492 <?php echo esc_html($label); ?> 493 </option> 494 <?php endforeach; ?> 495 </select> 496 </div> 497 </div> 498 499 <div class="havenlytics-meta-field"> 500 <div class="havenlytics-meta-label"> 501 <label for="havenlytics_cooling"><?php esc_html_e('Cooling', 'havenlytics'); ?></label> 502 </div> 503 <div class="havenlytics-meta-input"> 504 <select id="havenlytics_cooling" name="_havenlytics_cooling"> 505 <option value=""><?php esc_html_e('Select Type', 'havenlytics'); ?></option> 506 <?php 498 507 $options = array( 499 508 'central' => __('Central Air', 'havenlytics'), … … 504 513 foreach ($options as $key => $label) : 505 514 ?> 506 <option value="<?php echo esc_attr($key); ?>" <?php selected($values['cooling'], $key); ?>>507 <?php echo esc_html($label); ?>508 </option>509 <?php endforeach; ?>510 </select>511 </div>512 </div>513 514 <div class="havenlytics-meta-field">515 <div class="havenlytics-meta-label">516 <label for="havenlytics_water"><?php esc_html_e('Water', 'havenlytics'); ?></label>517 </div>518 <div class="havenlytics-meta-input">519 <select id="havenlytics_water" name="_havenlytics_water">520 <option value=""><?php esc_html_e('Select Type', 'havenlytics'); ?></option>521 <?php515 <option value="<?php echo esc_attr($key); ?>" <?php selected($values['cooling'], $key); ?>> 516 <?php echo esc_html($label); ?> 517 </option> 518 <?php endforeach; ?> 519 </select> 520 </div> 521 </div> 522 523 <div class="havenlytics-meta-field"> 524 <div class="havenlytics-meta-label"> 525 <label for="havenlytics_water"><?php esc_html_e('Water', 'havenlytics'); ?></label> 526 </div> 527 <div class="havenlytics-meta-input"> 528 <select id="havenlytics_water" name="_havenlytics_water"> 529 <option value=""><?php esc_html_e('Select Type', 'havenlytics'); ?></option> 530 <?php 522 531 $options = array( 523 532 'city' => __('City', 'havenlytics'), … … 527 536 foreach ($options as $key => $label) : 528 537 ?> 529 <option value="<?php echo esc_attr($key); ?>" <?php selected($values['water'], $key); ?>>530 <?php echo esc_html($label); ?>531 </option>532 <?php endforeach; ?>533 </select>534 </div>535 </div>536 537 <div class="havenlytics-meta-field">538 <div class="havenlytics-meta-label">539 <label for="havenlytics_sewer"><?php esc_html_e('Sewer', 'havenlytics'); ?></label>540 </div>541 <div class="havenlytics-meta-input">542 <select id="havenlytics_sewer" name="_havenlytics_sewer">543 <option value=""><?php esc_html_e('Select Type', 'havenlytics'); ?></option>544 <?php538 <option value="<?php echo esc_attr($key); ?>" <?php selected($values['water'], $key); ?>> 539 <?php echo esc_html($label); ?> 540 </option> 541 <?php endforeach; ?> 542 </select> 543 </div> 544 </div> 545 546 <div class="havenlytics-meta-field"> 547 <div class="havenlytics-meta-label"> 548 <label for="havenlytics_sewer"><?php esc_html_e('Sewer', 'havenlytics'); ?></label> 549 </div> 550 <div class="havenlytics-meta-input"> 551 <select id="havenlytics_sewer" name="_havenlytics_sewer"> 552 <option value=""><?php esc_html_e('Select Type', 'havenlytics'); ?></option> 553 <?php 545 554 $options = array( 546 555 'city' => __('City', 'havenlytics'), … … 549 558 foreach ($options as $key => $label) : 550 559 ?> 551 <option value="<?php echo esc_attr($key); ?>" <?php selected($values['sewer'], $key); ?>>552 <?php echo esc_html($label); ?>553 </option>554 <?php endforeach; ?>555 </select>556 </div>557 </div>558 559 <div class="havenlytics-meta-field">560 <div class="havenlytics-meta-label">561 <label for="havenlytics_rating_star"><?php esc_html_e('Rating Star', 'havenlytics'); ?></label>562 </div>563 <div class="havenlytics-meta-input">564 <select id="havenlytics_rating_star" name="_havenlytics_rating_star">565 <option value=""><?php esc_html_e('Select Star', 'havenlytics'); ?></option>566 <?php560 <option value="<?php echo esc_attr($key); ?>" <?php selected($values['sewer'], $key); ?>> 561 <?php echo esc_html($label); ?> 562 </option> 563 <?php endforeach; ?> 564 </select> 565 </div> 566 </div> 567 568 <div class="havenlytics-meta-field"> 569 <div class="havenlytics-meta-label"> 570 <label for="havenlytics_rating_star"><?php esc_html_e('Rating Star', 'havenlytics'); ?></label> 571 </div> 572 <div class="havenlytics-meta-input"> 573 <select id="havenlytics_rating_star" name="_havenlytics_rating_star"> 574 <option value=""><?php esc_html_e('Select Star', 'havenlytics'); ?></option> 575 <?php 567 576 $options = array( 568 577 '1' => __('1 Star', 'havenlytics'), … … 574 583 foreach ($options as $key => $label) : 575 584 ?> 576 <option value="<?php echo esc_attr($key); ?>" <?php selected($values['rating_star'], $key); ?>>577 <?php echo esc_html($label); ?>578 </option>579 <?php endforeach; ?>580 </select>581 </div>582 </div>583 </div>584 <?php585 <option value="<?php echo esc_attr($key); ?>" <?php selected($values['rating_star'], $key); ?>> 586 <?php echo esc_html($label); ?> 587 </option> 588 <?php endforeach; ?> 589 </select> 590 </div> 591 </div> 592 </div> 593 <?php 585 594 } 586 595 … … 608 617 ); 609 618 ?> 610 <div class="havenlytics-meta-container">611 <div class="havenlytics-meta-field">612 <div class="havenlytics-meta-label">613 <label><?php esc_html_e('Features', 'havenlytics'); ?></label>614 </div>615 <div class="havenlytics-meta-input">616 <ul class="havenlytics-checkbox-list havenlytics-checkbox-columns">617 <?php foreach ($features as $key => $value) : ?>618 <li>619 <input type="checkbox" id="havenlytics_feature_<?php echo esc_attr($key); ?>"620 name="_havenlytics_feature_<?php echo esc_attr($key); ?>" value="1"621 <?php checked($value, '1'); ?> />622 <label for="havenlytics_feature_<?php echo esc_attr($key); ?>">623 <?php echo esc_html(ucfirst(str_replace('_', ' ', $key))); ?>624 </label>625 </li>626 <?php endforeach; ?>627 </ul>628 </div>629 </div>630 </div>631 <?php619 <div class="havenlytics-meta-container"> 620 <div class="havenlytics-meta-field"> 621 <div class="havenlytics-meta-label"> 622 <label><?php esc_html_e('Features', 'havenlytics'); ?></label> 623 </div> 624 <div class="havenlytics-meta-input"> 625 <ul class="havenlytics-checkbox-list havenlytics-checkbox-columns"> 626 <?php foreach ($features as $key => $value) : ?> 627 <li> 628 <input type="checkbox" id="havenlytics_feature_<?php echo esc_attr($key); ?>" 629 name="_havenlytics_feature_<?php echo esc_attr($key); ?>" value="1" 630 <?php checked($value, '1'); ?> /> 631 <label for="havenlytics_feature_<?php echo esc_attr($key); ?>"> 632 <?php echo esc_html(ucfirst(str_replace('_', ' ', $key))); ?> 633 </label> 634 </li> 635 <?php endforeach; ?> 636 </ul> 637 </div> 638 </div> 639 </div> 640 <?php 632 641 } 633 642 … … 650 659 651 660 ?> 652 <div class="havenlytics-meta-container">653 <div class="havenlytics-meta-field">654 <div class="havenlytics-meta-label">655 <label for="havenlytics_latitude"><?php esc_html_e('Latitude', 'havenlytics'); ?></label>656 </div>657 <div class="havenlytics-meta-input">658 <input type="text" id="havenlytics_latitude" name="_havenlytics_latitude"659 value="<?php echo esc_attr($values['latitude']); ?>" class="havenlytics-regular-text" />660 </div>661 </div>662 663 <div class="havenlytics-meta-field">664 <div class="havenlytics-meta-label">665 <label for="havenlytics_longitude"><?php esc_html_e('Longitude', 'havenlytics'); ?></label>666 </div>667 <div class="havenlytics-meta-input">668 <input type="text" id="havenlytics_longitude" name="_havenlytics_longitude"669 value="<?php echo esc_attr($values['longitude']); ?>" class="havenlytics-regular-text" />670 </div>671 </div>672 673 674 675 <div class="havenlytics-meta-field">676 <div class="havenlytics-meta-label">677 <label for="havenlytics_neighborhood"><?php esc_html_e('Neighborhood', 'havenlytics'); ?></label>678 </div>679 <div class="havenlytics-meta-input">680 <input type="text" id="havenlytics_neighborhood" name="_havenlytics_neighborhood"681 value="<?php echo esc_attr($values['neighborhood']); ?>" class="havenlytics-regular-text" />682 </div>683 </div>684 685 <div class="havenlytics-meta-field">686 <div class="havenlytics-meta-label">687 <label for="havenlytics_school_district"><?php esc_html_e('School District', 'havenlytics'); ?></label>688 </div>689 <div class="havenlytics-meta-input">690 <input type="text" id="havenlytics_school_district" name="_havenlytics_school_district"691 value="<?php echo esc_attr($values['school_district']); ?>" class="havenlytics-regular-text" />692 </div>693 </div>694 695 <div class="havenlytics-meta-field">696 <div class="havenlytics-meta-label">697 <label for="havenlytics_elementary_school"><?php esc_html_e('Elementary School', 'havenlytics'); ?></label>698 </div>699 <div class="havenlytics-meta-input">700 <input type="text" id="havenlytics_elementary_school" name="_havenlytics_elementary_school"701 value="<?php echo esc_attr($values['elementary_school']); ?>" class="havenlytics-regular-text" />702 </div>703 </div>704 705 <div class="havenlytics-meta-field">706 <div class="havenlytics-meta-label">707 <label for="havenlytics_middle_school"><?php esc_html_e('Middle School', 'havenlytics'); ?></label>708 </div>709 <div class="havenlytics-meta-input">710 <input type="text" id="havenlytics_middle_school" name="_havenlytics_middle_school"711 value="<?php echo esc_attr($values['middle_school']); ?>" class="havenlytics-regular-text" />712 </div>713 </div>714 715 <div class="havenlytics-meta-field">716 <div class="havenlytics-meta-label">717 <label for="havenlytics_high_school"><?php esc_html_e('High School', 'havenlytics'); ?></label>718 </div>719 <div class="havenlytics-meta-input">720 <input type="text" id="havenlytics_high_school" name="_havenlytics_high_school"721 value="<?php echo esc_attr($values['high_school']); ?>" class="havenlytics-regular-text" />722 </div>723 </div>724 725 <div class="havenlytics-meta-field">726 <div class="havenlytics-meta-label">727 <label for="havenlytics_walk_score"><?php esc_html_e('Walk Score', 'havenlytics'); ?></label>728 </div>729 <div class="havenlytics-meta-input">730 <input type="number" id="havenlytics_walk_score" name="_havenlytics_walk_score"731 value="<?php echo esc_attr($values['walk_score']); ?>" min="0" max="100"732 class="havenlytics-small-text" />733 </div>734 </div>735 </div>736 <?php661 <div class="havenlytics-meta-container"> 662 <div class="havenlytics-meta-field"> 663 <div class="havenlytics-meta-label"> 664 <label for="havenlytics_latitude"><?php esc_html_e('Latitude', 'havenlytics'); ?></label> 665 </div> 666 <div class="havenlytics-meta-input"> 667 <input type="text" id="havenlytics_latitude" name="_havenlytics_latitude" 668 value="<?php echo esc_attr($values['latitude']); ?>" class="havenlytics-regular-text" /> 669 </div> 670 </div> 671 672 <div class="havenlytics-meta-field"> 673 <div class="havenlytics-meta-label"> 674 <label for="havenlytics_longitude"><?php esc_html_e('Longitude', 'havenlytics'); ?></label> 675 </div> 676 <div class="havenlytics-meta-input"> 677 <input type="text" id="havenlytics_longitude" name="_havenlytics_longitude" 678 value="<?php echo esc_attr($values['longitude']); ?>" class="havenlytics-regular-text" /> 679 </div> 680 </div> 681 682 683 684 <div class="havenlytics-meta-field"> 685 <div class="havenlytics-meta-label"> 686 <label for="havenlytics_neighborhood"><?php esc_html_e('Neighborhood', 'havenlytics'); ?></label> 687 </div> 688 <div class="havenlytics-meta-input"> 689 <input type="text" id="havenlytics_neighborhood" name="_havenlytics_neighborhood" 690 value="<?php echo esc_attr($values['neighborhood']); ?>" class="havenlytics-regular-text" /> 691 </div> 692 </div> 693 694 <div class="havenlytics-meta-field"> 695 <div class="havenlytics-meta-label"> 696 <label for="havenlytics_school_district"><?php esc_html_e('School District', 'havenlytics'); ?></label> 697 </div> 698 <div class="havenlytics-meta-input"> 699 <input type="text" id="havenlytics_school_district" name="_havenlytics_school_district" 700 value="<?php echo esc_attr($values['school_district']); ?>" class="havenlytics-regular-text" /> 701 </div> 702 </div> 703 704 <div class="havenlytics-meta-field"> 705 <div class="havenlytics-meta-label"> 706 <label for="havenlytics_elementary_school"><?php esc_html_e('Elementary School', 'havenlytics'); ?></label> 707 </div> 708 <div class="havenlytics-meta-input"> 709 <input type="text" id="havenlytics_elementary_school" name="_havenlytics_elementary_school" 710 value="<?php echo esc_attr($values['elementary_school']); ?>" class="havenlytics-regular-text" /> 711 </div> 712 </div> 713 714 <div class="havenlytics-meta-field"> 715 <div class="havenlytics-meta-label"> 716 <label for="havenlytics_middle_school"><?php esc_html_e('Middle School', 'havenlytics'); ?></label> 717 </div> 718 <div class="havenlytics-meta-input"> 719 <input type="text" id="havenlytics_middle_school" name="_havenlytics_middle_school" 720 value="<?php echo esc_attr($values['middle_school']); ?>" class="havenlytics-regular-text" /> 721 </div> 722 </div> 723 724 <div class="havenlytics-meta-field"> 725 <div class="havenlytics-meta-label"> 726 <label for="havenlytics_high_school"><?php esc_html_e('High School', 'havenlytics'); ?></label> 727 </div> 728 <div class="havenlytics-meta-input"> 729 <input type="text" id="havenlytics_high_school" name="_havenlytics_high_school" 730 value="<?php echo esc_attr($values['high_school']); ?>" class="havenlytics-regular-text" /> 731 </div> 732 </div> 733 734 <div class="havenlytics-meta-field"> 735 <div class="havenlytics-meta-label"> 736 <label for="havenlytics_walk_score"><?php esc_html_e('Walk Score', 'havenlytics'); ?></label> 737 </div> 738 <div class="havenlytics-meta-input"> 739 <input type="number" id="havenlytics_walk_score" name="_havenlytics_walk_score" 740 value="<?php echo esc_attr($values['walk_score']); ?>" min="0" max="100" 741 class="havenlytics-small-text" /> 742 </div> 743 </div> 744 </div> 745 <?php 737 746 } 738 747 … … 746 755 $virtual_tour_url = get_post_meta($post->ID, '_havenlytics_virtual_tour', true); 747 756 ?> 748 <div class="havenlytics-meta-container havenlytics-meta-container-virtual-tour">749 <div class="havenlytics-meta-field">750 <div class="havenlytics-meta-label">751 <label for="havenlytics_virtual_tour"><?php esc_html_e('Virtual Tour URL', 'havenlytics'); ?></label>752 </div>753 <div class="havenlytics-meta-input">754 <input type="url" id="havenlytics_virtual_tour" name="_havenlytics_virtual_tour"755 value="<?php echo esc_url($virtual_tour_url); ?>" class="widefat" placeholder="https://" />756 <p class="description">757 <?php esc_html_e('Enter URL for Matterport, YouTube, or other virtual tour service', 'havenlytics'); ?>758 </p>759 </div>760 </div>761 </div>762 <?php757 <div class="havenlytics-meta-container havenlytics-meta-container-virtual-tour"> 758 <div class="havenlytics-meta-field"> 759 <div class="havenlytics-meta-label"> 760 <label for="havenlytics_virtual_tour"><?php esc_html_e('Virtual Tour URL', 'havenlytics'); ?></label> 761 </div> 762 <div class="havenlytics-meta-input"> 763 <input type="url" id="havenlytics_virtual_tour" name="_havenlytics_virtual_tour" 764 value="<?php echo esc_url($virtual_tour_url); ?>" class="widefat" placeholder="https://" /> 765 <p class="description"> 766 <?php esc_html_e('Enter URL for Matterport, YouTube, or other virtual tour service', 'havenlytics'); ?> 767 </p> 768 </div> 769 </div> 770 </div> 771 <?php 763 772 } 764 773 … … 780 789 $hav_property_custom_video_thumbnail = get_post_meta($post->ID, '_havenlytics_property_custom_video_thumbnail', true); 781 790 ?> 782 <div class="havenlytics-video-metabox"> 783 <!-- Video Type Selector --> 784 <div class="havenlytics-meta-container havenlytics-meta-container-select"> 785 <div class="havenlytics-meta-field"> 786 <div class="havenlytics-meta-label"> 787 <label 788 for="havenlytics_property_video_type"><?php esc_html_e('Select Video Type', 'havenlytics'); ?></label> 791 <div class="havenlytics-video-metabox"> 792 <!-- Video Type Selector --> 793 <div class="havenlytics-meta-container havenlytics-meta-container-select"> 794 <div class="havenlytics-meta-field"> 795 <div class="havenlytics-meta-label"> 796 <label 797 for="havenlytics_property_video_type"><?php esc_html_e('Select Video Type', 'havenlytics'); ?></label> 798 </div> 799 <div class="havenlytics-meta-input"> 800 <select id="havenlytics_property_video_type" name="_havenlytics_property_video_type" class="widefat"> 801 <option value="youtube" <?php selected($hav_property_video_type, 'youtube'); ?>>YouTube</option> 802 <option value="vimeo" <?php selected($hav_property_video_type, 'vimeo'); ?>>Vimeo</option> 803 <option value="custom" <?php selected($hav_property_video_type, 'custom'); ?>>Upload MP4</option> 804 </select> 805 </div> 806 </div> 807 </div> 808 809 <!-- YouTube Fields --> 810 <div class="havenlytics-meta-container havenlytics-meta-container-youtube"> 811 <div class="havenlytics-meta-field"> 812 <div class="havenlytics-meta-label"> 813 <label 814 for="havenlytics_property_youtube_title"><?php esc_html_e('Video Title', 'havenlytics'); ?></label> 815 </div> 816 <div class="havenlytics-meta-input"> 817 <input type="text" id="havenlytics_property_youtube_title" name="_havenlytics_property_youtube_title" 818 value="<?php echo esc_attr($hav_property_youtube_title); ?>" class="widefat" /> 819 <p class="description"><?php esc_html_e('Optional title for the video', 'havenlytics'); ?></p> 820 </div> 821 </div> 822 823 <div class="havenlytics-meta-field"> 824 <div class="havenlytics-meta-label"> 825 <label 826 for="havenlytics_property_youtube_url"><?php esc_html_e('YouTube Video URL', 'havenlytics'); ?></label> 827 </div> 828 <div class="havenlytics-meta-input"> 829 <input type="url" id="havenlytics_property_youtube_url" name="_havenlytics_property_youtube_url" 830 value="<?php echo esc_url($hav_property_youtube_url); ?>" class="widefat" 831 placeholder="https://www.youtube.com/watch?v=..." /> 832 <p class="description"> 833 <?php esc_html_e('Enter the full YouTube video URL with ID or only the ID example here:AWovHEZcpQU', 'havenlytics'); ?> 834 </p> 835 </div> 836 </div> 837 838 <div class="havenlytics-meta-field"> 839 <div class="havenlytics-meta-label"> 840 <label 841 for="havenlytics_property_youtube_thumbnail"><?php esc_html_e('YouTube Video Thumbnail', 'havenlytics'); ?></label> 842 </div> 843 <div class="havenlytics-meta-input"> 844 <input type="text" id="havenlytics_property_youtube_thumbnail" 845 name="_havenlytics_property_youtube_thumbnail" 846 value="<?php echo esc_url($hav_property_youtube_thumbnail); ?>" class="widefat" /> 847 <div class="havenlytics-preview-container"> 848 <?php if ($hav_property_youtube_thumbnail) : ?> 849 <div class="havenlytics-preview-wrapper"> 850 <img src="<?php echo esc_url($hav_property_youtube_thumbnail); ?>" alt="Thumbnail preview"> 851 <button type="button" class="havenlytics-remove-preview" 852 data-target="#havenlytics_property_youtube_thumbnail"> 853 <span class="dashicons dashicons-no-alt"></span> 854 </button> 855 </div> 856 <?php endif; ?> 857 </div> 858 <button class="button havenlytics-upload-button" data-target="#havenlytics_property_youtube_thumbnail" 859 data-type="image"> 860 <?php esc_html_e('Upload Thumbnail', 'havenlytics'); ?> 861 </button> 862 </div> 863 </div> 864 </div> 865 866 <!-- Vimeo Fields --> 867 <div class="havenlytics-meta-container havenlytics-meta-container-vimeo"> 868 <div class="havenlytics-meta-field"> 869 <div class="havenlytics-meta-label"> 870 <label 871 for="havenlytics_property_vimeo_url"><?php esc_html_e('Vimeo Video URL', 'havenlytics'); ?></label> 872 </div> 873 <div class="havenlytics-meta-input"> 874 <input type="url" id="havenlytics_property_vimeo_url" name="_havenlytics_property_vimeo_url" 875 value="<?php echo esc_url($hav_property_vimeo_url); ?>" class="widefat" 876 placeholder="https://vimeo.com/..." /> 877 <p class="description"><?php esc_html_e('Enter the full Vimeo video URL', 'havenlytics'); ?></p> 878 </div> 879 </div> 880 881 <div class="havenlytics-meta-field"> 882 <div class="havenlytics-meta-label"> 883 <label 884 for="havenlytics_property_vimeo_thumbnail"><?php esc_html_e('Vimeo Video Thumbnail', 'havenlytics'); ?></label> 885 </div> 886 <div class="havenlytics-meta-input"> 887 <input type="text" id="havenlytics_property_vimeo_thumbnail" 888 name="_havenlytics_property_vimeo_thumbnail" 889 value="<?php echo esc_url($hav_property_vimeo_thumbnail); ?>" class="widefat" /> 890 <div class="havenlytics-preview-container"> 891 <?php if ($hav_property_vimeo_thumbnail) : ?> 892 <div class="havenlytics-preview-wrapper"> 893 <img src="<?php echo esc_url($hav_property_vimeo_thumbnail); ?>" alt="Thumbnail preview"> 894 <button type="button" class="havenlytics-remove-preview" 895 data-target="#havenlytics_property_vimeo_thumbnail"> 896 <span class="dashicons dashicons-no-alt"></span> 897 </button> 898 </div> 899 <?php endif; ?> 900 </div> 901 <button class="button havenlytics-upload-button" data-target="#havenlytics_property_vimeo_thumbnail" 902 data-type="image"> 903 <?php esc_html_e('Upload Thumbnail', 'havenlytics'); ?> 904 </button> 905 </div> 906 </div> 907 </div> 908 909 <!-- Custom MP4 Fields --> 910 <div class="havenlytics-meta-container havenlytics-meta-container-custom"> 911 <div class="havenlytics-meta-field"> 912 <div class="havenlytics-meta-label"> 913 <label 914 for="havenlytics_property_custom_video"><?php esc_html_e('Upload MP4 Video', 'havenlytics'); ?></label> 915 </div> 916 <div class="havenlytics-meta-input"> 917 <input type="text" id="havenlytics_property_custom_video" name="_havenlytics_property_custom_video" 918 value="<?php echo esc_url($hav_property_custom_video); ?>" class="widefat" /> 919 <div class="havenlytics-preview-container"> 920 <?php if ($hav_property_custom_video) : ?> 921 <div class="havenlytics-preview-wrapper"> 922 <video controls> 923 <source src="<?php echo esc_url($hav_property_custom_video); ?>" type="video/mp4"> 924 </video> 925 <button type="button" class="havenlytics-remove-preview" 926 data-target="#havenlytics_property_custom_video"> 927 <span class="dashicons dashicons-no-alt"></span> 928 </button> 929 </div> 930 <?php endif; ?> 931 </div> 932 <button class="button havenlytics-upload-button" data-target="#havenlytics_property_custom_video" 933 data-type="video"> 934 <?php esc_html_e('Upload Video', 'havenlytics'); ?> 935 </button> 936 </div> 937 </div> 938 939 <div class="havenlytics-meta-field"> 940 <div class="havenlytics-meta-label"> 941 <label 942 for="havenlytics_property_custom_video_thumbnail"><?php esc_html_e('Custom Video Thumbnail', 'havenlytics'); ?></label> 943 </div> 944 <div class="havenlytics-meta-input"> 945 <input type="text" id="havenlytics_property_custom_video_thumbnail" 946 name="_havenlytics_property_custom_video_thumbnail" 947 value="<?php echo esc_url($hav_property_custom_video_thumbnail); ?>" class="widefat" /> 948 <div class="havenlytics-preview-container"> 949 <?php if ($hav_property_custom_video_thumbnail) : ?> 950 <div class="havenlytics-preview-wrapper"> 951 <img src="<?php echo esc_url($hav_property_custom_video_thumbnail); ?>" alt="Thumbnail preview"> 952 <button type="button" class="havenlytics-remove-preview" 953 data-target="#havenlytics_property_custom_video_thumbnail"> 954 <span class="dashicons dashicons-no-alt"></span> 955 </button> 956 </div> 957 <?php endif; ?> 958 </div> 959 <button class="button havenlytics-upload-button" 960 data-target="#havenlytics_property_custom_video_thumbnail" data-type="image"> 961 <?php esc_html_e('Upload Thumbnail', 'havenlytics'); ?> 962 </button> 963 </div> 964 </div> 965 </div> 789 966 </div> 790 <div class="havenlytics-meta-input"> 791 <select id="havenlytics_property_video_type" name="_havenlytics_property_video_type" class="widefat"> 792 <option value="youtube" <?php selected($hav_property_video_type, 'youtube'); ?>>YouTube</option> 793 <option value="vimeo" <?php selected($hav_property_video_type, 'vimeo'); ?>>Vimeo</option> 794 <option value="custom" <?php selected($hav_property_video_type, 'custom'); ?>>Upload MP4</option> 795 </select> 796 </div> 797 </div> 798 </div> 799 800 <!-- YouTube Fields --> 801 <div class="havenlytics-meta-container havenlytics-meta-container-youtube"> 802 <div class="havenlytics-meta-field"> 803 <div class="havenlytics-meta-label"> 804 <label 805 for="havenlytics_property_youtube_title"><?php esc_html_e('Video Title', 'havenlytics'); ?></label> 806 </div> 807 <div class="havenlytics-meta-input"> 808 <input type="text" id="havenlytics_property_youtube_title" name="_havenlytics_property_youtube_title" 809 value="<?php echo esc_attr($hav_property_youtube_title); ?>" class="widefat" /> 810 <p class="description"><?php esc_html_e('Optional title for the video', 'havenlytics'); ?></p> 811 </div> 812 </div> 813 814 <div class="havenlytics-meta-field"> 815 <div class="havenlytics-meta-label"> 816 <label 817 for="havenlytics_property_youtube_url"><?php esc_html_e('YouTube Video URL', 'havenlytics'); ?></label> 818 </div> 819 <div class="havenlytics-meta-input"> 820 <input type="url" id="havenlytics_property_youtube_url" name="_havenlytics_property_youtube_url" 821 value="<?php echo esc_url($hav_property_youtube_url); ?>" class="widefat" 822 placeholder="https://www.youtube.com/watch?v=..." /> 823 <p class="description"> 824 <?php esc_html_e('Enter the full YouTube video URL with ID or only the ID example here:AWovHEZcpQU', 'havenlytics'); ?> 825 </p> 826 </div> 827 </div> 828 829 <div class="havenlytics-meta-field"> 830 <div class="havenlytics-meta-label"> 831 <label 832 for="havenlytics_property_youtube_thumbnail"><?php esc_html_e('YouTube Video Thumbnail', 'havenlytics'); ?></label> 833 </div> 834 <div class="havenlytics-meta-input"> 835 <input type="text" id="havenlytics_property_youtube_thumbnail" 836 name="_havenlytics_property_youtube_thumbnail" 837 value="<?php echo esc_url($hav_property_youtube_thumbnail); ?>" class="widefat" /> 838 <div class="havenlytics-preview-container"> 839 <?php if ($hav_property_youtube_thumbnail) : ?> 840 <div class="havenlytics-preview-wrapper"> 841 <img src="<?php echo esc_url($hav_property_youtube_thumbnail); ?>" alt="Thumbnail preview"> 842 <button type="button" class="havenlytics-remove-preview" 843 data-target="#havenlytics_property_youtube_thumbnail"> 844 <span class="dashicons dashicons-no-alt"></span> 845 </button> 846 </div> 847 <?php endif; ?> 848 </div> 849 <button class="button havenlytics-upload-button" data-target="#havenlytics_property_youtube_thumbnail" 850 data-type="image"> 851 <?php esc_html_e('Upload Thumbnail', 'havenlytics'); ?> 852 </button> 853 </div> 854 </div> 855 </div> 856 857 <!-- Vimeo Fields --> 858 <div class="havenlytics-meta-container havenlytics-meta-container-vimeo"> 859 <div class="havenlytics-meta-field"> 860 <div class="havenlytics-meta-label"> 861 <label 862 for="havenlytics_property_vimeo_url"><?php esc_html_e('Vimeo Video URL', 'havenlytics'); ?></label> 863 </div> 864 <div class="havenlytics-meta-input"> 865 <input type="url" id="havenlytics_property_vimeo_url" name="_havenlytics_property_vimeo_url" 866 value="<?php echo esc_url($hav_property_vimeo_url); ?>" class="widefat" 867 placeholder="https://vimeo.com/..." /> 868 <p class="description"><?php esc_html_e('Enter the full Vimeo video URL', 'havenlytics'); ?></p> 869 </div> 870 </div> 871 872 <div class="havenlytics-meta-field"> 873 <div class="havenlytics-meta-label"> 874 <label 875 for="havenlytics_property_vimeo_thumbnail"><?php esc_html_e('Vimeo Video Thumbnail', 'havenlytics'); ?></label> 876 </div> 877 <div class="havenlytics-meta-input"> 878 <input type="text" id="havenlytics_property_vimeo_thumbnail" 879 name="_havenlytics_property_vimeo_thumbnail" 880 value="<?php echo esc_url($hav_property_vimeo_thumbnail); ?>" class="widefat" /> 881 <div class="havenlytics-preview-container"> 882 <?php if ($hav_property_vimeo_thumbnail) : ?> 883 <div class="havenlytics-preview-wrapper"> 884 <img src="<?php echo esc_url($hav_property_vimeo_thumbnail); ?>" alt="Thumbnail preview"> 885 <button type="button" class="havenlytics-remove-preview" 886 data-target="#havenlytics_property_vimeo_thumbnail"> 887 <span class="dashicons dashicons-no-alt"></span> 888 </button> 889 </div> 890 <?php endif; ?> 891 </div> 892 <button class="button havenlytics-upload-button" data-target="#havenlytics_property_vimeo_thumbnail" 893 data-type="image"> 894 <?php esc_html_e('Upload Thumbnail', 'havenlytics'); ?> 895 </button> 896 </div> 897 </div> 898 </div> 899 900 <!-- Custom MP4 Fields --> 901 <div class="havenlytics-meta-container havenlytics-meta-container-custom"> 902 <div class="havenlytics-meta-field"> 903 <div class="havenlytics-meta-label"> 904 <label 905 for="havenlytics_property_custom_video"><?php esc_html_e('Upload MP4 Video', 'havenlytics'); ?></label> 906 </div> 907 <div class="havenlytics-meta-input"> 908 <input type="text" id="havenlytics_property_custom_video" name="_havenlytics_property_custom_video" 909 value="<?php echo esc_url($hav_property_custom_video); ?>" class="widefat" /> 910 <div class="havenlytics-preview-container"> 911 <?php if ($hav_property_custom_video) : ?> 912 <div class="havenlytics-preview-wrapper"> 913 <video controls> 914 <source src="<?php echo esc_url($hav_property_custom_video); ?>" type="video/mp4"> 915 </video> 916 <button type="button" class="havenlytics-remove-preview" 917 data-target="#havenlytics_property_custom_video"> 918 <span class="dashicons dashicons-no-alt"></span> 919 </button> 920 </div> 921 <?php endif; ?> 922 </div> 923 <button class="button havenlytics-upload-button" data-target="#havenlytics_property_custom_video" 924 data-type="video"> 925 <?php esc_html_e('Upload Video', 'havenlytics'); ?> 926 </button> 927 </div> 928 </div> 929 930 <div class="havenlytics-meta-field"> 931 <div class="havenlytics-meta-label"> 932 <label 933 for="havenlytics_property_custom_video_thumbnail"><?php esc_html_e('Custom Video Thumbnail', 'havenlytics'); ?></label> 934 </div> 935 <div class="havenlytics-meta-input"> 936 <input type="text" id="havenlytics_property_custom_video_thumbnail" 937 name="_havenlytics_property_custom_video_thumbnail" 938 value="<?php echo esc_url($hav_property_custom_video_thumbnail); ?>" class="widefat" /> 939 <div class="havenlytics-preview-container"> 940 <?php if ($hav_property_custom_video_thumbnail) : ?> 941 <div class="havenlytics-preview-wrapper"> 942 <img src="<?php echo esc_url($hav_property_custom_video_thumbnail); ?>" alt="Thumbnail preview"> 943 <button type="button" class="havenlytics-remove-preview" 944 data-target="#havenlytics_property_custom_video_thumbnail"> 945 <span class="dashicons dashicons-no-alt"></span> 946 </button> 947 </div> 948 <?php endif; ?> 949 </div> 950 <button class="button havenlytics-upload-button" 951 data-target="#havenlytics_property_custom_video_thumbnail" data-type="image"> 952 <?php esc_html_e('Upload Thumbnail', 'havenlytics'); ?> 953 </button> 954 </div> 955 </div> 956 </div> 957 </div> 958 959 960 961 <?php 967 968 969 970 <?php 962 971 } 963 972 … … 979 988 ?> 980 989 981 <!-- Book Property -->982 <div class="havenlytics-meta-container havenlytics_property_amenities havenlytics-meta-container-book">983 <div class="havenlytics-meta-field">984 <div class="havenlytics-meta-label">985 <label986 for="havenlytics_property_book_property"><?php esc_html_e('Book Property (Shortcode)', 'havenlytics'); ?></label>987 </div>988 <div class="havenlytics-meta-input">989 <input type="text" id="havenlytics_property_book_property" name="_havenlytics_property_book_property"990 class="widefat" value="<?php echo esc_attr($book_property); ?>"991 placeholder="[contact-form-7 id='123']" />992 993 <?php990 <!-- Book Property --> 991 <div class="havenlytics-meta-container havenlytics_property_amenities havenlytics-meta-container-book"> 992 <div class="havenlytics-meta-field"> 993 <div class="havenlytics-meta-label"> 994 <label 995 for="havenlytics_property_book_property"><?php esc_html_e('Book Property (Shortcode)', 'havenlytics'); ?></label> 996 </div> 997 <div class="havenlytics-meta-input"> 998 <input type="text" id="havenlytics_property_book_property" name="_havenlytics_property_book_property" 999 class="widefat" value="<?php echo esc_attr($book_property); ?>" 1000 placeholder="[contact-form-7 id='123']" /> 1001 1002 <?php 994 1003 $cf7_forms = get_posts([ 995 1004 'post_type' => 'wpcf7_contact_form', … … 998 1007 999 1008 if (!empty($cf7_forms)) : ?> 1000 <select class="widefat"1001 onchange="document.getElementById('havenlytics_property_book_property').value = this.value;">1002 <option value=""><?php esc_html_e('Select a Contact Form…', 'havenlytics'); ?></option>1003 <?php foreach ($cf7_forms as $form) :1009 <select class="widefat" 1010 onchange="document.getElementById('havenlytics_property_book_property').value = this.value;"> 1011 <option value=""><?php esc_html_e('Select a Contact Form…', 'havenlytics'); ?></option> 1012 <?php foreach ($cf7_forms as $form) : 1004 1013 $shortcode = '[contact-form-7 id="' . esc_attr($form->ID) . '"]'; 1005 1014 $selected = selected($book_property, $shortcode, false); 1006 1015 ?> 1007 <option value="<?php echo esc_attr($shortcode); ?>" <?php echo esc_attr($selected); ?>>1008 <?php echo esc_html($form->post_title); ?>1009 </option>1010 <?php endforeach; ?>1011 </select>1012 <?php endif; ?>1013 </div>1014 1015 1016 1017 1018 </div>1019 1020 <div class="havenlytics-meta-field">1021 <div class="havenlytics-meta-label">1022 <label1023 for="havenlytics_property_virtual_tour"><?php esc_html_e('Virtual Tour URL', 'havenlytics'); ?></label>1024 </div>1025 <div class="havenlytics-meta-input">1026 <input type="url" id="havenlytics_property_virtual_tour" name="_havenlytics_property_virtual_tour"1027 class="widefat" value="<?php echo esc_url($virtual_tour); ?>" placeholder="https://" />1028 <p class="description">1029 <?php esc_html_e('Enter URL for Matterport, YouTube, or other virtual tour service', 'havenlytics'); ?>1030 </p>1031 </div>1032 </div>1033 1034 <!-- Floorplan Image -->1035 <div class="havenlytics-meta-field">1036 <div class="havenlytics-meta-label">1037 <label1038 for="havenlytics_property_floorplan_img"><?php esc_html_e('Floorplan Image URL', 'havenlytics'); ?></label>1039 </div>1040 <div class="havenlytics-meta-input havenlytics-popup-meta-input">1041 <input type="url" id="havenlytics_property_floorplan_img" name="_havenlytics_property_floorplan_img"1042 class="widefat" value="<?php echo esc_url($floorplan_img); ?>" />1043 <button type="button" class="button havenlytics-popup-upload-button"1044 data-target="#havenlytics_property_floorplan_img" data-type="image">1045 <?php esc_html_e('Upload Image', 'havenlytics'); ?>1046 </button>1047 1048 <div class="havenlytics-popup-preview-container"></div>1049 </div>1050 </div>1051 1052 <!-- Brochure PDF -->1053 <div class="havenlytics-meta-field">1054 <div class="havenlytics-meta-label">1055 <label1056 for="havenlytics_property_brochure_pdf"><?php esc_html_e('Brochure PDF URL', 'havenlytics'); ?></label>1057 </div>1058 <div class="havenlytics-meta-input havenlytics-popup-meta-input">1059 <input type="url" id="havenlytics_property_brochure_pdf" name="_havenlytics_property_brochure_pdf"1060 class="widefat" value="<?php echo esc_url($brochure_pdf); ?>" />1061 <button type="button" class="button havenlytics-popup-upload-button"1062 data-target="#havenlytics_property_brochure_pdf" data-type="pdf">1063 <?php esc_html_e('Upload PDF', 'havenlytics'); ?>1064 </button>1065 <div class="havenlytics-popup-preview-container"></div>1066 </div>1067 </div>1068 1069 <!-- EPC PDF -->1070 <div class="havenlytics-meta-field">1071 <div class="havenlytics-meta-label">1072 <label for="havenlytics_property_epc_pdf"><?php esc_html_e('EPC PDF URL', 'havenlytics'); ?></label>1073 </div>1074 <div class="havenlytics-meta-input havenlytics-popup-meta-input">1075 <input type="url" id="havenlytics_property_epc_pdf" name="_havenlytics_property_epc_pdf" class="widefat"1076 value="<?php echo esc_url($epc_pdf); ?>" />1077 <button type="button" class="button havenlytics-popup-upload-button"1078 data-target="#havenlytics_property_epc_pdf" data-type="pdf">1079 <?php esc_html_e('Upload PDF', 'havenlytics'); ?>1080 </button>1081 <div class="havenlytics-popup-preview-container"></div>1082 </div>1083 </div>1084 1085 1086 <div class="havenlytics-meta-field">1087 <div class="havenlytics-meta-label">1088 <label for="havenlytics_property_map_url"><?php esc_html_e('Google Map URL', 'havenlytics'); ?></label>1089 </div>1090 <div class="havenlytics-meta-input">1091 <input type="url" id="havenlytics_property_map_url" name="_havenlytics_property_map_url" class="widefat"1092 value="<?php echo esc_url($map_url); ?>" placeholder="https://maps.google.com/..." />1093 </div>1094 </div>1095 1096 <div class="havenlytics-meta-field">1097 <div class="havenlytics-meta-label">1098 <label1099 for="havenlytics_property_request_call"><?php esc_html_e('Request Call Back (Shortcode)', 'havenlytics'); ?></label>1100 </div>1101 <div class="havenlytics-meta-input">1102 <input type="text" id="havenlytics_property_request_call" name="_havenlytics_property_request_call"1103 class="widefat" value="<?php echo esc_attr($request_call); ?>"1104 placeholder="[contact-form-7 id='456']" />1105 1106 <?php1016 <option value="<?php echo esc_attr($shortcode); ?>" <?php echo esc_attr($selected); ?>> 1017 <?php echo esc_html($form->post_title); ?> 1018 </option> 1019 <?php endforeach; ?> 1020 </select> 1021 <?php endif; ?> 1022 </div> 1023 1024 1025 1026 1027 </div> 1028 1029 <div class="havenlytics-meta-field"> 1030 <div class="havenlytics-meta-label"> 1031 <label 1032 for="havenlytics_property_virtual_tour"><?php esc_html_e('Virtual Tour URL', 'havenlytics'); ?></label> 1033 </div> 1034 <div class="havenlytics-meta-input"> 1035 <input type="url" id="havenlytics_property_virtual_tour" name="_havenlytics_property_virtual_tour" 1036 class="widefat" value="<?php echo esc_url($virtual_tour); ?>" placeholder="https://" /> 1037 <p class="description"> 1038 <?php esc_html_e('Enter URL for Matterport, YouTube, or other virtual tour service', 'havenlytics'); ?> 1039 </p> 1040 </div> 1041 </div> 1042 1043 <!-- Floorplan Image --> 1044 <div class="havenlytics-meta-field"> 1045 <div class="havenlytics-meta-label"> 1046 <label 1047 for="havenlytics_property_floorplan_img"><?php esc_html_e('Floorplan Image URL', 'havenlytics'); ?></label> 1048 </div> 1049 <div class="havenlytics-meta-input havenlytics-popup-meta-input"> 1050 <input type="url" id="havenlytics_property_floorplan_img" name="_havenlytics_property_floorplan_img" 1051 class="widefat" value="<?php echo esc_url($floorplan_img); ?>" /> 1052 <button type="button" class="button havenlytics-popup-upload-button" 1053 data-target="#havenlytics_property_floorplan_img" data-type="image"> 1054 <?php esc_html_e('Upload Image', 'havenlytics'); ?> 1055 </button> 1056 1057 <div class="havenlytics-popup-preview-container"></div> 1058 </div> 1059 </div> 1060 1061 <!-- Brochure PDF --> 1062 <div class="havenlytics-meta-field"> 1063 <div class="havenlytics-meta-label"> 1064 <label 1065 for="havenlytics_property_brochure_pdf"><?php esc_html_e('Brochure PDF URL', 'havenlytics'); ?></label> 1066 </div> 1067 <div class="havenlytics-meta-input havenlytics-popup-meta-input"> 1068 <input type="url" id="havenlytics_property_brochure_pdf" name="_havenlytics_property_brochure_pdf" 1069 class="widefat" value="<?php echo esc_url($brochure_pdf); ?>" /> 1070 <button type="button" class="button havenlytics-popup-upload-button" 1071 data-target="#havenlytics_property_brochure_pdf" data-type="pdf"> 1072 <?php esc_html_e('Upload PDF', 'havenlytics'); ?> 1073 </button> 1074 <div class="havenlytics-popup-preview-container"></div> 1075 </div> 1076 </div> 1077 1078 <!-- EPC PDF --> 1079 <div class="havenlytics-meta-field"> 1080 <div class="havenlytics-meta-label"> 1081 <label for="havenlytics_property_epc_pdf"><?php esc_html_e('EPC PDF URL', 'havenlytics'); ?></label> 1082 </div> 1083 <div class="havenlytics-meta-input havenlytics-popup-meta-input"> 1084 <input type="url" id="havenlytics_property_epc_pdf" name="_havenlytics_property_epc_pdf" class="widefat" 1085 value="<?php echo esc_url($epc_pdf); ?>" /> 1086 <button type="button" class="button havenlytics-popup-upload-button" 1087 data-target="#havenlytics_property_epc_pdf" data-type="pdf"> 1088 <?php esc_html_e('Upload PDF', 'havenlytics'); ?> 1089 </button> 1090 <div class="havenlytics-popup-preview-container"></div> 1091 </div> 1092 </div> 1093 1094 1095 <div class="havenlytics-meta-field"> 1096 <div class="havenlytics-meta-label"> 1097 <label for="havenlytics_property_map_url"><?php esc_html_e('Google Map URL', 'havenlytics'); ?></label> 1098 </div> 1099 <div class="havenlytics-meta-input"> 1100 <input type="url" id="havenlytics_property_map_url" name="_havenlytics_property_map_url" class="widefat" 1101 value="<?php echo esc_url($map_url); ?>" placeholder="https://maps.google.com/..." /> 1102 </div> 1103 </div> 1104 1105 <div class="havenlytics-meta-field"> 1106 <div class="havenlytics-meta-label"> 1107 <label 1108 for="havenlytics_property_request_call"><?php esc_html_e('Request Call Back (Shortcode)', 'havenlytics'); ?></label> 1109 </div> 1110 <div class="havenlytics-meta-input"> 1111 <input type="text" id="havenlytics_property_request_call" name="_havenlytics_property_request_call" 1112 class="widefat" value="<?php echo esc_attr($request_call); ?>" 1113 placeholder="[contact-form-7 id='456']" /> 1114 1115 <?php 1107 1116 1108 1117 1109 1118 if (!empty($cf7_forms)) : ?> 1110 <select class="widefat"1111 onchange="document.getElementById('havenlytics_property_request_call').value = this.value;">1112 <option value=""><?php esc_html_e('Select a Contact Form…', 'havenlytics'); ?></option>1113 <?php foreach ($cf7_forms as $form) :1119 <select class="widefat" 1120 onchange="document.getElementById('havenlytics_property_request_call').value = this.value;"> 1121 <option value=""><?php esc_html_e('Select a Contact Form…', 'havenlytics'); ?></option> 1122 <?php foreach ($cf7_forms as $form) : 1114 1123 $shortcode = '[contact-form-7 id="' . esc_attr($form->ID) . '"]'; 1115 1124 $selected = selected($request_call, $shortcode, false); 1116 1125 ?> 1117 <option value="<?php echo esc_attr($shortcode); ?>" <?php echo esc_attr($selected); ?>>1118 <?php echo esc_html($form->post_title); ?>1119 </option>1120 <?php endforeach; ?>1121 </select>1122 <?php endif; ?>1123 </div>1124 </div>1125 1126 <div class="havenlytics-meta-field">1127 <div class="havenlytics-meta-label">1128 <label1129 for="havenlytics_property_arrange_view"><?php esc_html_e('Arrange Viewing (Shortcode)', 'havenlytics'); ?></label>1130 </div>1131 <div class="havenlytics-meta-input">1132 <input type="text" id="havenlytics_property_arrange_view" name="_havenlytics_property_arrange_view"1133 class="widefat" value="<?php echo esc_attr($arrange_view); ?>"1134 placeholder="[contact-form-7 id='789']" />1135 1136 <?php1126 <option value="<?php echo esc_attr($shortcode); ?>" <?php echo esc_attr($selected); ?>> 1127 <?php echo esc_html($form->post_title); ?> 1128 </option> 1129 <?php endforeach; ?> 1130 </select> 1131 <?php endif; ?> 1132 </div> 1133 </div> 1134 1135 <div class="havenlytics-meta-field"> 1136 <div class="havenlytics-meta-label"> 1137 <label 1138 for="havenlytics_property_arrange_view"><?php esc_html_e('Arrange Viewing (Shortcode)', 'havenlytics'); ?></label> 1139 </div> 1140 <div class="havenlytics-meta-input"> 1141 <input type="text" id="havenlytics_property_arrange_view" name="_havenlytics_property_arrange_view" 1142 class="widefat" value="<?php echo esc_attr($arrange_view); ?>" 1143 placeholder="[contact-form-7 id='789']" /> 1144 1145 <?php 1137 1146 if (!empty($cf7_forms)) : ?> 1138 <select class="widefat"1139 onchange="document.getElementById('havenlytics_property_arrange_view').value = this.value;">1140 <option value=""><?php esc_html_e('Select a Contact Form…', 'havenlytics'); ?></option>1141 <?php foreach ($cf7_forms as $form) :1147 <select class="widefat" 1148 onchange="document.getElementById('havenlytics_property_arrange_view').value = this.value;"> 1149 <option value=""><?php esc_html_e('Select a Contact Form…', 'havenlytics'); ?></option> 1150 <?php foreach ($cf7_forms as $form) : 1142 1151 $shortcode = '[contact-form-7 id="' . esc_attr($form->ID) . '"]'; 1143 1152 $selected = selected($arrange_view, $shortcode, false); 1144 1153 ?> 1145 <option value="<?php echo esc_attr($shortcode); ?>" <?php echo esc_attr($selected); ?>>1146 <?php echo esc_html($form->post_title); ?>1147 </option>1148 <?php endforeach; ?>1149 </select>1150 <?php endif; ?>1151 </div>1152 </div>1153 1154 </div>1155 1156 <?php1154 <option value="<?php echo esc_attr($shortcode); ?>" <?php echo esc_attr($selected); ?>> 1155 <?php echo esc_html($form->post_title); ?> 1156 </option> 1157 <?php endforeach; ?> 1158 </select> 1159 <?php endif; ?> 1160 </div> 1161 </div> 1162 1163 </div> 1164 1165 <?php 1157 1166 } 1158 1167 … … 1170 1179 $gallery_images = !empty($gallery_images) ? explode(',', $gallery_images) : array(); 1171 1180 ?> 1172 <div class="havenlytics-gallery-container">1173 <div class="havenlytics-gallery-instructions">1174 <?php esc_html_e('Add images to your property gallery. Drag to reorder.', 'havenlytics'); ?>1175 </div>1176 1177 <ul class="havenlytics-gallery-images" id="havenlytics-gallery-list">1178 <?php1181 <div class="havenlytics-gallery-container"> 1182 <div class="havenlytics-gallery-instructions"> 1183 <?php esc_html_e('Add images to your property gallery. Drag to reorder.', 'havenlytics'); ?> 1184 </div> 1185 1186 <ul class="havenlytics-gallery-images" id="havenlytics-gallery-list"> 1187 <?php 1179 1188 if (!empty($gallery_images)) : 1180 1189 foreach ($gallery_images as $image_id) : … … 1183 1192 $attachment = get_post($image_id); 1184 1193 ?> 1185 <li class="havenlytics-gallery-item" data-id="<?php echo esc_attr($image_id); ?>">1186 <img src="<?php echo esc_url($image[0]); ?>" alt="<?php echo esc_attr($attachment->post_title); ?>" />1187 <div class="havenlytics-gallery-item-actions">1188 <a href="#" class="havenlytics-gallery-edit" title="<?php esc_html_e('Edit Image', 'havenlytics'); ?>">1189 <span class="dashicons dashicons-edit"></span>1190 </a>1191 <a href="#" class="havenlytics-gallery-remove"1192 title="<?php esc_html_e('Remove Image', 'havenlytics'); ?>">1193 <span class="dashicons dashicons-no"></span>1194 </a>1195 </div>1196 <input type="hidden" name="havenlytics_gallery_title[]"1197 value="<?php echo esc_attr($attachment->post_title); ?>" />1198 <input type="hidden" name="havenlytics_gallery_caption[]"1199 value="<?php echo esc_attr($attachment->post_excerpt); ?>" />1200 </li>1201 <?php endif;1194 <li class="havenlytics-gallery-item" data-id="<?php echo esc_attr($image_id); ?>"> 1195 <img src="<?php echo esc_url($image[0]); ?>" alt="<?php echo esc_attr($attachment->post_title); ?>" /> 1196 <div class="havenlytics-gallery-item-actions"> 1197 <a href="#" class="havenlytics-gallery-edit" title="<?php esc_html_e('Edit Image', 'havenlytics'); ?>"> 1198 <span class="dashicons dashicons-edit"></span> 1199 </a> 1200 <a href="#" class="havenlytics-gallery-remove" 1201 title="<?php esc_html_e('Remove Image', 'havenlytics'); ?>"> 1202 <span class="dashicons dashicons-no"></span> 1203 </a> 1204 </div> 1205 <input type="hidden" name="havenlytics_gallery_title[]" 1206 value="<?php echo esc_attr($attachment->post_title); ?>" /> 1207 <input type="hidden" name="havenlytics_gallery_caption[]" 1208 value="<?php echo esc_attr($attachment->post_excerpt); ?>" /> 1209 </li> 1210 <?php endif; 1202 1211 endforeach; 1203 1212 endif; ?> 1204 </ul>1205 1206 <input type="hidden" id="havenlytics_gallery" name="_havenlytics_gallery"1207 value="<?php echo esc_attr(implode(',', $gallery_images)); ?>" />1208 1209 <div class="havenlytics-gallery-actions">1210 <button type="button" class="button button-primary havenlytics-add-gallery">1211 <span class="dashicons dashicons-plus"></span>1212 <?php esc_html_e('Add Images', 'havenlytics'); ?>1213 </button>1214 1215 <button type="button" class="button havenlytics-clear-gallery">1216 <span class="dashicons dashicons-trash"></span>1217 <?php esc_html_e('Clear Gallery', 'havenlytics'); ?>1218 </button>1219 </div>1220 </div>1221 <?php1213 </ul> 1214 1215 <input type="hidden" id="havenlytics_gallery" name="_havenlytics_gallery" 1216 value="<?php echo esc_attr(implode(',', $gallery_images)); ?>" /> 1217 1218 <div class="havenlytics-gallery-actions"> 1219 <button type="button" class="button button-primary havenlytics-add-gallery"> 1220 <span class="dashicons dashicons-plus"></span> 1221 <?php esc_html_e('Add Images', 'havenlytics'); ?> 1222 </button> 1223 1224 <button type="button" class="button havenlytics-clear-gallery"> 1225 <span class="dashicons dashicons-trash"></span> 1226 <?php esc_html_e('Clear Gallery', 'havenlytics'); ?> 1227 </button> 1228 </div> 1229 </div> 1230 <?php 1222 1231 } 1223 1232 … … 1229 1238 $property_featured_item = get_post_meta($post->ID, '_havenlytics_property_featured_item', true); 1230 1239 ?> 1231 <div class="havenlytics_property_featured"> 1232 <div class="havenlytics-meta-field"> 1233 <div class="havenlytics-meta-input"> 1234 <input type="hidden" name="havenlytics_property_featured_item" value="0"> 1235 <label class="havenlytics-featured-toggle"> 1236 <input type="checkbox" name="havenlytics_property_featured_item" value="1" 1237 <?php echo esc_attr(checked($property_featured_item, '1', false)); ?>> 1238 <span class="havenlytics-featured-slider"></span> 1239 <span class="havenlytics-featured-label"> 1240 <span class="havenlytics-featured-off"><?php esc_html_e('Off', 'havenlytics'); ?></span> 1241 <span class="havenlytics-featured-on"><?php esc_html_e('On', 'havenlytics'); ?></span> 1242 </span> 1243 </label> 1244 </div> 1245 </div> 1246 </div> 1240 <div class="havenlytics_property_featured"> 1241 <div class="havenlytics-meta-field"> 1242 <div class="havenlytics-meta-input"> 1243 <input type="hidden" name="havenlytics_property_featured_item" value="0"> 1244 <label class="havenlytics-featured-toggle"> 1245 <input type="checkbox" name="havenlytics_property_featured_item" value="1" 1246 <?php echo esc_attr(checked($property_featured_item, '1', false)); ?>> 1247 <span class="havenlytics-featured-slider"></span> 1248 <span class="havenlytics-featured-label"> 1249 <span class="havenlytics-featured-off"><?php esc_html_e('Off', 'havenlytics'); ?></span> 1250 <span class="havenlytics-featured-on"><?php esc_html_e('On', 'havenlytics'); ?></span> 1251 </span> 1252 </label> 1253 </div> 1254 </div> 1255 </div> 1256 <?php 1257 } 1258 1259 /** 1260 * Render calculator metabox 1261 */ 1262 public static function havenlytics_render_calculator_metabox($post) 1263 { 1264 $property_calculator_item = get_post_meta($post->ID, '_havenlytics_property_calculator_item', true); 1265 ?> 1266 <div class="havenlytics_property_calculator"> 1267 <div class="havenlytics-meta-field"> 1268 <div class="havenlytics-meta-input"> 1269 <input type="hidden" name="havenlytics_property_calculator_item" value="0"> 1270 <label class="havenlytics-calculator-toggle"> 1271 <input type="checkbox" name="havenlytics_property_calculator_item" value="1" 1272 <?php echo esc_attr(checked($property_calculator_item, '1', false)); ?>> 1273 <span class="havenlytics-calculator-slider"></span> 1274 <span class="havenlytics-calculator-label"> 1275 <span class="havenlytics-calculator-off"><?php esc_html_e('Off', 'havenlytics'); ?></span> 1276 <span class="havenlytics-calculator-on"><?php esc_html_e('On', 'havenlytics'); ?></span> 1277 </span> 1278 </label> 1279 </div> 1280 </div> 1281 </div> 1247 1282 <?php 1248 1283 } … … 1441 1476 } 1442 1477 1478 // Calculator property field 1479 if (isset($_POST['havenlytics_property_calculator_item'])) { 1480 $calculator = sanitize_text_field(wp_unslash($_POST['havenlytics_property_calculator_item'])); 1481 update_post_meta($post_id, '_havenlytics_property_calculator_item', $calculator); 1482 } else { 1483 delete_post_meta($post_id, '_havenlytics_property_calculator_item'); 1484 } 1485 1443 1486 1444 1487 // Property Amenities -
havenlytics/trunk/public/assets/css/havenlytics-property-popups.css
r3333158 r3334405 10 10 11 11 .havenlytics_popup_overlay p, .havenlytics_popup_overlay li, .havenlytics_popup_overlay span, .havenlytics_popup_overlay { 12 font-family: var(--havenlytics-bodyFont); 12 font-family: var(--havenlytics-bodyFont);display: block; 13 13 } 14 14 … … 191 191 #havenlytics_popup_viewing .havenlytics_popup_content p.havenlytics_popup_sub_title{text-align: center;} 192 192 193 #havenlytics_popup_enquiry .havenlytics_popup_content .havenlytics_popup_form p br,193 /* #havenlytics_popup_enquiry .havenlytics_popup_content .havenlytics_popup_form p br, 194 194 #havenlytics_popup_agent .havenlytics_popup_content .havenlytics_popup_form p br, 195 #havenlytics_popup_viewing .havenlytics_popup_content .havenlytics_popup_form p br{display: none;} 195 #havenlytics_popup_viewing .havenlytics_popup_content .havenlytics_popup_form p br{display: none;} */ 196 196 197 197 .havenlytics_popup_form_group { … … 541 541 .havenlytics_popup_form select { 542 542 width: 100%; 543 padding: 1.5rem 1rem !important;543 padding: 0.9rem 1rem !important; 544 544 font-size: 1rem; 545 545 font-family: var(--havenlytics-bodyFont); -
havenlytics/trunk/public/assets/css/havenlytics-root-style.css
r3333158 r3334405 1703 1703 background-color:var(--havenlytics-accent); 1704 1704 } 1705 1706 1707 /* Havenlytics Property Views Component */ 1708 .havenlytics-property-views-item { 1709 display: inline-flex; 1710 padding: 0; 1711 list-style: none; 1712 } 1713 1714 .havenlytics-property-views-card { 1715 display: flex; 1716 align-items: center; 1717 gap: 8px; 1718 padding: 8px 16px; 1719 background-color: rgba(108, 96, 254, 0.1); 1720 border-radius: 28px; 1721 transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); 1722 cursor: default; 1723 position: relative; 1724 border: 1px solid rgba(108, 96, 254, 0.15); 1725 box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03); 1726 } 1727 1728 .havenlytics-property-views-card:hover { 1729 background-color: rgba(108, 96, 254, 0.15); 1730 transform: translateY(-2px); 1731 box-shadow: 0 5px 15px rgba(108, 96, 254, 0.2); 1732 } 1733 1734 .havenlytics-property-views-card:active { 1735 transform: translateY(0); 1736 box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05); 1737 } 1738 1739 .havenlytics-property-views-icon { 1740 width: 20px; 1741 height: 20px; 1742 flex-shrink: 0; 1743 color: #6C60FE; 1744 filter: drop-shadow(0 1px 1px rgba(108, 96, 254, 0.4)); 1745 transition: transform 0.3s ease; 1746 } 1747 1748 .havenlytics-property-views-card:hover .havenlytics-property-views-icon { 1749 transform: scale(1.1); 1750 animation: havenlytics-property-blink 2s ease-in-out infinite; 1751 } 1752 1753 .havenlytics-property-views-count { 1754 font-size: 15px; 1755 font-weight: 600; 1756 color: #6C60FE; 1757 min-width: 20px; 1758 text-align: center; 1759 text-shadow: 0 1px 1px rgba(108, 96, 254, 0.2); 1760 transition: all 0.3s ease; 1761 } 1762 1763 .havenlytics-property-views-card:hover .havenlytics-property-views-count { 1764 color: #5a4fe0; 1765 text-shadow: 0 2px 3px rgba(108, 96, 254, 0.3); 1766 } 1767 1768 /* Pulse animation for the eye icon */ 1769 @keyframes havenlytics-property-blink { 1770 0%, 100% { transform: scale(1.1); } 1771 50% { transform: scale(1.15); opacity: 0.9; } 1772 } 1773 1774 /* Tooltip - Fixed Positioning */ 1775 .havenlytics-property-views-card .havenlytics-property-views-tooltip { 1776 position: absolute; 1777 bottom: calc(100% + 12px); 1778 left: 50%; 1779 transform: translateX(-50%) scale(0.8); 1780 background: #444; 1781 color: white; 1782 padding: 8px 16px; 1783 border-radius: 6px; 1784 font-size: 13px; 1785 font-weight: 500; 1786 white-space: nowrap; 1787 opacity: 0; 1788 pointer-events: none; 1789 transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); 1790 z-index: 100; 1791 box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15); 1792 } 1793 1794 /* Tooltip arrow */ 1795 .havenlytics-property-views-card .havenlytics-property-views-tooltip::after { 1796 content: ''; 1797 position: absolute; 1798 top: 100%; 1799 left: 50%; 1800 transform: translateX(-50%); 1801 border-width: 6px; 1802 border-style: solid; 1803 border-color: #444 transparent transparent transparent; 1804 } 1805 1806 .havenlytics-property-views-card:hover .havenlytics-property-views-tooltip { 1807 opacity: 1; 1808 transform: translateX(-50%) scale(1); 1809 } -
havenlytics/trunk/public/assets/js/havenlytics-frontend-scripts.js
r3333158 r3334405 558 558 559 559 // Related Property Slider 560 if($('.havenlytics-similar-slider').length > 0) { 561 $('.havenlytics-similar-slider').owlCarousel({ 562 loop:true, 563 margin:24, 564 nav:false, 565 dots:true, 566 smartSpeed: 2000, 567 navText : ["<i class='fa-solid fa-arrow-left'></i>","<i class='fa-solid fa-arrow-right'></i>"], 568 responsive:{ 569 0:{ 570 items:1 571 }, 572 573 768:{ 574 items:1 575 }, 576 992:{ 577 items:2 578 }, 579 1200:{ 580 items:3 581 }, 582 } 583 }) 584 } 585 586 // Property Featured Carousel 587 $(document).ready(function(){ 560 jQuery(document).ready(function($) { 561 // ✅ Related Property Slider 562 var $relatedSlider = $('.havenlytics-similar-slider'); 563 if ($relatedSlider.length && typeof $.fn.owlCarousel === 'function') { 564 $relatedSlider.owlCarousel({ 565 loop: true, 566 margin: 24, 567 nav: false, 568 dots: true, 569 smartSpeed: 2000, 570 navText: ["<i class='fa-solid fa-arrow-left'></i>", "<i class='fa-solid fa-arrow-right'></i>"], 571 responsive: { 572 0: { items: 1 }, 573 768: { items: 1 }, 574 992: { items: 2 }, 575 1200: { items: 3 } 576 } 577 }); 578 } 579 580 // ✅ Property Featured Carousel 588 581 var $carousel = $('.havenlytics_carousel'); 589 582 var $dots = $('.havenlytics_dot'); 590 591 $carousel.owlCarousel({ 592 loop: true, 593 margin: 15, 594 nav: false, 595 dots: false, 596 autoplay: true, 597 autoplayTimeout: 10000, 598 autoplayHoverPause: true, 599 items: 1, 600 smartSpeed: 450 601 }); 602 603 // Custom navigation 604 $('.havenlytics_prev').click(function() { 605 $carousel.trigger('prev.owl.carousel'); 606 }); 607 608 $('.havenlytics_next').click(function() { 609 $carousel.trigger('next.owl.carousel'); 610 }); 611 612 // Update dots on change 613 $carousel.on('changed.owl.carousel', function(event) { 614 var current = event.item.index; 615 $dots.removeClass('active'); 616 $dots.eq(current % $dots.length).addClass('active'); 617 }); 618 619 // Click on dots 620 $dots.each(function(index) { 621 $(this).click(function() { 622 $carousel.trigger('to.owl.carousel', [index, 300]); 623 }); 624 }); 625 }); 583 584 if ($carousel.length && typeof $.fn.owlCarousel === 'function') { 585 $carousel.owlCarousel({ 586 loop: true, 587 margin: 15, 588 nav: false, 589 dots: false, 590 autoplay: true, 591 autoplayTimeout: 10000, 592 autoplayHoverPause: true, 593 items: 1, 594 smartSpeed: 450 595 }); 596 597 // Custom navigation 598 $('.havenlytics_prev').on('click', function() { 599 $carousel.trigger('prev.owl.carousel'); 600 }); 601 602 $('.havenlytics_next').on('click', function() { 603 $carousel.trigger('next.owl.carousel'); 604 }); 605 606 // Update dots on change 607 $carousel.on('changed.owl.carousel', function(event) { 608 var current = event.item.index; 609 $dots.removeClass('active'); 610 $dots.eq(current % $dots.length).addClass('active'); 611 }); 612 613 // Click on dots 614 $dots.each(function(index) { 615 $(this).on('click', function() { 616 $carousel.trigger('to.owl.carousel', [index, 300]); 617 }); 618 }); 619 } 620 }); 621 622 626 623 627 624 -
havenlytics/trunk/public/class-frontend-assets.php
r3332499 r3334405 61 61 62 62 63 64 65 // ✅ Havenlytics Mortgage calculator jspdf JS 66 wp_enqueue_script( 67 'havenlytics-mortgage-calculator-jspdf', 68 HVNLY_PROPERTY_URL . 'public/assets/plugins/jspdf/jspdf.umd.min.js', 69 [], 70 HVNLY_PROPERTY_VERSION, 71 true 72 ); 73 74 // ✅ Havenlytics Mortgage calculator html2canvas JS 75 wp_enqueue_script( 76 'havenlytics-mortgage-calculator-html2canvas', 77 HVNLY_PROPERTY_URL . 'public/assets/plugins/jspdf/html2canvas.min.js', 78 [], 79 HVNLY_PROPERTY_VERSION, 80 true 81 ); 82 83 // ✅ Havenlytics Mortgage calculator JS 84 wp_enqueue_script( 85 'havenlytics-mortgage-calculator', 86 HVNLY_PROPERTY_URL . 'public/assets/js/havenlytics-mortgage-calculator.init.js', 87 [], 88 HVNLY_PROPERTY_VERSION, 89 true 90 ); 91 92 // ✅ Property Mortgage calculator CSS 93 wp_enqueue_style( 94 'havenlytics-mortgage-calculator', 95 HVNLY_PROPERTY_URL . 'public/assets/css/havenlytics-mortgage-calculator.init.css', 96 [], 97 HVNLY_PROPERTY_VERSION 98 ); 99 100 101 63 102 // ✅ Bootstrap JS 64 103 wp_enqueue_script( -
havenlytics/trunk/public/class-frontend.php
r3333158 r3334405 394 394 <?php esc_html_e('View Property', 'havenlytics'); ?> 395 395 </a> 396 </li> 397 <li class="havenlytics-property-views-item"> 398 <div class="havenlytics-property-views-card"> 399 <svg class="havenlytics-property-views-icon" viewBox="0 0 24 24" aria-hidden="true"> 400 <path fill="currentColor" fill-rule="evenodd" clip-rule="evenodd" 401 d="M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm-3-5c0 1.66 1.34 3 3 3s3-1.34 3-3-1.34-3-3-3-3 1.34-3 3z" /> 402 </svg> 403 <div class="havenlytics-property-views-count"> 404 <?php echo esc_html(Hvnly_Property_Views::get_formatted_views(get_the_ID())); ?> 405 406 </div> 407 <!-- Tooltip element --> 408 <div class="havenlytics-property-views-tooltip">Property Views</div> 409 </div> 396 410 </li> 397 411 </ul> … … 557 571 <?php esc_html_e('View Property', 'havenlytics'); ?> 558 572 </a> 573 <li class="havenlytics-property-views-item"> 574 <div class="havenlytics-property-views-card"> 575 <svg class="havenlytics-property-views-icon" viewBox="0 0 24 24" aria-hidden="true"> 576 <path fill="currentColor" fill-rule="evenodd" clip-rule="evenodd" 577 d="M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm-3-5c0 1.66 1.34 3 3 3s3-1.34 3-3-1.34-3-3-3-3 1.34-3 3z" /> 578 </svg> 579 <div class="havenlytics-property-views-count"> 580 <?php echo esc_html(Hvnly_Property_Views::get_formatted_views(get_the_ID())); ?> 581 582 </div> 583 <!-- Tooltip element --> 584 <div class="havenlytics-property-views-tooltip">Property Views</div> 585 </div> 586 </li> 559 587 </div> 560 588 </div> -
havenlytics/trunk/readme.txt
r3333158 r3334405 6 6 Tested up to: 6.8 7 7 Requires PHP: 7.2 8 Stable tag: 1.0. 78 Stable tag: 1.0.8 9 9 License: GPLv2 or later 10 10 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 55 55 56 56 == Shortcodes == 57 58 == Automatically Created Pages == 59 The following pages will be automatically created upon plugin activation (if not already present): 60 61 - [havenlytics_grid] 62 - [havenlytics_list] 63 - [havenlytics_mortgage_calculator] 57 64 58 65 = Grid View = … … 134 141 6. Single Property – Leaflet Map 135 142 7. Single Property – Features List 136 143 8. Havenlytics – Smart Mortgage & Property Loan Calculator 137 144 138 145 139 146 == Changelog == 147 148 = 1.0.8 = 149 * Added property view counter to track how many users viewed a property 150 * Automatically create required pages on plugin activation 151 * Introduced mortgage calculator feature 152 140 153 141 154 = 1.0.7 = -
havenlytics/trunk/templates/hvnly_property-single.php
r3333158 r3334405 563 563 </div> 564 564 <?php endif; ?> 565 <?php 566 $post_id = get_the_ID(); 567 568 if (get_post_meta($post_id, '_havenlytics_property_calculator_item', true)) : 569 ?> 570 <div class="havenlytics-amenity-card havenlytics-popup-trigger" 571 data-popup="mortgageCalculator"> 572 <div class="havenlytics-amenity-icon"> 573 <i class="fas fa-calculator"></i> 574 </div> 575 <h4>Mortgage calculator</h4> 576 </div> 577 <?php endif; ?> 565 578 566 579 <?php if (get_post_meta($post_id, '_havenlytics_property_virtual_tour', true)) : ?> … … 1146 1159 // Template part to load modals 1147 1160 $modals = [ 1161 'modal-mortgage-calculator', 1148 1162 'modal-enquiry', 1149 1163 'modal-virtual-tour', -
havenlytics/trunk/templates/property-card-grid.php
r3333158 r3334405 145 145 ?> 146 146 147 <a href="<?php // echo esc_url($author_url);147 <a href="<?php //echo esc_url($author_url); 148 148 ?>"> 149 149 <img src="<?php // echo esc_url($avatar_url); 150 150 ?>" class="img-fluid avatar" 151 alt="<?php // echo esc_attr($author_name);151 alt="<?php //echo esc_attr($author_name); 152 152 ?>"> 153 153 </a> 154 155 154 156 <div class="havenlytics-property-user-name"> 155 157 <a href="<?php //echo esc_url($author_url); … … 161 163 162 164 </li> --> 165 166 167 163 168 <li> 164 169 <a href="<?php the_permalink(); ?>" class="havenlytics-btn-primary havenlytics-btn-style-2"> 165 170 <?php esc_html_e('View Property', 'havenlytics'); ?> 166 171 </a> 172 </li> 173 <li class="havenlytics-property-views-item"> 174 <div class="havenlytics-property-views-card"> 175 <svg class="havenlytics-property-views-icon" viewBox="0 0 24 24" aria-hidden="true"> 176 <path fill="currentColor" fill-rule="evenodd" clip-rule="evenodd" 177 d="M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm-3-5c0 1.66 1.34 3 3 3s3-1.34 3-3-1.34-3-3-3-3 1.34-3 3z" /> 178 </svg> 179 <div class="havenlytics-property-views-count"> 180 <?php echo esc_html(Hvnly_Property_Views::get_formatted_views(get_the_ID())); ?> 181 182 </div> 183 <!-- Tooltip element --> 184 <div class="havenlytics-property-views-tooltip">Property Views</div> 185 </div> 167 186 </li> 168 187 </ul> -
havenlytics/trunk/templates/property-card-list.php
r3333158 r3334405 160 160 <?php esc_html_e('View Property', 'havenlytics'); ?> 161 161 </a> 162 <li class="havenlytics-property-views-item"> 163 <div class="havenlytics-property-views-card"> 164 <svg class="havenlytics-property-views-icon" viewBox="0 0 24 24" aria-hidden="true"> 165 <path fill="currentColor" fill-rule="evenodd" clip-rule="evenodd" 166 d="M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm-3-5c0 1.66 1.34 3 3 3s3-1.34 3-3-1.34-3-3-3-3 1.34-3 3z" /> 167 </svg> 168 <div class="havenlytics-property-views-count"> 169 <?php echo esc_html(Hvnly_Property_Views::get_formatted_views(get_the_ID())); ?> 170 171 </div> 172 <!-- Tooltip element --> 173 <div class="havenlytics-property-views-tooltip">Property Views</div> 174 </div> 175 </li> 162 176 </div> 163 177 </div> -
havenlytics/trunk/templates/property-card.php
r3333158 r3334405 165 165 </a> 166 166 </li> 167 <li class="havenlytics-property-views-item"> 168 <div class="havenlytics-property-views-card"> 169 <svg class="havenlytics-property-views-icon" viewBox="0 0 24 24" aria-hidden="true"> 170 <path fill="currentColor" fill-rule="evenodd" clip-rule="evenodd" 171 d="M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm-3-5c0 1.66 1.34 3 3 3s3-1.34 3-3-1.34-3-3-3-3 1.34-3 3z" /> 172 </svg> 173 <div class="havenlytics-property-views-count"> 174 <?php echo esc_html(Hvnly_Property_Views::get_formatted_views(get_the_ID())); ?> 175 176 </div> 177 <!-- Tooltip element --> 178 <div class="havenlytics-property-views-tooltip">Property Views</div> 179 </div> 180 </li> 167 181 </ul> 168 182 </div> -
havenlytics/trunk/uninstall.php
r3315596 r3334405 1 1 <?php 2 // Clean up data on uninstall 3 if (!defined('WP_UNINSTALL_PLUGIN')) exit; 4 // delete_option('havenlytics_options'); 2 3 /** 4 * Fired when the plugin is uninstalled. 5 * 6 * @package Havenlytics 7 */ 8 9 if (!defined('WP_UNINSTALL_PLUGIN')) { 10 exit; 11 } 12 13 /** 14 * Get page object by title using WP_Query (replacement for deprecated get_page_by_title). 15 * 16 * @param string $title Page title to search for. 17 * @return WP_Post|null Page object or null if not found. 18 */ 19 function hvnly_get_page_by_title($title) 20 { 21 $query = new WP_Query([ 22 'post_type' => 'page', 23 'post_status' => 'publish', 24 'title' => $title, 25 'posts_per_page' => 1, 26 'fields' => 'ids', 27 ]); 28 29 if ($query->have_posts()) { 30 return get_post($query->posts[0]); 31 } 32 33 return null; 34 } 35 36 // Titles of pages created by the plugin 37 $pages_to_delete = [ 38 'Grid Property', 39 'List Property', 40 ]; 41 42 // Delete pages created by plugin 43 foreach ($pages_to_delete as $title) { 44 $page = hvnly_get_page_by_title($title); 45 if ($page) { 46 wp_delete_post($page->ID, true); // Force delete 47 } 48 } 49 50 // Delete stored page ID options 51 delete_option('hvnly_property_grid_page_id'); 52 delete_option('hvnly_property_list_page_id'); 53 54 // Add any other plugin options or custom tables cleanup below as needed
Note: See TracChangeset
for help on using the changeset viewer.