← All changes
|
inc/modules/inactive-tab-message/admin/options.php
+30
-21
2.2.8
→
2.3.2
View file →
| @@ -1,8 +1,11 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Inactive Tab Message — Admin Options. | |
| 3 | + * Inactive Tab Message — Admin — Option group definitions. | |
| 4 | 4 | * |
| 5 | + * Pure data file. Returns the option groups array | |
| 6 | + * consumed by init_option_groups(). | |
| 7 | + * | |
| 5 | 8 | * @package Merchant |
| 6 | 9 | */ |
| 7 | 10 | |
| 8 | 11 | if ( ! defined( 'ABSPATH' ) ) { |
| @@ -11,9 +14,11 @@ | ||
| 11 | 14 | |
| 12 | 15 | /** |
| 13 | 16 | * Messages Section. |
| 14 | 17 | */ |
| 15 | -Merchant_Admin_Options::create( array( | |
| 18 | + | |
| 19 | +return array( | |
| 20 | + array( | |
| 16 | 21 | 'title' => esc_html__( 'Messages', 'merchant' ), |
| 17 | 22 | 'module' => 'inactive-tab-message', |
| 18 | 23 | 'fields' => array( |
| 19 | 24 | |
| @@ -65,8 +70,11 @@ | ||
| 65 | 70 | 'value' => '', |
| 66 | 71 | ), |
| 67 | 72 | ), |
| 68 | 73 | ), |
| 74 | + 'ai_meta' => array( | |
| 75 | + 'usage_hint' => 'Minimum cart total (in store currency) that triggers the high_value_message instead of the abandoned_message. Only active when high_value_message is not empty.', | |
| 76 | + ), | |
| 69 | 77 | ), |
| 70 | 78 | |
| 71 | 79 | array( |
| 72 | 80 | 'id' => 'return_message', |
| @@ -97,14 +105,10 @@ | ||
| 97 | 105 | ), |
| 98 | 106 | ), |
| 99 | 107 | |
| 100 | 108 | ), |
| 101 | -) ); | |
| 102 | - | |
| 103 | -/** | |
| 104 | - * Favicon Section. | |
| 105 | - */ | |
| 106 | -Merchant_Admin_Options::create( array( | |
| 109 | +), | |
| 110 | + array( | |
| 107 | 111 | 'title' => esc_html__( 'Favicon', 'merchant' ), |
| 108 | 112 | 'module' => 'inactive-tab-message', |
| 109 | 113 | 'fields' => array( |
| 110 | 114 | |
| @@ -113,8 +117,12 @@ | ||
| 113 | 117 | 'type' => 'switcher', |
| 114 | 118 | 'title' => esc_html__( 'Change favicon on tab leave', 'merchant' ), |
| 115 | 119 | 'desc' => esc_html__( 'Replace the browser favicon when the tab is inactive. Restored on return.', 'merchant' ), |
| 116 | 120 | 'default' => 0, |
| 121 | + 'ai_meta' => array( | |
| 122 | + 'toggle_for' => 'favicon_type', | |
| 123 | + 'usage_hint' => 'Enable this toggle before setting favicon_type, favicon_emoji, or favicon_url. When enabled, the browser favicon is replaced while the tab is inactive.', | |
| 124 | + ), | |
| 117 | 125 | ), |
| 118 | 126 | |
| 119 | 127 | array( |
| 120 | 128 | 'id' => 'favicon_type', |
| @@ -183,14 +191,10 @@ | ||
| 183 | 191 | ), |
| 184 | 192 | ), |
| 185 | 193 | |
| 186 | 194 | ), |
| 187 | -) ); | |
| 188 | - | |
| 189 | -/** | |
| 190 | - * Message Rotation Section. | |
| 191 | - */ | |
| 192 | -Merchant_Admin_Options::create( array( | |
| 195 | +), | |
| 196 | + array( | |
| 193 | 197 | 'title' => esc_html__( 'Message Rotation', 'merchant' ), |
| 194 | 198 | 'module' => 'inactive-tab-message', |
| 195 | 199 | 'fields' => array( |
| 196 | 200 | |
| @@ -199,8 +203,12 @@ | ||
| 199 | 203 | 'type' => 'switcher', |
| 200 | 204 | 'title' => esc_html__( 'Enable rotating messages', 'merchant' ), |
| 201 | 205 | 'desc' => esc_html__( 'When enabled, the tab title cycles through the messages below instead of showing the single messages above.', 'merchant' ), |
| 202 | 206 | 'default' => 0, |
| 207 | + 'ai_meta' => array( | |
| 208 | + 'toggle_for' => 'rotation_messages', | |
| 209 | + 'usage_hint' => 'Enable this toggle before setting rotation_messages. When enabled, the single message fields above are ignored — only the rotation list is used.', | |
| 210 | + ), | |
| 203 | 211 | ), |
| 204 | 212 | |
| 205 | 213 | array( |
| 206 | 214 | 'id' => 'rotation_messages', |
| @@ -209,8 +217,12 @@ | ||
| 209 | 217 | 'desc' => esc_html__( 'Add messages to cycle through. Dynamic variables ({cart_count}, {cart_total}, {site_name}) are supported.', 'merchant' ), |
| 210 | 218 | 'button_label' => esc_html__( 'Add Message', 'merchant' ), |
| 211 | 219 | 'default' => array(), |
| 212 | 220 | 'condition' => array( 'enable_rotation', '==', '1' ), |
| 221 | + 'ai_meta' => array( | |
| 222 | + 'toggled_by' => 'enable_rotation', | |
| 223 | + 'usage_hint' => 'List of messages to cycle through on the inactive tab. Only active when enable_rotation=1. Supports dynamic variables: {cart_count}, {cart_total}, {site_name}.', | |
| 224 | + ), | |
| 213 | 225 | ), |
| 214 | 226 | |
| 215 | 227 | array( |
| 216 | 228 | 'id' => 'rotation_interval', |
| @@ -224,14 +236,10 @@ | ||
| 224 | 236 | 'condition' => array( 'enable_rotation', '==', '1' ), |
| 225 | 237 | ), |
| 226 | 238 | |
| 227 | 239 | ), |
| 228 | -) ); | |
| 229 | - | |
| 230 | -/** | |
| 231 | - * Scrolling Text Section. | |
| 232 | - */ | |
| 233 | -Merchant_Admin_Options::create( array( | |
| 240 | +), | |
| 241 | + array( | |
| 234 | 242 | 'title' => esc_html__( 'Scrolling Text', 'merchant' ), |
| 235 | 243 | 'module' => 'inactive-tab-message', |
| 236 | 244 | 'fields' => array( |
| 237 | 245 | |
| @@ -243,5 +251,6 @@ | ||
| 243 | 251 | 'default' => 0, |
| 244 | 252 | ), |
| 245 | 253 | |
| 246 | 254 | ), |
| 247 | -) ); | |
| 255 | +), | |
| 256 | +); | |