← All changes
|
inc/modules/scroll-to-top-button/admin/options.php
+265
-268
1.7
→
2.3.2
View file →
| @@ -1,268 +1,265 @@ | ||
| 1 | -<?php | |
| 2 | -/** | |
| 3 | - * Merchant - Scroll to Top Button | |
| 4 | - */ | |
| 5 | - | |
| 6 | -if ( ! defined( 'ABSPATH' ) ) { | |
| 7 | - exit; // Exit if accessed directly | |
| 8 | -} | |
| 9 | - | |
| 10 | -/** | |
| 11 | - * Settings for Desktop | |
| 12 | - */ | |
| 13 | -Merchant_Admin_Options::create( array( | |
| 14 | - 'module' => 'scroll-to-top-button', | |
| 15 | - 'title' => __( 'Settings for Desktop', 'merchant' ), | |
| 16 | - 'fields' => array( | |
| 17 | - | |
| 18 | - array( | |
| 19 | - 'id' => 'style', | |
| 20 | - 'type' => 'select', | |
| 21 | - 'title' => esc_html__( 'Button style', 'merchant' ), | |
| 22 | - 'options' => array( | |
| 23 | - 'merchant-style-filled' => 'Filled', | |
| 24 | - 'merchant-style-outline' => 'Outline', | |
| 25 | - ), | |
| 26 | - 'default' => 'merchant-style-filled', | |
| 27 | - ), | |
| 28 | - | |
| 29 | - array( | |
| 30 | - 'id' => 'type', | |
| 31 | - 'type' => 'select', | |
| 32 | - 'title' => esc_html__( 'Type', 'merchant' ), | |
| 33 | - 'options' => array( | |
| 34 | - 'icon' => esc_html__( 'Icon', 'merchant' ), | |
| 35 | - 'text-icon' => esc_html__( 'Text + icon', 'merchant' ), | |
| 36 | - ), | |
| 37 | - 'default' => 'icon', | |
| 38 | - ), | |
| 39 | - | |
| 40 | - array( | |
| 41 | - 'id' => 'icon', | |
| 42 | - 'type' => 'choices', | |
| 43 | - 'title' => esc_html__( 'Icon', 'merchant' ), | |
| 44 | - 'options' => array( | |
| 45 | - 'arrow-1' => '%s/arrow-1.svg', | |
| 46 | - 'arrow-2' => '%s/arrow-2.svg', | |
| 47 | - 'arrow-3' => '%s/arrow-3.svg', | |
| 48 | - 'arrow-4' => '%s/arrow-4.svg', | |
| 49 | - ), | |
| 50 | - 'default' => 'arrow-1', | |
| 51 | - ), | |
| 52 | - | |
| 53 | - array( | |
| 54 | - 'id' => 'text', | |
| 55 | - 'type' => 'text', | |
| 56 | - 'title' => 'Text', | |
| 57 | - 'default' => esc_html__( 'Back to top', 'merchant' ), | |
| 58 | - 'condition' => array( 'type', '==', 'text-icon' ), | |
| 59 | - ), | |
| 60 | - | |
| 61 | - array( | |
| 62 | - 'id' => 'position', | |
| 63 | - 'type' => 'select', | |
| 64 | - 'title' => esc_html__( 'Position', 'merchant' ), | |
| 65 | - 'options' => array( | |
| 66 | - 'merchant-position-left' => 'Left', | |
| 67 | - 'merchant-position-right' => 'Right', | |
| 68 | - ), | |
| 69 | - 'default' => 'merchant-position-right', | |
| 70 | - ), | |
| 71 | - | |
| 72 | - array( | |
| 73 | - 'id' => 'side-offset', | |
| 74 | - 'type' => 'range', | |
| 75 | - 'title' => esc_html__( 'Side offset', 'merchant' ), | |
| 76 | - 'min' => 1, | |
| 77 | - 'max' => 500, | |
| 78 | - 'step' => 1, | |
| 79 | - 'unit' => 'px', | |
| 80 | - 'default' => 30, | |
| 81 | - ), | |
| 82 | - | |
| 83 | - array( | |
| 84 | - 'id' => 'bottom-offset', | |
| 85 | - 'type' => 'range', | |
| 86 | - 'title' => esc_html__( 'Bottom offset', 'merchant' ), | |
| 87 | - 'min' => 1, | |
| 88 | - 'max' => 500, | |
| 89 | - 'step' => 1, | |
| 90 | - 'unit' => 'px', | |
| 91 | - 'default' => 30, | |
| 92 | - ), | |
| 93 | - | |
| 94 | - array( | |
| 95 | - 'id' => 'visibility', | |
| 96 | - 'type' => 'select', | |
| 97 | - 'title' => esc_html__( 'Visibility', 'merchant' ), | |
| 98 | - 'options' => array( | |
| 99 | - 'all' => esc_html__( 'Show on all devices', 'merchant' ), | |
| 100 | - 'desktop-only' => esc_html__( 'Desktop only', 'merchant' ), | |
| 101 | - 'mobile-only' => esc_html__( 'Mobile only', 'merchant' ), | |
| 102 | - ), | |
| 103 | - 'default' => 'all' | |
| 104 | - ), | |
| 105 | - | |
| 106 | - ), | |
| 107 | -) ); | |
| 108 | - | |
| 109 | -/** | |
| 110 | - * Settings for Mobile | |
| 111 | - */ | |
| 112 | -Merchant_Admin_Options::create( array( | |
| 113 | - 'module' => 'scroll-to-top-button', | |
| 114 | - 'title' => 'Settings for Mobile', | |
| 115 | - 'fields' => array( | |
| 116 | - | |
| 117 | - array( | |
| 118 | - 'id' => 'side-offset-mobile', | |
| 119 | - 'type' => 'range', | |
| 120 | - 'title' => esc_html__( 'Side offset', 'merchant' ), | |
| 121 | - 'min' => 1, | |
| 122 | - 'max' => 50, | |
| 123 | - 'step' => 1, | |
| 124 | - 'unit' => 'px', | |
| 125 | - 'default' => 30, | |
| 126 | - ), | |
| 127 | - | |
| 128 | - array( | |
| 129 | - 'id' => 'bottom-offset-mobile', | |
| 130 | - 'type' => 'range', | |
| 131 | - 'title' => esc_html__( 'Bottom offset', 'merchant' ), | |
| 132 | - 'min' => 1, | |
| 133 | - 'max' => 50, | |
| 134 | - 'step' => 1, | |
| 135 | - 'unit' => 'px', | |
| 136 | - 'default' => 30, | |
| 137 | - ), | |
| 138 | - | |
| 139 | - ), | |
| 140 | -) ); | |
| 141 | - | |
| 142 | -/** | |
| 143 | - * Style Settings | |
| 144 | - */ | |
| 145 | -Merchant_Admin_Options::create( array( | |
| 146 | - 'module' => 'scroll-to-top-button', | |
| 147 | - 'title' => esc_html__( 'Style', 'merchant' ), | |
| 148 | - 'fields' => array( | |
| 149 | - | |
| 150 | - array( | |
| 151 | - 'id' => 'icon-size', | |
| 152 | - 'type' => 'range', | |
| 153 | - 'title' => esc_html__( 'Icon size', 'merchant' ), | |
| 154 | - 'min' => 1, | |
| 155 | - 'max' => 500, | |
| 156 | - 'step' => 1, | |
| 157 | - 'unit' => 'px', | |
| 158 | - 'default' => 18, | |
| 159 | - ), | |
| 160 | - | |
| 161 | - array( | |
| 162 | - 'id' => 'text-size', | |
| 163 | - 'type' => 'range', | |
| 164 | - 'title' => esc_html__( 'Text size', 'merchant' ), | |
| 165 | - 'min' => 1, | |
| 166 | - 'max' => 500, | |
| 167 | - 'step' => 1, | |
| 168 | - 'unit' => 'px', | |
| 169 | - 'default' => 18, | |
| 170 | - 'condition' => array( 'type', '==', 'text-icon' ), | |
| 171 | - ), | |
| 172 | - | |
| 173 | - array( | |
| 174 | - 'id' => 'padding', | |
| 175 | - 'type' => 'range', | |
| 176 | - 'title' => esc_html__( 'Padding', 'merchant' ), | |
| 177 | - 'min' => 1, | |
| 178 | - 'max' => 500, | |
| 179 | - 'step' => 1, | |
| 180 | - 'unit' => 'px', | |
| 181 | - 'default' => 15, | |
| 182 | - ), | |
| 183 | - | |
| 184 | - array( | |
| 185 | - 'id' => 'border-size', | |
| 186 | - 'type' => 'range', | |
| 187 | - 'title' => esc_html__( 'Border size', 'merchant' ), | |
| 188 | - 'min' => 1, | |
| 189 | - 'max' => 500, | |
| 190 | - 'step' => 1, | |
| 191 | - 'unit' => 'px', | |
| 192 | - 'default' => 2, | |
| 193 | - 'condition' => array( 'style', '==', 'outline' ), | |
| 194 | - ), | |
| 195 | - | |
| 196 | - array( | |
| 197 | - 'id' => 'border-radius', | |
| 198 | - 'type' => 'range', | |
| 199 | - 'title' => esc_html__( 'Border radius', 'merchant' ), | |
| 200 | - 'min' => 1, | |
| 201 | - 'max' => 500, | |
| 202 | - 'step' => 1, | |
| 203 | - 'unit' => 'px', | |
| 204 | - 'default' => 30, | |
| 205 | - ), | |
| 206 | - | |
| 207 | - array( | |
| 208 | - 'id' => 'icon-color', | |
| 209 | - 'type' => 'color', | |
| 210 | - 'title' => esc_html__( 'Icon color', 'merchant' ), | |
| 211 | - 'default' => '#FFFFFF', | |
| 212 | - ), | |
| 213 | - | |
| 214 | - array( | |
| 215 | - 'id' => 'icon-hover-color', | |
| 216 | - 'type' => 'color', | |
| 217 | - 'title' => esc_html__( 'Icon color hover', 'merchant' ), | |
| 218 | - 'default' => '#FFFFFF', | |
| 219 | - ), | |
| 220 | - | |
| 221 | - array( | |
| 222 | - 'id' => 'text-color', | |
| 223 | - 'type' => 'color', | |
| 224 | - 'title' => esc_html__( 'Text color', 'merchant' ), | |
| 225 | - 'default' => '#FFFFFF', | |
| 226 | - 'condition' => array( 'type', '==', 'text-icon' ), | |
| 227 | - ), | |
| 228 | - | |
| 229 | - array( | |
| 230 | - 'id' => 'text-hover-color', | |
| 231 | - 'type' => 'color', | |
| 232 | - 'title' => esc_html__( 'Text color hover', 'merchant' ), | |
| 233 | - 'default' => '#FFFFFF', | |
| 234 | - 'condition' => array( 'type', '==', 'text-icon' ), | |
| 235 | - ), | |
| 236 | - | |
| 237 | - array( | |
| 238 | - 'id' => 'border-color', | |
| 239 | - 'type' => 'color', | |
| 240 | - 'title' => esc_html__( 'Border color', 'merchant' ), | |
| 241 | - 'default' => '#212121', | |
| 242 | - 'condition' => array( 'style', '==', 'outline' ), | |
| 243 | - ), | |
| 244 | - | |
| 245 | - array( | |
| 246 | - 'id' => 'border-hover-color', | |
| 247 | - 'type' => 'color', | |
| 248 | - 'title' => esc_html__( 'Border color hover', 'merchant' ), | |
| 249 | - 'default' => '#757575', | |
| 250 | - 'condition' => array( 'style', '==', 'outline' ), | |
| 251 | - ), | |
| 252 | - | |
| 253 | - array( | |
| 254 | - 'id' => 'background-color', | |
| 255 | - 'type' => 'color', | |
| 256 | - 'title' => esc_html__( 'Background color', 'merchant' ), | |
| 257 | - 'default' => '#212121', | |
| 258 | - ), | |
| 259 | - | |
| 260 | - array( | |
| 261 | - 'id' => 'background-hover-color', | |
| 262 | - 'type' => 'color', | |
| 263 | - 'title' => esc_html__( 'Background color hover', 'merchant' ), | |
| 264 | - 'default' => '#757575', | |
| 265 | - ), | |
| 266 | - | |
| 267 | - ), | |
| 268 | -) ); | |
| 1 | +<?php | |
| 2 | +/** | |
| 3 | + * Merchant - Scroll to Top Button | |
| 4 | + */ | |
| 5 | + | |
| 6 | +if ( ! defined( 'ABSPATH' ) ) { | |
| 7 | + exit; // Exit if accessed directly | |
| 8 | +} | |
| 9 | + | |
| 10 | +/** | |
| 11 | + * Settings for Desktop | |
| 12 | + */ | |
| 13 | + | |
| 14 | +return array( | |
| 15 | + array( | |
| 16 | + 'module' => 'scroll-to-top-button', | |
| 17 | + 'title' => __( 'Settings for Desktop', 'merchant' ), | |
| 18 | + 'fields' => array( | |
| 19 | + | |
| 20 | + array( | |
| 21 | + 'id' => 'style', | |
| 22 | + 'type' => 'select', | |
| 23 | + 'title' => esc_html__( 'Button style', 'merchant' ), | |
| 24 | + 'options' => array( | |
| 25 | + 'merchant-style-filled' => 'Filled', | |
| 26 | + 'merchant-style-outline' => 'Outline', | |
| 27 | + ), | |
| 28 | + 'default' => 'merchant-style-filled', | |
| 29 | + ), | |
| 30 | + | |
| 31 | + array( | |
| 32 | + 'id' => 'type', | |
| 33 | + 'type' => 'select', | |
| 34 | + 'title' => esc_html__( 'Type', 'merchant' ), | |
| 35 | + 'options' => array( | |
| 36 | + 'icon' => esc_html__( 'Icon', 'merchant' ), | |
| 37 | + 'text-icon' => esc_html__( 'Text + icon', 'merchant' ), | |
| 38 | + ), | |
| 39 | + 'default' => 'icon', | |
| 40 | + ), | |
| 41 | + | |
| 42 | + array( | |
| 43 | + 'id' => 'icon', | |
| 44 | + 'type' => 'choices', | |
| 45 | + 'title' => esc_html__( 'Icon', 'merchant' ), | |
| 46 | + 'options' => array( | |
| 47 | + 'arrow-1' => '%s/arrow-1.svg', | |
| 48 | + 'arrow-2' => '%s/arrow-2.svg', | |
| 49 | + 'arrow-3' => '%s/arrow-3.svg', | |
| 50 | + 'arrow-4' => '%s/arrow-4.svg', | |
| 51 | + ), | |
| 52 | + 'default' => 'arrow-1', | |
| 53 | + ), | |
| 54 | + | |
| 55 | + array( | |
| 56 | + 'id' => 'text', | |
| 57 | + 'type' => 'text', | |
| 58 | + 'title' => 'Text', | |
| 59 | + 'default' => esc_html__( 'Back to top', 'merchant' ), | |
| 60 | + 'condition' => array( 'type', '==', 'text-icon' ), | |
| 61 | + ), | |
| 62 | + | |
| 63 | + array( | |
| 64 | + 'id' => 'position', | |
| 65 | + 'type' => 'select', | |
| 66 | + 'title' => esc_html__( 'Position', 'merchant' ), | |
| 67 | + 'options' => array( | |
| 68 | + 'merchant-position-left' => 'Left', | |
| 69 | + 'merchant-position-right' => 'Right', | |
| 70 | + ), | |
| 71 | + 'default' => 'merchant-position-right', | |
| 72 | + ), | |
| 73 | + | |
| 74 | + array( | |
| 75 | + 'id' => 'side-offset', | |
| 76 | + 'type' => 'range', | |
| 77 | + 'title' => esc_html__( 'Side offset', 'merchant' ), | |
| 78 | + 'min' => 0, | |
| 79 | + 'max' => 500, | |
| 80 | + 'step' => 1, | |
| 81 | + 'unit' => 'px', | |
| 82 | + 'default' => 30, | |
| 83 | + ), | |
| 84 | + | |
| 85 | + array( | |
| 86 | + 'id' => 'bottom-offset', | |
| 87 | + 'type' => 'range', | |
| 88 | + 'title' => esc_html__( 'Bottom offset', 'merchant' ), | |
| 89 | + 'min' => 0, | |
| 90 | + 'max' => 500, | |
| 91 | + 'step' => 1, | |
| 92 | + 'unit' => 'px', | |
| 93 | + 'default' => 30, | |
| 94 | + ), | |
| 95 | + | |
| 96 | + array( | |
| 97 | + 'id' => 'visibility', | |
| 98 | + 'type' => 'select', | |
| 99 | + 'title' => esc_html__( 'Visibility', 'merchant' ), | |
| 100 | + 'options' => array( | |
| 101 | + 'all' => esc_html__( 'Show on all devices', 'merchant' ), | |
| 102 | + 'desktop-only' => esc_html__( 'Desktop only', 'merchant' ), | |
| 103 | + 'mobile-only' => esc_html__( 'Mobile only', 'merchant' ), | |
| 104 | + ), | |
| 105 | + 'default' => 'all', | |
| 106 | + ), | |
| 107 | + | |
| 108 | + ), | |
| 109 | +), | |
| 110 | + array( | |
| 111 | + 'module' => 'scroll-to-top-button', | |
| 112 | + 'title' => 'Settings for Mobile', | |
| 113 | + 'fields' => array( | |
| 114 | + | |
| 115 | + array( | |
| 116 | + 'id' => 'side-offset-mobile', | |
| 117 | + 'type' => 'range', | |
| 118 | + 'title' => esc_html__( 'Side offset', 'merchant' ), | |
| 119 | + 'min' => 0, | |
| 120 | + 'max' => 150, | |
| 121 | + 'step' => 1, | |
| 122 | + 'unit' => 'px', | |
| 123 | + 'default' => 30, | |
| 124 | + ), | |
| 125 | + | |
| 126 | + array( | |
| 127 | + 'id' => 'bottom-offset-mobile', | |
| 128 | + 'type' => 'range', | |
| 129 | + 'title' => esc_html__( 'Bottom offset', 'merchant' ), | |
| 130 | + 'min' => 0, | |
| 131 | + 'max' => 150, | |
| 132 | + 'step' => 1, | |
| 133 | + 'unit' => 'px', | |
| 134 | + 'default' => 30, | |
| 135 | + ), | |
| 136 | + | |
| 137 | + ), | |
| 138 | +), | |
| 139 | + array( | |
| 140 | + 'module' => 'scroll-to-top-button', | |
| 141 | + 'title' => esc_html__( 'Style', 'merchant' ), | |
| 142 | + 'fields' => array( | |
| 143 | + | |
| 144 | + array( | |
| 145 | + 'id' => 'icon-size', | |
| 146 | + 'type' => 'range', | |
| 147 | + 'title' => esc_html__( 'Icon size', 'merchant' ), | |
| 148 | + 'min' => 1, | |
| 149 | + 'max' => 500, | |
| 150 | + 'step' => 1, | |
| 151 | + 'unit' => 'px', | |
| 152 | + 'default' => 18, | |
| 153 | + ), | |
| 154 | + | |
| 155 | + array( | |
| 156 | + 'id' => 'text-size', | |
| 157 | + 'type' => 'range', | |
| 158 | + 'title' => esc_html__( 'Text size', 'merchant' ), | |
| 159 | + 'min' => 1, | |
| 160 | + 'max' => 500, | |
| 161 | + 'step' => 1, | |
| 162 | + 'unit' => 'px', | |
| 163 | + 'default' => 18, | |
| 164 | + 'condition' => array( 'type', '==', 'text-icon' ), | |
| 165 | + ), | |
| 166 | + | |
| 167 | + array( | |
| 168 | + 'id' => 'padding', | |
| 169 | + 'type' => 'range', | |
| 170 | + 'title' => esc_html__( 'Padding', 'merchant' ), | |
| 171 | + 'min' => 0, | |
| 172 | + 'max' => 500, | |
| 173 | + 'step' => 1, | |
| 174 | + 'unit' => 'px', | |
| 175 | + 'default' => 15, | |
| 176 | + ), | |
| 177 | + | |
| 178 | + array( | |
| 179 | + 'id' => 'border-size', | |
| 180 | + 'type' => 'range', | |
| 181 | + 'title' => esc_html__( 'Border size', 'merchant' ), | |
| 182 | + 'min' => 1, | |
| 183 | + 'max' => 500, | |
| 184 | + 'step' => 1, | |
| 185 | + 'unit' => 'px', | |
| 186 | + 'default' => 2, | |
| 187 | + 'condition' => array( 'style', '==', 'merchant-style-outline' ), | |
| 188 | + ), | |
| 189 | + | |
| 190 | + array( | |
| 191 | + 'id' => 'border-radius', | |
| 192 | + 'type' => 'range', | |
| 193 | + 'title' => esc_html__( 'Border radius', 'merchant' ), | |
| 194 | + 'min' => 0, | |
| 195 | + 'max' => 999, | |
| 196 | + 'step' => 1, | |
| 197 | + 'unit' => 'px', | |
| 198 | + 'default' => 30, | |
| 199 | + ), | |
| 200 | + | |
| 201 | + array( | |
| 202 | + 'id' => 'icon-color', | |
| 203 | + 'type' => 'color', | |
| 204 | + 'title' => esc_html__( 'Icon color', 'merchant' ), | |
| 205 | + 'default' => '#FFFFFF', | |
| 206 | + ), | |
| 207 | + | |
| 208 | + array( | |
| 209 | + 'id' => 'icon-hover-color', | |
| 210 | + 'type' => 'color', | |
| 211 | + 'title' => esc_html__( 'Icon color hover', 'merchant' ), | |
| 212 | + 'default' => '#FFFFFF', | |
| 213 | + ), | |
| 214 | + | |
| 215 | + array( | |
| 216 | + 'id' => 'text-color', | |
| 217 | + 'type' => 'color', | |
| 218 | + 'title' => esc_html__( 'Text color', 'merchant' ), | |
| 219 | + 'default' => '#FFFFFF', | |
| 220 | + 'condition' => array( 'type', '==', 'text-icon' ), | |
| 221 | + ), | |
| 222 | + | |
| 223 | + array( | |
| 224 | + 'id' => 'text-hover-color', | |
| 225 | + 'type' => 'color', | |
| 226 | + 'title' => esc_html__( 'Text color hover', 'merchant' ), | |
| 227 | + 'default' => '#FFFFFF', | |
| 228 | + 'condition' => array( 'type', '==', 'text-icon' ), | |
| 229 | + ), | |
| 230 | + | |
| 231 | + array( | |
| 232 | + 'id' => 'border-color', | |
| 233 | + 'type' => 'color', | |
| 234 | + 'title' => esc_html__( 'Border color', 'merchant' ), | |
| 235 | + 'default' => '#212121', | |
| 236 | + 'condition' => array( 'style', '==', 'merchant-style-outline' ), | |
| 237 | + ), | |
| 238 | + | |
| 239 | + array( | |
| 240 | + 'id' => 'border-hover-color', | |
| 241 | + 'type' => 'color', | |
| 242 | + 'title' => esc_html__( 'Border color hover', 'merchant' ), | |
| 243 | + 'default' => '#757575', | |
| 244 | + 'condition' => array( 'style', '==', 'merchant-style-outline' ), | |
| 245 | + ), | |
| 246 | + | |
| 247 | + array( | |
| 248 | + 'id' => 'background-color', | |
| 249 | + 'type' => 'color', | |
| 250 | + 'title' => esc_html__( 'Background color', 'merchant' ), | |
| 251 | + 'default' => '#212121', | |
| 252 | + 'condition' => array( 'style', '==', 'merchant-style-filled' ), | |
| 253 | + ), | |
| 254 | + | |
| 255 | + array( | |
| 256 | + 'id' => 'background-hover-color', | |
| 257 | + 'type' => 'color', | |
| 258 | + 'title' => esc_html__( 'Background color hover', 'merchant' ), | |
| 259 | + 'default' => '#757575', | |
| 260 | + 'condition' => array( 'style', '==', 'merchant-style-filled' ), | |
| 261 | + ), | |
| 262 | + | |
| 263 | + ), | |
| 264 | +), | |
| 265 | +); | |