| @@ -1,221 +1,242 @@ | ||
| 1 | -<?php | |
| 2 | - | |
| 3 | -/** | |
| 4 | - * Login Popup Options. | |
| 5 | - * | |
| 6 | - * @package Merchant | |
| 7 | - */ | |
| 8 | - | |
| 9 | -if ( ! defined( 'ABSPATH' ) ) { | |
| 10 | - exit; // Exit if accessed directly | |
| 11 | -} | |
| 12 | - | |
| 13 | -// Settings | |
| 14 | -Merchant_Admin_Options::create( array( | |
| 15 | - 'title' => esc_html__( 'Settings', 'merchant' ), | |
| 16 | - 'module' => 'login-popup', | |
| 17 | - 'fields' => array( | |
| 18 | - | |
| 19 | - array( | |
| 20 | - 'id' => 'shortcode', | |
| 21 | - 'type' => 'text_readonly', | |
| 22 | - 'title' => esc_html__( 'Shortcode', 'merchant' ), | |
| 23 | - 'desc' => esc_html__( 'Copy this shortcode into pages to show login popup.', 'merchant' ), | |
| 24 | - 'default' => '[merchant_login_popup]', | |
| 25 | - ), | |
| 26 | - | |
| 27 | - array( | |
| 28 | - 'id' => 'login_link_text', | |
| 29 | - 'type' => 'text', | |
| 30 | - 'title' => esc_html__( 'Login link text', 'merchant' ), | |
| 31 | - 'desc' => esc_html__( 'Only visible to logout users.', 'merchant' ), | |
| 32 | - 'default' => esc_html__( 'Login', 'merchant' ), | |
| 33 | - ), | |
| 34 | - | |
| 35 | - array( | |
| 36 | - 'id' => 'show_welcome_message', | |
| 37 | - 'type' => 'switcher', | |
| 38 | - 'title' => esc_html__( 'Show welcome message', 'merchant' ), | |
| 39 | - 'desc' => esc_html__( 'Show a welcome message when the user it\'s logged in.', 'merchant' ), | |
| 40 | - 'default' => true, | |
| 41 | - ), | |
| 42 | - | |
| 43 | - array( | |
| 44 | - 'id' => 'welcome_message_text', | |
| 45 | - 'type' => 'text', | |
| 46 | - 'title' => esc_html__( 'Welcome message text', 'merchant' ), | |
| 47 | - 'desc' => esc_html__( 'You can use the following tags: {user_firstname}, {user_lastname}, {user_email}, {user_login}, {display_name}', 'merchant' ), | |
| 48 | - /* Translators: 1. Display name */ | |
| 49 | - 'default' => sprintf( esc_html__( 'Welcome %s', 'merchant' ), '{display_name}' ), | |
| 50 | - 'condition' => array( 'show_welcome_message', '==', true ), | |
| 51 | - ), | |
| 52 | - | |
| 53 | - array( | |
| 54 | - 'id' => 'login-text-color', | |
| 55 | - 'type' => 'color', | |
| 56 | - 'title' => esc_html__( 'Login text color', 'merchant' ), | |
| 57 | - 'default' => '#212121', | |
| 58 | - ), | |
| 59 | - | |
| 60 | - array( | |
| 61 | - 'id' => 'login-text-color-hover', | |
| 62 | - 'type' => 'color', | |
| 63 | - 'title' => esc_html__( 'Login text color hover', 'merchant' ), | |
| 64 | - 'default' => '#515151', | |
| 65 | - ), | |
| 66 | - | |
| 67 | - array( | |
| 68 | - 'id' => 'dropdown-link-color', | |
| 69 | - 'type' => 'color', | |
| 70 | - 'title' => esc_html__( 'Dropdown link color', 'merchant' ), | |
| 71 | - 'default' => '#212121', | |
| 72 | - ), | |
| 73 | - | |
| 74 | - array( | |
| 75 | - 'id' => 'dropdown-link-color-hover', | |
| 76 | - 'type' => 'color', | |
| 77 | - 'title' => esc_html__( 'Dropdown link color hover', 'merchant' ), | |
| 78 | - 'default' => '#515151', | |
| 79 | - ), | |
| 80 | - | |
| 81 | - array( | |
| 82 | - 'id' => 'dropdown-background-color', | |
| 83 | - 'type' => 'color', | |
| 84 | - 'title' => esc_html__( 'Dropdown background color', 'merchant' ), | |
| 85 | - 'default' => '#ffffff', | |
| 86 | - ), | |
| 87 | - | |
| 88 | - ) | |
| 89 | -) ); | |
| 90 | - | |
| 91 | -// Popup Settings | |
| 92 | -Merchant_Admin_Options::create( array( | |
| 93 | - 'title' => esc_html__( 'Popup Settings', 'merchant' ), | |
| 94 | - 'module' => 'login-popup', | |
| 95 | - 'fields' => array( | |
| 96 | - | |
| 97 | - array( | |
| 98 | - 'id' => 'popup-width', | |
| 99 | - 'type' => 'range', | |
| 100 | - 'title' => esc_html__( 'Popup width', 'merchant' ), | |
| 101 | - 'min' => 0, | |
| 102 | - 'max' => 1000, | |
| 103 | - 'step' => 1, | |
| 104 | - 'default' => 400, | |
| 105 | - 'unit' => 'px', | |
| 106 | - ), | |
| 107 | - | |
| 108 | - array( | |
| 109 | - 'id' => 'popup-title-color', | |
| 110 | - 'type' => 'color', | |
| 111 | - 'title' => esc_html__( 'Title color', 'merchant' ), | |
| 112 | - 'default' => '#212121', | |
| 113 | - ), | |
| 114 | - | |
| 115 | - array( | |
| 116 | - 'id' => 'popup-text-color', | |
| 117 | - 'type' => 'color', | |
| 118 | - 'title' => esc_html__( 'Text color', 'merchant' ), | |
| 119 | - 'default' => '#212121', | |
| 120 | - ), | |
| 121 | - | |
| 122 | - array( | |
| 123 | - 'id' => 'popup-icon-color', | |
| 124 | - 'type' => 'color', | |
| 125 | - 'title' => esc_html__( 'Icon color', 'merchant' ), | |
| 126 | - 'default' => '#212121', | |
| 127 | - ), | |
| 128 | - | |
| 129 | - array( | |
| 130 | - 'id' => 'popup-link-color', | |
| 131 | - 'type' => 'color', | |
| 132 | - 'title' => esc_html__( 'Link color', 'merchant' ), | |
| 133 | - 'default' => '#212121', | |
| 134 | - ), | |
| 135 | - | |
| 136 | - array( | |
| 137 | - 'id' => 'popup-button-color', | |
| 138 | - 'type' => 'color', | |
| 139 | - 'title' => esc_html__( 'Button color', 'merchant' ), | |
| 140 | - 'default' => '#ffffff', | |
| 141 | - ), | |
| 142 | - | |
| 143 | - array( | |
| 144 | - 'id' => 'popup-button-color-hover', | |
| 145 | - 'type' => 'color', | |
| 146 | - 'title' => esc_html__( 'Button color hover', 'merchant' ), | |
| 147 | - 'default' => '#ffffff', | |
| 148 | - ), | |
| 149 | - | |
| 150 | - array( | |
| 151 | - 'id' => 'popup-button-border-color', | |
| 152 | - 'type' => 'color', | |
| 153 | - 'title' => esc_html__( 'Button border color', 'merchant' ), | |
| 154 | - 'default' => '#212121', | |
| 155 | - ), | |
| 156 | - | |
| 157 | - array( | |
| 158 | - 'id' => 'popup-button-border-color-hover', | |
| 159 | - 'type' => 'color', | |
| 160 | - 'title' => esc_html__( 'Button border color hover', 'merchant' ), | |
| 161 | - 'default' => '#757575', | |
| 162 | - ), | |
| 163 | - | |
| 164 | - array( | |
| 165 | - 'id' => 'popup-button-background-color', | |
| 166 | - 'type' => 'color', | |
| 167 | - 'title' => esc_html__( 'Button background color', 'merchant' ), | |
| 168 | - 'default' => '#212121', | |
| 169 | - ), | |
| 170 | - | |
| 171 | - array( | |
| 172 | - 'id' => 'popup-button-background-color-hover', | |
| 173 | - 'type' => 'color', | |
| 174 | - 'title' => esc_html__( 'Button background color hover', 'merchant' ), | |
| 175 | - 'default' => '#757575', | |
| 176 | - ), | |
| 177 | - | |
| 178 | - array( | |
| 179 | - 'id' => 'popup-link-color-hover', | |
| 180 | - 'type' => 'color', | |
| 181 | - 'title' => esc_html__( 'Link color hover', 'merchant' ), | |
| 182 | - 'default' => '#515151', | |
| 183 | - ), | |
| 184 | - | |
| 185 | - array( | |
| 186 | - 'id' => 'popup-background-color', | |
| 187 | - 'type' => 'color', | |
| 188 | - 'title' => esc_html__( 'Background color', 'merchant' ), | |
| 189 | - 'default' => '#ffffff', | |
| 190 | - ), | |
| 191 | - | |
| 192 | - array( | |
| 193 | - 'id' => 'popup-footer-text-color', | |
| 194 | - 'type' => 'color', | |
| 195 | - 'title' => esc_html__( 'Footer text color', 'merchant' ), | |
| 196 | - 'default' => '#212121', | |
| 197 | - ), | |
| 198 | - | |
| 199 | - array( | |
| 200 | - 'id' => 'popup-footer-link-color', | |
| 201 | - 'type' => 'color', | |
| 202 | - 'title' => esc_html__( 'Footer link color', 'merchant' ), | |
| 203 | - 'default' => '#212121', | |
| 204 | - ), | |
| 205 | - | |
| 206 | - array( | |
| 207 | - 'id' => 'popup-footer-link-color-hover', | |
| 208 | - 'type' => 'color', | |
| 209 | - 'title' => esc_html__( 'Footer link color hover', 'merchant' ), | |
| 210 | - 'default' => '#515151', | |
| 211 | - ), | |
| 212 | - | |
| 213 | - array( | |
| 214 | - 'id' => 'popup-footer-background-color', | |
| 215 | - 'type' => 'color', | |
| 216 | - 'title' => esc_html__( 'Footer background color', 'merchant' ), | |
| 217 | - 'default' => '#f5f5f5', | |
| 218 | - ), | |
| 219 | - | |
| 220 | - ) | |
| 221 | -) ); | |
| 1 | +<?php | |
| 2 | + | |
| 3 | +/** | |
| 4 | + * Login Popup Options. | |
| 5 | + * | |
| 6 | + * @package Merchant | |
| 7 | + */ | |
| 8 | + | |
| 9 | +if ( ! defined( 'ABSPATH' ) ) { | |
| 10 | + exit; // Exit if accessed directly | |
| 11 | +} | |
| 12 | + | |
| 13 | +// Settings | |
| 14 | + | |
| 15 | +return array( | |
| 16 | + array( | |
| 17 | + 'title' => esc_html__( 'Settings', 'merchant' ), | |
| 18 | + 'module' => 'login-popup', | |
| 19 | + 'fields' => array( | |
| 20 | + | |
| 21 | + array( | |
| 22 | + 'id' => 'shortcode', | |
| 23 | + 'type' => 'text_readonly', | |
| 24 | + 'title' => esc_html__( 'Shortcode', 'merchant' ), | |
| 25 | + 'desc' => esc_html__( 'Copy this shortcode into pages to show login popup.', 'merchant' ), | |
| 26 | + 'default' => '[merchant_login_popup]', | |
| 27 | + ), | |
| 28 | + | |
| 29 | + array( | |
| 30 | + 'id' => 'login_link_text', | |
| 31 | + 'type' => 'text', | |
| 32 | + 'title' => esc_html__( 'Login link text', 'merchant' ), | |
| 33 | + 'desc' => esc_html__( 'Only visible to logout users.', 'merchant' ), | |
| 34 | + 'default' => esc_html__( 'Login', 'merchant' ), | |
| 35 | + ), | |
| 36 | + | |
| 37 | + array( | |
| 38 | + 'id' => 'show_welcome_message', | |
| 39 | + 'type' => 'switcher', | |
| 40 | + 'title' => esc_html__( 'Show welcome message', 'merchant' ), | |
| 41 | + 'desc' => esc_html__( 'Show a welcome message when the user it\'s logged in.', 'merchant' ), | |
| 42 | + 'default' => true, | |
| 43 | + 'ai_meta' => array( | |
| 44 | + 'toggle_for' => 'welcome_message_text', | |
| 45 | + 'usage_hint' => 'Enable this toggle before setting welcome_message_text. Controls whether a personalised welcome message is shown to logged-in users.', | |
| 46 | + ), | |
| 47 | + ), | |
| 48 | + | |
| 49 | + array( | |
| 50 | + 'id' => 'welcome_message_text', | |
| 51 | + 'type' => 'text', | |
| 52 | + 'title' => esc_html__( 'Welcome message text', 'merchant' ), | |
| 53 | + 'desc' => esc_html__( 'You can use these codes in the content.', 'merchant' ), | |
| 54 | + 'hidden_desc' => sprintf( | |
| 55 | + /* Translators: %1$s: User first name, %2$s: User last name, %3$s: User email, %4$s: User login name, %5$s: User display name */ | |
| 56 | + __( | |
| 57 | + '<strong>%1$s:</strong> displays the user’s first name<br><strong>%2$s:</strong> displays the user’s last name<br><strong>%3$s:</strong> displays the user’s email<br><strong>%4$s</strong> displays the user’s login name<br><strong>%5$s:</strong> displays the user’s display name.', | |
| 58 | + 'merchant' | |
| 59 | + ), | |
| 60 | + '{user_firstname}', | |
| 61 | + '{user_lastname}', | |
| 62 | + '{user_email}', | |
| 63 | + '{user_login}', | |
| 64 | + '{display_name}' | |
| 65 | + ), | |
| 66 | + /* Translators: 1. Display name */ | |
| 67 | + 'default' => sprintf( esc_html__( 'Welcome %s', 'merchant' ), '{display_name}' ), | |
| 68 | + 'condition' => array( 'show_welcome_message', '==', '1' ), | |
| 69 | + 'ai_meta' => array( | |
| 70 | + 'toggled_by' => 'show_welcome_message', | |
| 71 | + 'usage_hint' => 'Supports template vars: {display_name}, {user_firstname}, {user_lastname}, {user_email}, {user_login}. Only shown when show_welcome_message is enabled.', | |
| 72 | + ), | |
| 73 | + ), | |
| 74 | + | |
| 75 | + array( | |
| 76 | + 'id' => 'login-text-color', | |
| 77 | + 'type' => 'color', | |
| 78 | + 'title' => esc_html__( 'Login text color', 'merchant' ), | |
| 79 | + 'default' => '#212121', | |
| 80 | + ), | |
| 81 | + | |
| 82 | + array( | |
| 83 | + 'id' => 'login-text-color-hover', | |
| 84 | + 'type' => 'color', | |
| 85 | + 'title' => esc_html__( 'Login text color hover', 'merchant' ), | |
| 86 | + 'default' => '#515151', | |
| 87 | + ), | |
| 88 | + | |
| 89 | + array( | |
| 90 | + 'id' => 'dropdown-link-color', | |
| 91 | + 'type' => 'color', | |
| 92 | + 'title' => esc_html__( 'Dropdown link color', 'merchant' ), | |
| 93 | + 'default' => '#212121', | |
| 94 | + ), | |
| 95 | + | |
| 96 | + array( | |
| 97 | + 'id' => 'dropdown-link-color-hover', | |
| 98 | + 'type' => 'color', | |
| 99 | + 'title' => esc_html__( 'Dropdown link color hover', 'merchant' ), | |
| 100 | + 'default' => '#515151', | |
| 101 | + ), | |
| 102 | + | |
| 103 | + array( | |
| 104 | + 'id' => 'dropdown-background-color', | |
| 105 | + 'type' => 'color', | |
| 106 | + 'title' => esc_html__( 'Dropdown background color', 'merchant' ), | |
| 107 | + 'default' => '#ffffff', | |
| 108 | + ), | |
| 109 | + | |
| 110 | + ), | |
| 111 | +), | |
| 112 | + array( | |
| 113 | + 'title' => esc_html__( 'Popup Settings', 'merchant' ), | |
| 114 | + 'module' => 'login-popup', | |
| 115 | + 'fields' => array( | |
| 116 | + | |
| 117 | + array( | |
| 118 | + 'id' => 'popup-width', | |
| 119 | + 'type' => 'range', | |
| 120 | + 'title' => esc_html__( 'Popup width', 'merchant' ), | |
| 121 | + 'min' => 0, | |
| 122 | + 'max' => 1000, | |
| 123 | + 'step' => 1, | |
| 124 | + 'default' => 400, | |
| 125 | + 'unit' => 'px', | |
| 126 | + ), | |
| 127 | + | |
| 128 | + array( | |
| 129 | + 'id' => 'popup-title-color', | |
| 130 | + 'type' => 'color', | |
| 131 | + 'title' => esc_html__( 'Title color', 'merchant' ), | |
| 132 | + 'default' => '#212121', | |
| 133 | + ), | |
| 134 | + | |
| 135 | + array( | |
| 136 | + 'id' => 'popup-text-color', | |
| 137 | + 'type' => 'color', | |
| 138 | + 'title' => esc_html__( 'Text color', 'merchant' ), | |
| 139 | + 'default' => '#212121', | |
| 140 | + ), | |
| 141 | + | |
| 142 | + array( | |
| 143 | + 'id' => 'popup-icon-color', | |
| 144 | + 'type' => 'color', | |
| 145 | + 'title' => esc_html__( 'Icon color', 'merchant' ), | |
| 146 | + 'default' => '#212121', | |
| 147 | + ), | |
| 148 | + | |
| 149 | + array( | |
| 150 | + 'id' => 'popup-link-color', | |
| 151 | + 'type' => 'color', | |
| 152 | + 'title' => esc_html__( 'Link color', 'merchant' ), | |
| 153 | + 'default' => '#212121', | |
| 154 | + ), | |
| 155 | + | |
| 156 | + array( | |
| 157 | + 'id' => 'popup-button-color', | |
| 158 | + 'type' => 'color', | |
| 159 | + 'title' => esc_html__( 'Button color', 'merchant' ), | |
| 160 | + 'default' => '#ffffff', | |
| 161 | + ), | |
| 162 | + | |
| 163 | + array( | |
| 164 | + 'id' => 'popup-button-color-hover', | |
| 165 | + 'type' => 'color', | |
| 166 | + 'title' => esc_html__( 'Button color hover', 'merchant' ), | |
| 167 | + 'default' => '#ffffff', | |
| 168 | + ), | |
| 169 | + | |
| 170 | + array( | |
| 171 | + 'id' => 'popup-button-border-color', | |
| 172 | + 'type' => 'color', | |
| 173 | + 'title' => esc_html__( 'Button border color', 'merchant' ), | |
| 174 | + 'default' => '#212121', | |
| 175 | + ), | |
| 176 | + | |
| 177 | + array( | |
| 178 | + 'id' => 'popup-button-border-color-hover', | |
| 179 | + 'type' => 'color', | |
| 180 | + 'title' => esc_html__( 'Button border color hover', 'merchant' ), | |
| 181 | + 'default' => '#757575', | |
| 182 | + ), | |
| 183 | + | |
| 184 | + array( | |
| 185 | + 'id' => 'popup-button-background-color', | |
| 186 | + 'type' => 'color', | |
| 187 | + 'title' => esc_html__( 'Button background color', 'merchant' ), | |
| 188 | + 'default' => '#212121', | |
| 189 | + ), | |
| 190 | + | |
| 191 | + array( | |
| 192 | + 'id' => 'popup-button-background-color-hover', | |
| 193 | + 'type' => 'color', | |
| 194 | + 'title' => esc_html__( 'Button background color hover', 'merchant' ), | |
| 195 | + 'default' => '#757575', | |
| 196 | + ), | |
| 197 | + | |
| 198 | + array( | |
| 199 | + 'id' => 'popup-link-color-hover', | |
| 200 | + 'type' => 'color', | |
| 201 | + 'title' => esc_html__( 'Link color hover', 'merchant' ), | |
| 202 | + 'default' => '#515151', | |
| 203 | + ), | |
| 204 | + | |
| 205 | + array( | |
| 206 | + 'id' => 'popup-background-color', | |
| 207 | + 'type' => 'color', | |
| 208 | + 'title' => esc_html__( 'Background color', 'merchant' ), | |
| 209 | + 'default' => '#ffffff', | |
| 210 | + ), | |
| 211 | + | |
| 212 | + array( | |
| 213 | + 'id' => 'popup-footer-text-color', | |
| 214 | + 'type' => 'color', | |
| 215 | + 'title' => esc_html__( 'Footer text color', 'merchant' ), | |
| 216 | + 'default' => '#212121', | |
| 217 | + ), | |
| 218 | + | |
| 219 | + array( | |
| 220 | + 'id' => 'popup-footer-link-color', | |
| 221 | + 'type' => 'color', | |
| 222 | + 'title' => esc_html__( 'Footer link color', 'merchant' ), | |
| 223 | + 'default' => '#212121', | |
| 224 | + ), | |
| 225 | + | |
| 226 | + array( | |
| 227 | + 'id' => 'popup-footer-link-color-hover', | |
| 228 | + 'type' => 'color', | |
| 229 | + 'title' => esc_html__( 'Footer link color hover', 'merchant' ), | |
| 230 | + 'default' => '#515151', | |
| 231 | + ), | |
| 232 | + | |
| 233 | + array( | |
| 234 | + 'id' => 'popup-footer-background-color', | |
| 235 | + 'type' => 'color', | |
| 236 | + 'title' => esc_html__( 'Footer background color', 'merchant' ), | |
| 237 | + 'default' => '#f5f5f5', | |
| 238 | + ), | |
| 239 | + | |
| 240 | + ), | |
| 241 | +), | |
| 242 | +); | |