Changeset 3465858
- Timestamp:
- 02/20/2026 02:17:19 PM (6 weeks ago)
- Location:
- selektable
- Files:
-
- 2 added
- 6 edited
- 1 copied
-
tags/1.5.0 (copied) (copied from selektable/trunk)
-
tags/1.5.0/includes/class-selektable-admin.php (modified) (2 diffs)
-
tags/1.5.0/includes/class-selektable-frontend.php (modified) (2 diffs)
-
tags/1.5.0/readme-nl.txt (added)
-
tags/1.5.0/selektable.php (modified) (3 diffs)
-
trunk/includes/class-selektable-admin.php (modified) (2 diffs)
-
trunk/includes/class-selektable-frontend.php (modified) (2 diffs)
-
trunk/readme-nl.txt (added)
-
trunk/selektable.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
selektable/tags/1.5.0/includes/class-selektable-admin.php
r3465660 r3465858 79 79 if (!current_user_can('manage_options')) { 80 80 return; 81 } 82 83 if (isset($_POST['selektable_store_id'])) { 84 update_option('selektable_store_id', sanitize_text_field(wp_unslash($_POST['selektable_store_id']))); 81 85 } 82 86 … … 129 133 </div> 130 134 <?php endif; ?> 135 136 <!-- General Settings --> 137 <div class="selektable-general-settings"> 138 <h2><?php esc_html_e('General Settings', 'selektable'); ?></h2> 139 <form method="post" action=""> 140 <?php wp_nonce_field('selektable_save_settings', 'selektable_save_settings_nonce'); ?> 141 <table class="form-table"> 142 <tr> 143 <th scope="row"> 144 <label for="selektable_store_id"><?php esc_html_e('Store ID', 'selektable'); ?> <span class="required">*</span></label> 145 </th> 146 <td> 147 <input type="text" 148 name="selektable_store_id" 149 id="selektable_store_id" 150 value="<?php echo esc_attr(get_option('selektable_store_id', '')); ?>" 151 class="regular-text" 152 placeholder="store_xxx" 153 required 154 /> 155 <p class="description"><?php esc_html_e('Your Selektable Store ID. Find this in your Selektable dashboard under your store settings.', 'selektable'); ?></p> 156 <?php if (empty(get_option('selektable_store_id', ''))): ?> 157 <p class="description" style="color: #d63638;"><?php esc_html_e('Store ID is required for the widget to function.', 'selektable'); ?></p> 158 <?php endif; ?> 159 </td> 160 </tr> 161 </table> 162 <?php submit_button(__('Save Settings', 'selektable')); ?> 163 </form> 164 </div> 131 165 132 166 <!-- Integrations Section --> -
selektable/tags/1.5.0/includes/class-selektable-frontend.php
r3465660 r3465858 35 35 // Enqueue scripts (embed.js always, WC-specific scripts conditionally) 36 36 add_action('wp_enqueue_scripts', [$this, 'enqueue_scripts']); 37 38 // Add data-store-id attribute to the embed script tag 39 add_filter('script_loader_tag', [$this, 'add_store_id_to_embed_script'], 10, 3); 37 40 } 38 41 … … 471 474 472 475 /** 476 * Add data-store-id attribute to the Selektable embed script tag 477 */ 478 public function add_store_id_to_embed_script($tag, $handle, $src) { 479 if ($handle !== 'selektable-embed') { 480 return $tag; 481 } 482 483 $store_id = get_option('selektable_store_id', ''); 484 if (!empty($store_id)) { 485 $tag = str_replace('<script ', '<script data-store-id="' . esc_attr($store_id) . '" ', $tag); 486 } 487 488 return $tag; 489 } 490 491 /** 473 492 * Enqueue frontend scripts 474 493 */ -
selektable/tags/1.5.0/selektable.php
r3465660 r3465858 4 4 * Plugin URI: https://selektable.com 5 5 * Description: Integrate the Selektable widget for virtual try-on and room visualization on your WordPress site. 6 * Version: 1. 4.06 * Version: 1.5.0 7 7 * Author: Selektable 8 8 * Author URI: https://selektable.com/about … … 20 20 21 21 // Plugin constants 22 define('SELEKTABLE_VERSION', '1. 4.0');22 define('SELEKTABLE_VERSION', '1.5.0'); 23 23 define('SELEKTABLE_DB_VERSION', '1.1.0'); 24 24 define('SELEKTABLE_PLUGIN_FILE', __FILE__); … … 76 76 if (get_option('selektable_app_url') === false) { 77 77 add_option('selektable_app_url', 'https://app.selektable.com'); 78 } 79 if (get_option('selektable_store_id') === false) { 80 add_option('selektable_store_id', ''); 78 81 } 79 82 if (get_option('selektable_integrations') === false) { -
selektable/trunk/includes/class-selektable-admin.php
r3465660 r3465858 79 79 if (!current_user_can('manage_options')) { 80 80 return; 81 } 82 83 if (isset($_POST['selektable_store_id'])) { 84 update_option('selektable_store_id', sanitize_text_field(wp_unslash($_POST['selektable_store_id']))); 81 85 } 82 86 … … 129 133 </div> 130 134 <?php endif; ?> 135 136 <!-- General Settings --> 137 <div class="selektable-general-settings"> 138 <h2><?php esc_html_e('General Settings', 'selektable'); ?></h2> 139 <form method="post" action=""> 140 <?php wp_nonce_field('selektable_save_settings', 'selektable_save_settings_nonce'); ?> 141 <table class="form-table"> 142 <tr> 143 <th scope="row"> 144 <label for="selektable_store_id"><?php esc_html_e('Store ID', 'selektable'); ?> <span class="required">*</span></label> 145 </th> 146 <td> 147 <input type="text" 148 name="selektable_store_id" 149 id="selektable_store_id" 150 value="<?php echo esc_attr(get_option('selektable_store_id', '')); ?>" 151 class="regular-text" 152 placeholder="store_xxx" 153 required 154 /> 155 <p class="description"><?php esc_html_e('Your Selektable Store ID. Find this in your Selektable dashboard under your store settings.', 'selektable'); ?></p> 156 <?php if (empty(get_option('selektable_store_id', ''))): ?> 157 <p class="description" style="color: #d63638;"><?php esc_html_e('Store ID is required for the widget to function.', 'selektable'); ?></p> 158 <?php endif; ?> 159 </td> 160 </tr> 161 </table> 162 <?php submit_button(__('Save Settings', 'selektable')); ?> 163 </form> 164 </div> 131 165 132 166 <!-- Integrations Section --> -
selektable/trunk/includes/class-selektable-frontend.php
r3465660 r3465858 35 35 // Enqueue scripts (embed.js always, WC-specific scripts conditionally) 36 36 add_action('wp_enqueue_scripts', [$this, 'enqueue_scripts']); 37 38 // Add data-store-id attribute to the embed script tag 39 add_filter('script_loader_tag', [$this, 'add_store_id_to_embed_script'], 10, 3); 37 40 } 38 41 … … 471 474 472 475 /** 476 * Add data-store-id attribute to the Selektable embed script tag 477 */ 478 public function add_store_id_to_embed_script($tag, $handle, $src) { 479 if ($handle !== 'selektable-embed') { 480 return $tag; 481 } 482 483 $store_id = get_option('selektable_store_id', ''); 484 if (!empty($store_id)) { 485 $tag = str_replace('<script ', '<script data-store-id="' . esc_attr($store_id) . '" ', $tag); 486 } 487 488 return $tag; 489 } 490 491 /** 473 492 * Enqueue frontend scripts 474 493 */ -
selektable/trunk/selektable.php
r3465660 r3465858 4 4 * Plugin URI: https://selektable.com 5 5 * Description: Integrate the Selektable widget for virtual try-on and room visualization on your WordPress site. 6 * Version: 1. 4.06 * Version: 1.5.0 7 7 * Author: Selektable 8 8 * Author URI: https://selektable.com/about … … 20 20 21 21 // Plugin constants 22 define('SELEKTABLE_VERSION', '1. 4.0');22 define('SELEKTABLE_VERSION', '1.5.0'); 23 23 define('SELEKTABLE_DB_VERSION', '1.1.0'); 24 24 define('SELEKTABLE_PLUGIN_FILE', __FILE__); … … 76 76 if (get_option('selektable_app_url') === false) { 77 77 add_option('selektable_app_url', 'https://app.selektable.com'); 78 } 79 if (get_option('selektable_store_id') === false) { 80 add_option('selektable_store_id', ''); 78 81 } 79 82 if (get_option('selektable_integrations') === false) {
Note: See TracChangeset
for help on using the changeset viewer.