Custom Login Page Customizer by Colorlib - Version 1.2.7

Version Description

  • Added options to edit register form
  • Added options to edit lost password form
Download this release

Release Info

Developer machothemes
Plugin Icon wp plugin Custom Login Page Customizer by Colorlib
Version 1.2.7
Comparing to
See all releases

Code changes from version 1.2.1 to 1.2.7

LICENSE → LICENSE.txt RENAMED
File without changes
assets/css/clc-customizer.css CHANGED
@@ -433,4 +433,8 @@
433
  opacity: 1;
434
  -webkit-transition: opacity .2s;
435
  transition: opacity .2s;
 
 
 
 
436
  }
433
  opacity: 1;
434
  -webkit-transition: opacity .2s;
435
  transition: opacity .2s;
436
+ }
437
+
438
+ li#customize-control-clc-options-custom-css > .CodeMirror-wrap {
439
+ height:calc(100vh - 230px);
440
  }
assets/js/clc-customizer.js CHANGED
@@ -17,6 +17,28 @@
17
  });
18
  });
19
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
  wp.customize.controlConstructor['clc-templates'] = wp.customize.Control.extend({
21
  ready: function() {
22
  var control = this;
@@ -126,7 +148,7 @@
126
  ready: function() {
127
  var control = this,
128
  updating = false;
129
-
130
  control.values = control.params.value;
131
 
132
  control.container.on( 'click', '.clc-layouts-setup .clc-column > a', function() {
@@ -135,7 +157,7 @@
135
  updating = true;
136
  control.updateColumns( currentAction );
137
  updating = false;
138
-
139
  });
140
 
141
  // Whenever the setting's value changes, refresh the preview.
@@ -260,6 +282,7 @@
260
  backgroundControl = wp.customize.control( 'clc-options[custom-background-form]' ),
261
  columnsWidthControl = wp.customize.control( 'clc-options[columns-width]' ),
262
  backgroundColorControl = wp.customize.control( 'clc-options[custom-background-color-form]' );
 
263
  if ( '2' === to ) {
264
  alignControl.toggle( true );
265
  backgroundControl.toggle( true );
@@ -272,28 +295,50 @@
272
  columnsWidthControl.toggle( false );
273
  }
274
  });
275
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
276
 
277
  wp.customize( 'clc-options[use-text-logo]', function( value ) {
278
  value.bind( function( to ) {
279
- var logoText = wp.customize.control( 'clc-options[logo-text]' ),
280
- logoTextColor = wp.customize.control( 'clc-options[logo-text-color]' ),
281
  logoTextColorHover = wp.customize.control( 'clc-options[logo-text-color-hover]' ),
282
  logoTextSize = wp.customize.control( 'clc-options[logo-text-size]' ),
283
- logoImage = wp.customize.control( 'clc-options[custom-logo]' );
 
 
284
 
285
  if ( '1' == to ) {
286
- logoText.toggle( true );
287
  logoTextColor.toggle( true );
288
  logoTextColorHover.toggle( true );
289
  logoTextSize.toggle( true );
 
290
  logoImage.toggle( false );
 
 
291
  }else{
292
- logoText.toggle( false );
293
  logoTextColor.toggle( false );
294
  logoTextColorHover.toggle( false );
295
  logoTextSize.toggle( false );
 
296
  logoImage.toggle( true );
 
 
297
  }
298
  });
299
  });
17
  });
18
  });
19
 
20
+ wp.customize.section( 'clc_register-form', function( section ) {
21
+ section.expanded.bind( function( isExpanding ) {
22
+ // Value of isExpanding will = true if you're entering the section, false if you're leaving it.
23
+ if ( isExpanding ) {
24
+ wp.customize.previewer.send( 'change-form', 'register' );
25
+ } else {
26
+ wp.customize.previewer.send( 'change-form', 'login' );
27
+ }
28
+ });
29
+ });
30
+
31
+ wp.customize.section( 'clc_lostpassword-form', function( section ) {
32
+ section.expanded.bind( function( isExpanding ) {
33
+ // Value of isExpanding will = true if you're entering the section, false if you're leaving it.
34
+ if ( isExpanding ) {
35
+ wp.customize.previewer.send( 'change-form', 'lostpassword' );
36
+ } else {
37
+ wp.customize.previewer.send( 'change-form', 'login' );
38
+ }
39
+ });
40
+ });
41
+
42
  wp.customize.controlConstructor['clc-templates'] = wp.customize.Control.extend({
43
  ready: function() {
44
  var control = this;
148
  ready: function() {
149
  var control = this,
150
  updating = false;
151
+
152
  control.values = control.params.value;
153
 
154
  control.container.on( 'click', '.clc-layouts-setup .clc-column > a', function() {
157
  updating = true;
158
  control.updateColumns( currentAction );
159
  updating = false;
160
+
161
  });
162
 
163
  // Whenever the setting's value changes, refresh the preview.
282
  backgroundControl = wp.customize.control( 'clc-options[custom-background-form]' ),
283
  columnsWidthControl = wp.customize.control( 'clc-options[columns-width]' ),
284
  backgroundColorControl = wp.customize.control( 'clc-options[custom-background-color-form]' );
285
+
286
  if ( '2' === to ) {
287
  alignControl.toggle( true );
288
  backgroundControl.toggle( true );
295
  columnsWidthControl.toggle( false );
296
  }
297
  });
298
+ });
299
+
300
+ // validation for the login-level setting
301
+ wp.customize( 'clc-options[login-label]', function ( setting ) {
302
+ setting.validate = function ( value ) {
303
+ var code, notification;
304
+
305
+ code = 'required';
306
+ if ( ! value ) {
307
+ notification = new wp.customize.Notification( code, {message: 'value is empty' } );
308
+ setting.notifications.add( code, notification );
309
+ } else {
310
+ setting.notifications.remove( code );
311
+ }
312
+
313
+ return value;
314
+ };
315
+ } );
316
 
317
  wp.customize( 'clc-options[use-text-logo]', function( value ) {
318
  value.bind( function( to ) {
319
+ var logoTextColor = wp.customize.control( 'clc-options[logo-text-color]' ),
 
320
  logoTextColorHover = wp.customize.control( 'clc-options[logo-text-color-hover]' ),
321
  logoTextSize = wp.customize.control( 'clc-options[logo-text-size]' ),
322
+ logoImage = wp.customize.control( 'clc-options[custom-logo]' ),
323
+ logoWidth = wp.customize.control( 'clc-options[logo-width]' ),
324
+ logoHeight = wp.customize.control( 'clc-options[logo-height]' )
325
 
326
  if ( '1' == to ) {
 
327
  logoTextColor.toggle( true );
328
  logoTextColorHover.toggle( true );
329
  logoTextSize.toggle( true );
330
+
331
  logoImage.toggle( false );
332
+ logoWidth.toggle( false );
333
+ logoHeight.toggle( false );
334
  }else{
 
335
  logoTextColor.toggle( false );
336
  logoTextColorHover.toggle( false );
337
  logoTextSize.toggle( false );
338
+
339
  logoImage.toggle( true );
340
+ logoWidth.toggle( true );
341
+ logoHeight.toggle( true );
342
  }
343
  });
344
  });
assets/js/clc-preview.js CHANGED
@@ -90,12 +90,19 @@
90
  } );
91
  } );
92
 
93
- wp.customize( 'clc-options[logo-text]', function( value ) {
94
  value.bind( function( to ) {
95
  $( '#logo-text' ).text( to );
96
  } );
97
  } );
98
 
 
 
 
 
 
 
 
99
  /* Column Align */
100
  wp.customize( 'clc-options[form-column-align]', function( value ) {
101
  value.bind( function( to ) {
@@ -141,6 +148,114 @@
141
  } );
142
  } );
143
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
144
  // Columns width
145
  wp.customize( 'clc-options[columns-width]', function( value ) {
146
  value.bind( function( to ) {
@@ -166,4 +281,22 @@
166
  wp.customize.preview.send( 'clc-focus-section', $( this ).data( 'section' ) );
167
  } );
168
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
169
  })( jQuery );
90
  } );
91
  } );
92
 
93
+ wp.customize( 'clc-options[logo-title]', function( value ) {
94
  value.bind( function( to ) {
95
  $( '#logo-text' ).text( to );
96
  } );
97
  } );
98
 
99
+ // logo title
100
+ wp.customize( 'clc-options[logo-title]', function( value ) {
101
+ value.bind( function( to ) {
102
+ $( '#clc-logo-link' ).attr( 'title', to );
103
+ } );
104
+ } );
105
+
106
  /* Column Align */
107
  wp.customize( 'clc-options[form-column-align]', function( value ) {
108
  value.bind( function( to ) {
148
  } );
149
  } );
150
 
151
+ // Remember Me label
152
+ wp.customize( 'clc-options[rememberme-label]', function( value ) {
153
+ value.bind( function( to ) {
154
+ $( '#clc-rememberme-label' ).text( to );
155
+ } );
156
+ } );
157
+
158
+ // Logo url
159
+ wp.customize( 'clc-options[logo-url]', function( value ) {
160
+ value.bind( function( to ) {
161
+ $( 'a#clc-logo-link' ).attr('href', to );
162
+ } );
163
+ } );
164
+
165
+ // Lost password text
166
+ wp.customize( 'clc-options[lost-password-text]', function( value ) {
167
+ value.bind( function( to ) {
168
+ $( '#clc-lost-password-text' ).text( to );
169
+ } );
170
+ } );
171
+
172
+ // Back to site text
173
+ wp.customize( 'clc-options[back-to-text]', function( value ) {
174
+ value.bind( function( to ) {
175
+ $( '#clc-back-to-text' ).html( '← ' + to );
176
+ } );
177
+ } );
178
+
179
+ // Login label
180
+ wp.customize( 'clc-options[login-label]', function( value ) {
181
+ value.bind( function( to ) {
182
+ if( ! to ) {
183
+ return;
184
+ }
185
+ $( '#loginform input[name="wp-submit"]' ).val( to );
186
+ } );
187
+ } );
188
+
189
+ // Register username label
190
+ wp.customize( 'clc-options[register-username-label]', function( value ) {
191
+ value.bind( function( to ) {
192
+ $( '#clc-register-sername-label' ).html( to );
193
+ } );
194
+ } );
195
+
196
+ // Register email label
197
+ wp.customize( 'clc-options[register-email-label]', function( value ) {
198
+ value.bind( function( to ) {
199
+ $( '#clc-register-email-label' ).html( to );
200
+ } );
201
+ } );
202
+
203
+ // Register confirmation text
204
+ wp.customize( 'clc-options[register-confirmation-email]', function( value ) {
205
+ value.bind( function( to ) {
206
+ $( '#reg_passmail' ).html( to );
207
+ } );
208
+ } );
209
+
210
+
211
+ // Register button text
212
+ wp.customize( 'clc-options[register-button-label]', function( value ) {
213
+ value.bind( function( to ) {
214
+ if( ! to ) {
215
+ return;
216
+ }
217
+ $( '#registerform input[name="wp-submit"]' ).val( to );
218
+ } );
219
+ } );
220
+
221
+ // Register link text
222
+ wp.customize( 'clc-options[register-link-label]', function( value ) {
223
+ value.bind( function( to ) {
224
+ if( ! to ) {
225
+ return;
226
+ }
227
+ $( '#register-link-label' ).text( to );
228
+ } );
229
+ } );
230
+
231
+ // Login link text
232
+ wp.customize( 'clc-options[login-link-label]', function( value ) {
233
+ value.bind( function( to ) {
234
+ if( ! to ) {
235
+ return;
236
+ }
237
+ $( '#login-link-label' ).text( to );
238
+ } );
239
+ } );
240
+
241
+ // Lost password button text
242
+ wp.customize( 'clc-options[lostpassword-button-label]', function( value ) {
243
+ value.bind( function( to ) {
244
+ if( ! to ) {
245
+ return;
246
+ }
247
+ $( '#lostpasswordform input[name="wp-submit"]' ).val( to );
248
+ } );
249
+ } );
250
+
251
+ // Username label
252
+ wp.customize( 'clc-options[lostpassword-username-label]', function( value ) {
253
+ value.bind( function( to ) {
254
+ $( '#lostpasswordform label span' ).text( to );
255
+ } );
256
+ } );
257
+
258
+
259
  // Columns width
260
  wp.customize( 'clc-options[columns-width]', function( value ) {
261
  value.bind( function( to ) {
281
  wp.customize.preview.send( 'clc-focus-section', $( this ).data( 'section' ) );
282
  } );
283
 
284
+ wp.customize.bind( 'preview-ready', function() {
285
+ wp.customize.preview.bind( 'change-form', function( form ) {
286
+ if ( 'register' == form ) {
287
+ $('.show-only_login').hide();
288
+ $('.show-only_lostpassword').hide();
289
+ $('.show-only_register').show();
290
+ }else if( 'lostpassword' == form ){
291
+ $('.show-only_login').hide();
292
+ $('.show-only_register').hide();
293
+ $('.show-only_lostpassword').show();
294
+ }else{
295
+ $('.show-only_register').hide();
296
+ $('.show-only_lostpassword').hide();
297
+ $('.show-only_login').show();
298
+ }
299
+ } );
300
+ } );
301
+
302
  })( jQuery );
colorlib-login-customizer.php CHANGED
@@ -1,46 +1,72 @@
1
- <?php
2
- /*
3
- * Plugin Name: Colorlib Login Customizer
4
- * Version: 1.2.1
5
- * Description: Colorlib Login Customizer is an awesome and intuitive plugin that helps you personalize your login form directly from the Customizer. The plugin fully supports the Live Customizer feature and you can see all the changes in real time and edit them.
6
- * Author: Colorlib
7
- * Author URI: https://colorlib.com/
8
- * Requires at least: 4.0
9
- * Tested up to: 4.9
10
- *
11
- * Text Domain: colorlib-login-customizer
12
- * Domain Path: /languages/
13
- *
14
- * @package WordPress
15
- * @author Colorlib
16
- * @since 1.0.0
17
- */
18
-
19
- if ( ! defined( 'ABSPATH' ) ) {
20
- exit;
21
- }
22
-
23
- define( 'COLORLIB_LOGIN_CUSTOMIZER_BASE', plugin_dir_path( __FILE__ ) );
24
- define( 'COLORLIB_LOGIN_CUSTOMIZER_URL', plugin_dir_url( __FILE__ ) );
25
- define( 'COLORLIB_LOGIN_CUSTOMIZER_SITE', rtrim( ABSPATH, '\\/' ) );
26
-
27
- // Load plugin class files
28
- require_once 'includes/class-colorlib-login-customizer-autoloader.php';
29
-
30
- /**
31
- * Returns the main instance of Colorlib_Login_Customizer to prevent the need to use globals.
32
- *
33
- * @since 1.0.0
34
- * @return object Colorlib_Login_Customizer
35
- */
36
- function colorlib_login_customizer() {
37
- $instance = Colorlib_Login_Customizer::instance( __FILE__, '1.2.1' );
38
-
39
- if ( is_null( $instance->settings ) ) {
40
- $instance->settings = Colorlib_Login_Customizer_Settings::instance( $instance );
41
- }
42
-
43
- return $instance;
44
- }
45
-
46
- colorlib_login_customizer();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Plugin Name: Colorlib Login Customizer
4
+ * Version: 1.2.7
5
+ * Description: Colorlib Login Customizer is an awesome and intuitive plugin that helps you personalize your login form directly from the Customizer. The plugin fully supports the Live Customizer feature and you can see all the changes in real time and edit them.
6
+ * Author: Colorlib
7
+ * Author URI: https://colorlib.com/
8
+ * Tested up to: 5.1
9
+ * Requires: 4.6 or higher
10
+ * License: GPLv3 or later
11
+ * License URI: http://www.gnu.org/licenses/gpl-3.0.html
12
+ * Requires PHP: 5.6
13
+ * Text Domain: colorlib-login-customizer
14
+ * Domain Path: /languages
15
+ *
16
+ * Copyright 2018-2019 Colorlib support@colorlib.com
17
+ *
18
+ * This program is free software; you can redistribute it and/or modify
19
+ * it under the terms of the GNU General Public License, version 3, as
20
+ * published by the Free Software Foundation.
21
+ *
22
+ * This program is distributed in the hope that it will be useful,
23
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
24
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25
+ * GNU General Public License for more details.
26
+ *
27
+ * You should have received a copy of the GNU General Public License
28
+ * along with this program; if not, write to the Free Software
29
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
30
+ */
31
+
32
+ if ( ! defined( 'ABSPATH' ) ) {
33
+ exit;
34
+ }
35
+
36
+ define( 'COLORLIB_LOGIN_CUSTOMIZER_BASE', plugin_dir_path( __FILE__ ) );
37
+ define( 'COLORLIB_LOGIN_CUSTOMIZER_URL', plugin_dir_url( __FILE__ ) );
38
+ define( 'COLORLIB_LOGIN_CUSTOMIZER_SITE', rtrim( ABSPATH, '\\/' ) );
39
+
40
+ // Load plugin class files
41
+ require_once 'includes/class-colorlib-login-customizer-autoloader.php';
42
+
43
+ /**
44
+ * Returns the main instance of Colorlib_Login_Customizer to prevent the need to use globals.
45
+ *
46
+ * @since 1.0.0
47
+ * @return object Colorlib_Login_Customizer
48
+ */
49
+ function colorlib_login_customizer() {
50
+ $instance = Colorlib_Login_Customizer::instance( __FILE__, '1.2.7' );
51
+
52
+ if ( is_null( $instance->settings ) ) {
53
+ $instance->settings = Colorlib_Login_Customizer_Settings::instance( $instance );
54
+ }
55
+
56
+ return $instance;
57
+ }
58
+
59
+ function clc_check_for_review() {
60
+ if ( ! is_admin() ) {
61
+ return;
62
+ }
63
+ require_once COLORLIB_LOGIN_CUSTOMIZER_BASE . 'includes/class-colorlib-login-customizer-review.php';
64
+
65
+ CLC_Review::get_instance( array(
66
+ 'slug' => 'colorlib-login-customizer',
67
+ ) );
68
+ }
69
+
70
+ colorlib_login_customizer();
71
+ clc_check_for_review();
72
+
includes/class-colorlib-login-customizer-feedback.php DELETED
@@ -1,262 +0,0 @@
1
- <?php
2
-
3
- class Colorlib_Login_Customizer_Feedback {
4
-
5
- private $plugin_file = '';
6
- private $plugin_name = '';
7
-
8
- function __construct( $_plugin_file ) {
9
-
10
- $this->plugin_file = $_plugin_file;
11
- $this->plugin_name = basename( $this->plugin_file, '.php' );
12
-
13
- // Deactivation
14
- add_filter( 'plugin_action_links_' . plugin_basename( $this->plugin_file ), array( $this, 'filter_action_links' ) );
15
- add_action( 'admin_footer-plugins.php', array( $this, 'goodbye_ajax' ) );
16
- add_action( 'wp_ajax_epsilon_deactivate_plugin', array( $this, 'epsilon_deactivate_plugin_callback' ) );
17
-
18
- }
19
-
20
- /**
21
- * Filter the deactivation link to allow us to present a form when the user deactivates the plugin
22
- * @since 1.0.0
23
- */
24
- public function filter_action_links( $links ) {
25
-
26
- if ( isset( $links['deactivate'] ) ) {
27
- $deactivation_link = $links['deactivate'];
28
- // Insert an onClick action to allow form before deactivating
29
- $deactivation_link = str_replace( '<a ', '<div class="epsilon-deactivate-form-wrapper"><span class="epsilon-deactivate-form" id="epsilon-deactivate-form-' . esc_attr( $this->plugin_name ) . '"></span></div><a onclick="javascript:event.preventDefault();" id="epsilon-deactivate-link-' . esc_attr( $this->plugin_name ) . '" ', $deactivation_link );
30
- $links['deactivate'] = $deactivation_link;
31
- }
32
- return $links;
33
- }
34
-
35
- /**
36
- * Form text strings
37
- * These can be filtered
38
- * @since 1.0.0
39
- */
40
- public function goodbye_ajax() {
41
- // Get our strings for the form
42
- $form = $this->get_form_info();
43
-
44
- // Build the HTML to go in the form
45
- $html = '<div class="epsilon-deactivate-form-head"><strong>' . esc_html( $form['heading'] ) . '</strong></div>';
46
- $html .= '<div class="epsilon-deactivate-form-body"><p>' . esc_html( $form['body'] ) . '</p>';
47
- if ( is_array( $form['options'] ) ) {
48
- $html .= '<div class="epsilon-deactivate-options"><p>';
49
- foreach ( $form['options'] as $key => $option ) {
50
- if ( 'no-reason' == $key ) {
51
- $html .= '<input type="radio" name="epsilon-deactivate-reason" checked="checked" id="' . esc_attr( $key ) . '" value="' . esc_attr( $key ) . '"> <label for="' . esc_attr( $key ) . '">' . esc_attr( $option ) . '</label><br>';
52
- } else {
53
- $html .= '<input type="radio" name="epsilon-deactivate-reason" id="' . esc_attr( $key ) . '" value="' . esc_attr( $key ) . '"> <label for="' . esc_attr( $key ) . '">' . esc_attr( $option ) . '</label><br>';
54
- }
55
- }
56
- $html .= '</p><label id="epsilon-deactivate-details-label" for="epsilon-deactivate-reasons"><strong>' . esc_html( $form['details'] ) . '</strong></label><textarea name="epsilon-deactivate-details" id="epsilon-deactivate-details" rows="2" style="width:100%"></textarea>';
57
- $html .= '<input type="checkbox" name="epsilon-deactivate-tracking" checked="" id="allow-tracking" value="yes"> <label for="allow-tracking">' . esc_html__( 'Allow us to get more information in order to improve our plugin', 'colorlib-login-customizer' ) . '</label><br>';
58
- $html .= '</div><!-- .epsilon-deactivate-options -->';
59
- }
60
- $html .= '</div><!-- .epsilon-deactivate-form-body -->';
61
- $html .= '<p class="deactivating-spinner"><span class="spinner"></span> ' . __( 'Submitting form', 'colorlib-login-customizer' ) . '</p>';
62
- $html .= '<div class="epsilon-deactivate-form-footer"><p><a id="epsilon-deactivate-plugin" href="#">' . __( 'Just Deactivate', 'colorlib-login-customizer' ) . '</a><a id="epsilon-deactivate-submit-form" class="button button-primary" href="#">' . __( 'Submit and Deactivate', 'colorlib-login-customizer' ) . '</a></p></div>'
63
- ?>
64
- <div class="epsilon-deactivate-form-bg"></div>
65
- <style type="text/css">
66
- .epsilon-deactivate-form-active .epsilon-deactivate-form-bg {
67
- background: rgba( 0, 0, 0, .5 );
68
- position: fixed;
69
- top: 0;
70
- left: 0;
71
- width: 100%;
72
- height: 100%;
73
- }
74
- .epsilon-deactivate-form-wrapper {
75
- position: relative;
76
- z-index: 999;
77
- display: none;
78
- }
79
- .epsilon-deactivate-form-active .epsilon-deactivate-form-wrapper {
80
- display: block;
81
- }
82
- .epsilon-deactivate-form {
83
- display: none;
84
- }
85
- .epsilon-deactivate-form-active .epsilon-deactivate-form {
86
- position: absolute;
87
- bottom: 30px;
88
- left: 0;
89
- width: 400px;
90
- background: #fff;
91
- white-space: normal;
92
- }
93
- .epsilon-deactivate-form-head {
94
- background: #51AD31;
95
- color: #fff;
96
- padding: 8px 18px;
97
- }
98
- .epsilon-deactivate-form-body {
99
- padding: 8px 18px;
100
- color: #444;
101
- }
102
- .deactivating-spinner {
103
- display: none;
104
- }
105
- .deactivating-spinner .spinner {
106
- float: none;
107
- margin: 4px 4px 0 18px;
108
- vertical-align: bottom;
109
- visibility: visible;
110
- }
111
- .epsilon-deactivate-form-footer {
112
- padding: 8px 18px;
113
- }
114
- .epsilon-deactivate-form-footer p {
115
- display: flex;
116
- align-items: center;
117
- justify-content: space-between;
118
- }
119
- .epsilon-deactivate-form.process-response .epsilon-deactivate-form-body,
120
- .epsilon-deactivate-form.process-response .epsilon-deactivate-form-footer {
121
- position: relative;
122
- }
123
- .epsilon-deactivate-form.process-response .epsilon-deactivate-form-body:after,
124
- .epsilon-deactivate-form.process-response .epsilon-deactivate-form-footer:after {
125
- content: "";
126
- display: block;
127
- position: absolute;
128
- top: 0;
129
- left: 0;
130
- width: 100%;
131
- height: 100%;
132
- background-color: rgba( 255, 255, 255, .5 );
133
- }
134
- </style>
135
- <script>
136
- jQuery(document).ready(function($){
137
- var deactivateURL = $("#epsilon-deactivate-link-<?php echo esc_attr( $this->plugin_name ); ?>"),
138
- formContainer = $('#epsilon-deactivate-form-<?php echo esc_attr( $this->plugin_name ); ?>'),
139
- detailsStrings = {
140
- 'no-reson' : '<?php echo __( 'How could we improve ?', 'colorlib-login-customizer' ); ?>',
141
- 'setup' : '<?php echo __( 'What was the dificult part ?', 'colorlib-login-customizer' ); ?>',
142
- 'documentation' : '<?php echo __( 'What can we describe more ?', 'colorlib-login-customizer' ); ?>',
143
- 'features' : '<?php echo __( 'How could we improve ?', 'colorlib-login-customizer' ); ?>',
144
- 'better-plugin' : '<?php echo __( 'Can you mention it ?', 'colorlib-login-customizer' ); ?>',
145
- 'incompatibility' : '<?php echo __( 'With what plugin or theme is incompatible ?', 'colorlib-login-customizer' ); ?>',
146
- };
147
-
148
- $( deactivateURL ).on("click",function(){
149
- // We'll send the user to this deactivation link when they've completed or dismissed the form
150
- var url = deactivateURL.attr( 'href' );
151
- $('body').toggleClass('epsilon-deactivate-form-active');
152
- formContainer.fadeIn( {
153
- complete: function() {
154
- var offset = formContainer.offset();
155
- if( offset.top < 50 ) {
156
- $(this).parent().css('top', (50 - offset.top) + 'px')
157
- }
158
- $( 'body' ).animate( { scrollTop: Math.max( 0, offset.top - 50 ) } );
159
- }
160
- } );
161
- formContainer.html( '<?php echo $html; ?>');
162
-
163
- formContainer.on( 'change', 'input[name="epsilon-deactivate-reason"]', function(){
164
- var detailsLabel = formContainer.find( '#epsilon-deactivate-details-label strong' );
165
- var value = formContainer.find( 'input[name="epsilon-deactivate-reason"]:checked' ).val();
166
- detailsLabel.text( detailsStrings[ value ] );
167
- });
168
-
169
- formContainer.on('click', '#epsilon-deactivate-submit-form', function(e){
170
- var data = {
171
- 'action': 'epsilon_deactivate_plugin',
172
- 'security': "<?php echo wp_create_nonce( 'epsilon_deactivate_plugin' ); ?>",
173
- 'dataType': "json"
174
- };
175
- e.preventDefault();
176
- // As soon as we click, the body of the form should disappear
177
- formContainer.addClass( 'process-response' );
178
- // Fade in spinner
179
- formContainer.find(".deactivating-spinner").fadeIn();
180
-
181
- data['reason'] = formContainer.find( 'input[name="epsilon-deactivate-reason"]:checked' ).val();
182
- data['details'] = formContainer.find('#epsilon-deactivate-details').val();
183
- data['tracking'] = formContainer.find( '#allow-tracking:checked' ).length;
184
-
185
- $.post(
186
- ajaxurl,
187
- data,
188
- function(response){
189
- // Redirect to original deactivation URL
190
- window.location.href = url;
191
- }
192
- );
193
- });
194
-
195
- formContainer.on('click', '#epsilon-deactivate-plugin', function(e){
196
- e.preventDefault();
197
- window.location.href = url;
198
- });
199
-
200
- // If we click outside the form, the form will close
201
- $('.epsilon-deactivate-form-bg').on('click',function(){
202
- formContainer.fadeOut();
203
- $('body').removeClass('epsilon-deactivate-form-active');
204
- });
205
- });
206
- });
207
- </script>
208
- <?php
209
- }
210
-
211
- /*
212
- * Form text strings
213
- * These are non-filterable and used as fallback in case filtered strings aren't set correctly
214
- * @since 1.0.0
215
- */
216
- public function get_form_info() {
217
- $form = array();
218
- $form['heading'] = __( 'Sorry to see you go', 'colorlib-login-customizer' );
219
- $form['body'] = __( 'Before you deactivate the plugin, would you quickly give us your reason for doing so?', 'colorlib-login-customizer' );
220
- $form['options'] = array(
221
- 'no-reason' => __( 'Without reason', 'colorlib-login-customizer' ),
222
- 'setup' => __( 'Set up is too difficult', 'colorlib-login-customizer' ),
223
- 'documentation' => __( 'Lack of documentation', 'colorlib-login-customizer' ),
224
- 'features' => __( 'Not the features I wanted', 'colorlib-login-customizer' ),
225
- 'better-plugin' => __( 'Found a better plugin', 'colorlib-login-customizer' ),
226
- 'incompatibility' => __( 'Incompatible with theme or plugin', 'colorlib-login-customizer' ),
227
- );
228
- $form['details'] = __( 'How could we improve ?', 'colorlib-login-customizer' );
229
- return $form;
230
- }
231
-
232
- public function epsilon_deactivate_plugin_callback() {
233
-
234
- check_ajax_referer( 'epsilon_deactivate_plugin', 'security' );
235
-
236
- if ( isset( $_POST['reason'] ) && isset( $_POST['details'] ) && isset( $_POST['tracking'] ) ) {
237
- $args = array(
238
- 'reason' => $_POST['reason'],
239
- 'details' => $_POST['details'],
240
- 'tracking' => $_POST['tracking'],
241
- );
242
- $request = new Colorlib_Login_Customizer_Plugin_Request( $this->plugin_file, $args );
243
- if ( $request->request_successful ) {
244
- echo json_encode( array(
245
- 'status' => 'ok',
246
- ) );
247
- } else {
248
- echo json_encode( array(
249
- 'status' => 'nok',
250
- ) );
251
- }
252
- } else {
253
- echo json_encode( array(
254
- 'status' => 'ok',
255
- ) );
256
- }
257
-
258
- die();
259
-
260
- }
261
-
262
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/class-colorlib-login-customizer-plugin-request.php DELETED
@@ -1,225 +0,0 @@
1
- <?php
2
-
3
- class Colorlib_Login_Customizer_Plugin_Request {
4
-
5
- /**
6
- * Url for the request
7
- *
8
- * @var string
9
- */
10
- private $url = 'https://tamewp.com/';
11
- /**
12
- * Api endpoint
13
- *
14
- * @var string
15
- */
16
- private $endpoint = 'wp-json/epsilon/v1/add-tracking-data';
17
- /**
18
- * Private data
19
- *
20
- * @var array
21
- */
22
- private $data = array(
23
- 'server' => array(),
24
- 'user' => array(),
25
- 'wordpress' => array(
26
- 'deactivated_plugin' => array(),
27
- ),
28
- );
29
- /**
30
- * Plugin file
31
- *
32
- * @var string
33
- */
34
- private $plugin_file = '';
35
-
36
- private $allow_tracking = 0;
37
-
38
- public $request_successful = false;
39
-
40
- function __construct( $_plugin_file, $args ) {
41
-
42
- // Set variables
43
- $this->allow_tracking = $args['tracking'];
44
- $this->plugin_file = $_plugin_file;
45
- $this->data['unique'] = md5( home_url() . get_bloginfo( 'admin_email' ) );
46
- $this->data['wordpress']['deactivated_plugin']['uninstall_reason'] = $args['reason'];
47
- $this->data['wordpress']['deactivated_plugin']['uninstall_details'] = $args['details'];
48
-
49
- // Start collecting data
50
- $this->_collect_data();
51
- $this->_generate_url();
52
- $this->request_successful = $this->_send_request();
53
- }
54
-
55
- /**
56
- * Collect all data for the request.
57
- *
58
- */
59
- private function _collect_data() {
60
-
61
- $current_plugin = get_plugin_data( $this->plugin_file );
62
-
63
- // Plugin data
64
- $this->data['wordpress']['deactivated_plugin']['slug'] = $current_plugin['TextDomain'];
65
- $this->data['wordpress']['deactivated_plugin']['name'] = $current_plugin['Name'];
66
- $this->data['wordpress']['deactivated_plugin']['version'] = $current_plugin['Version'];
67
- $this->data['wordpress']['deactivated_plugin']['author'] = $current_plugin['AuthorName'];
68
-
69
- if ( $this->allow_tracking ) {
70
- $this->_collect_wordpress_data();
71
- $this->_collect_server_data();
72
- $this->_collect_user_data();
73
- }
74
-
75
- }
76
-
77
- /**
78
- * Collect WordPress data.
79
- *
80
- */
81
- private function _collect_wordpress_data() {
82
- $this->data['wordpress']['locale'] = ( get_bloginfo( 'version' ) >= 4.7 ) ? get_user_locale() : get_locale();
83
- $this->data['wordpress']['wp_version'] = get_bloginfo( 'version' );
84
- $this->data['wordpress']['multisite'] = is_multisite();
85
-
86
- $this->data['wordpress']['themes'] = $this->get_themes();
87
- $this->data['wordpress']['plugins'] = $this->get_plugins();
88
- }
89
-
90
- /**
91
- * Collect server data.
92
- *
93
- */
94
- private function _collect_server_data() {
95
- $this->data['server']['server'] = isset( $_SERVER['SERVER_SOFTWARE'] ) ? $_SERVER['SERVER_SOFTWARE'] : '';
96
- $this->data['server']['php_version'] = phpversion();
97
- $this->data['server']['url'] = home_url();
98
- }
99
-
100
- /**
101
- * Collect user data.
102
- *
103
- */
104
- private function _collect_user_data() {
105
- $admin = get_user_by( 'email', get_bloginfo( 'admin_email' ) );
106
- if ( ! $admin ) {
107
- $this->data['user']['email'] = '';
108
- $this->data['user']['first_name'] = '';
109
- $this->data['user']['last_name'] = '';
110
- } else {
111
- $this->data['user']['email'] = get_bloginfo( 'admin_email' );
112
- $this->data['user']['first_name'] = $admin->first_name;
113
- $this->data['user']['last_name'] = $admin->last_name;
114
- }
115
- }
116
-
117
- /**
118
- * Get current themes
119
- *
120
- * @return array
121
- */
122
- private function get_themes() {
123
- $theme = wp_get_theme();
124
-
125
- return array(
126
- 'installed' => $this->_get_installed_themes(),
127
- 'active' => array(
128
- 'slug' => get_stylesheet(),
129
- 'name' => $theme->get( 'Name' ),
130
- 'version' => $theme->get( 'Version' ),
131
- 'author' => $theme->get( 'Author' ),
132
- ),
133
- );
134
- }
135
-
136
- /**
137
- * Get an array of installed themes
138
- */
139
- private function _get_installed_themes() {
140
- $installed = wp_get_themes();
141
- $theme = get_stylesheet();
142
- $arr = array();
143
-
144
- foreach ( $installed as $slug => $info ) {
145
- if ( $slug === $theme ) {
146
- continue;
147
- }
148
- $arr[ $slug ] = array(
149
- 'slug' => $slug,
150
- 'name' => $info->get( 'Name' ),
151
- 'version' => $info->get( 'Version' ),
152
- 'author' => $info->get( 'Author' ),
153
- );
154
- };
155
-
156
- return $arr;
157
- }
158
-
159
- /**
160
- * Get a list of installed plugins
161
- */
162
- private function get_plugins() {
163
- if ( ! function_exists( 'get_plugins' ) ) {
164
- include ABSPATH . '/wp-admin/includes/plugin.php';
165
- }
166
-
167
- $plugins = get_plugins();
168
- $option = get_option( 'active_plugins', array() );
169
- $active = array();
170
- $installed = array();
171
- foreach ( $plugins as $id => $info ) {
172
- if ( in_array( $id, $active ) ) {
173
- continue;
174
- }
175
-
176
- $id = explode( '/', $id );
177
- $id = ucwords( str_replace( '-', ' ', $id[0] ) );
178
-
179
- $installed[] = $id;
180
- }
181
-
182
- foreach ( $option as $id ) {
183
- $id = explode( '/', $id );
184
- $id = ucwords( str_replace( '-', ' ', $id[0] ) );
185
-
186
- $active[] = $id;
187
- }
188
-
189
- return array(
190
- 'installed' => $installed,
191
- 'active' => $active,
192
- );
193
- }
194
-
195
- /**
196
- * Generate the url
197
- */
198
- protected function _generate_url() {
199
- $this->url = $this->url . $this->endpoint;
200
- }
201
-
202
- /**
203
- * Send dat to server.
204
- *
205
- */
206
- private function _send_request() {
207
-
208
- $request = wp_remote_post( $this->url, array(
209
- 'method' => 'POST',
210
- 'timeout' => 20,
211
- 'redirection' => 5,
212
- 'httpversion' => '1.1',
213
- 'blocking' => true,
214
- 'body' => $this->data,
215
- 'user-agent' => 'MT/EPSILON-CUSTOMER-TRACKING/' . esc_url( home_url() ),
216
- ) );
217
-
218
- if ( is_wp_error( $request ) ) {
219
- return false;
220
- }
221
-
222
- return true;
223
-
224
- }
225
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/class-colorlib-login-customizer-review.php ADDED
@@ -0,0 +1,182 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class CLC_Review {
4
+
5
+ private static $instance;
6
+ private $when = array( 5, 15, 30 );
7
+ private $value;
8
+ private $messages;
9
+ private $link = 'https://wordpress.org/support/plugin/%s/reviews/#new-post';
10
+ private $slug = '';
11
+ private $option_name = '';
12
+
13
+ function __construct( $args ) {
14
+
15
+ if ( isset( $args['slug'] ) ) {
16
+ $this->slug = $args['slug'];
17
+ }
18
+
19
+ $this->value = $this->value();
20
+
21
+ $this->messages = array(
22
+ 'notice' => __( "Hey, I noticed you have installed our plugin for %s day(s) - that's awesome! Could you please do me a BIG favor and give it a 5-star rating on WordPress? Just to help us spread the word and boost our motivation.", 'colorlib-login-customizer' ),
23
+ 'rate' => __( 'Ok, you deserve it', 'colorlib-login-customizer' ),
24
+ 'rated' => __( 'I already did', 'colorlib-login-customizer' ),
25
+ 'no_rate' => __( 'No, not good enough', 'colorlib-login-customizer' ),
26
+ );
27
+
28
+ if ( isset( $args['messages'] ) ) {
29
+ $this->messages = wp_parse_args( $args['messages'], $this->messages );
30
+ }
31
+
32
+ $this->init();
33
+
34
+ }
35
+
36
+ public static function get_instance( $args ) {
37
+ if ( null === static::$instance ) {
38
+ static::$instance = new static( $args );
39
+ }
40
+
41
+ return static::$instance;
42
+ }
43
+
44
+ private function init() {
45
+ if ( ! is_admin() ) {
46
+ return;
47
+ }
48
+
49
+ add_action( 'wp_ajax_epsilon_review', array( $this, 'ajax' ) );
50
+
51
+ if ( $this->check() ) {
52
+ add_action( 'admin_notices', array( $this, 'five_star_wp_rate_notice' ) );
53
+ add_action( 'admin_enqueue_scripts', array( $this, 'enqueue' ) );
54
+ add_action( 'admin_print_footer_scripts', array( $this, 'ajax_script' ) );
55
+ }
56
+
57
+ }
58
+
59
+ private function check() {
60
+
61
+ $options = get_option( 'clc-options' );
62
+ $option = isset( $options['givemereview'] ) ? $options['givemereview'] : '';
63
+ $currDate = date( 'Y-m-d' );
64
+ if ( 'already-rated' == $option ) {
65
+ return false;
66
+ }
67
+
68
+ if ( $this->value == $option ) {
69
+ return false;
70
+ }
71
+
72
+ if ( is_array( $this->when ) ) {
73
+ foreach ( $this->when as $et ) {
74
+ if ( date( 'Y-m-d', strtotime( $currDate . ' +' . $et . ' days' ) ) == $this->value ) {
75
+ return true;
76
+ }
77
+
78
+ }
79
+ }
80
+
81
+ }
82
+
83
+ private function value() {
84
+
85
+ $value = get_transient( 'clc_review' );
86
+
87
+ if ( $value ) {
88
+ $current_time = time(); // or your date as well
89
+ $trans_date = strtotime($value);
90
+ $date_diff = $current_time - $trans_date;
91
+ return round($date_diff / (60 * 60 * 24));
92
+ }
93
+
94
+ $date = date( 'Y-m-d' );
95
+ set_transient( 'clc_review', $date, 24 * 30 * HOUR_IN_SECONDS );
96
+
97
+ }
98
+
99
+ public function five_star_wp_rate_notice() {
100
+
101
+ $url = sprintf( $this->link, $this->slug );
102
+
103
+ ?>
104
+ <div id="<?php echo $this->slug ?>-epsilon-review-notice" class="notice notice-success is-dismissible">
105
+ <p><?php echo sprintf( wp_kses_post( $this->messages['notice'] ), $this->value ); ?></p>
106
+ <p class="actions">
107
+ <a id="epsilon-rate" href="<?php echo esc_url( $url ) ?>"
108
+ class="button button-primary epsilon-review-button"><?php echo esc_html( $this->messages['rate'] ); ?></a>
109
+ <a id="epsilon-rated" href="#"
110
+ class="button button-secondary epsilon-review-button"><?php echo esc_html( $this->messages['rated'] ); ?></a>
111
+ <a id="epsilon-no-rate" href="#"
112
+ class="button button-secondary epsilon-review-button"><?php echo esc_html( $this->messages['no_rate'] ); ?></a>
113
+ </p>
114
+ </div>
115
+ <?php
116
+ }
117
+
118
+ public function ajax() {
119
+
120
+ check_ajax_referer( 'epsilon-review', 'security' );
121
+
122
+ $options = get_option( 'clc-options', array() );
123
+
124
+ if ( isset( $_POST['epsilon-review'] ) ) {
125
+ $options['givemereview'] = 'already-rated';
126
+ } else {
127
+ $options['givemereview'] = $this->value;
128
+ }
129
+
130
+ update_option( 'clc-options', $options );
131
+
132
+ wp_die( 'ok' );
133
+
134
+ }
135
+
136
+ public function enqueue() {
137
+ wp_enqueue_script( 'jquery' );
138
+ }
139
+
140
+ public function ajax_script() {
141
+
142
+ $ajax_nonce = wp_create_nonce( "epsilon-review" );
143
+
144
+ ?>
145
+
146
+ <script type="text/javascript">
147
+ jQuery(document).ready(function ($) {
148
+
149
+ $('.epsilon-review-button').click(function (evt) {
150
+ var href = $(this).attr('href'),
151
+ id = $(this).attr('id');
152
+
153
+ evt.preventDefault();
154
+
155
+ var data = {
156
+ action: 'epsilon_review',
157
+ security: '<?php echo $ajax_nonce; ?>',
158
+ };
159
+
160
+ if ('epsilon-rated' === id) {
161
+ data['epsilon-review'] = 1;
162
+ }
163
+
164
+ $.post('<?php echo admin_url( 'admin-ajax.php' ) ?>', data, function (response) {
165
+ $('#<?php echo $this->slug ?>-epsilon-review-notice').slideUp('fast', function () {
166
+ $(this).remove();
167
+ });
168
+
169
+ if ('epsilon-rate' === id) {
170
+ window.location.href = href;
171
+ }
172
+
173
+ });
174
+
175
+ });
176
+
177
+ });
178
+ </script>
179
+
180
+ <?php
181
+ }
182
+ }
includes/class-colorlib-login-customizer.php CHANGED
@@ -108,11 +108,6 @@ class Colorlib_Login_Customizer {
108
  // Remove this after Grunt
109
  $this->script_suffix = '';
110
 
111
- if ( is_admin() ) {
112
- // Plugin Deactivate Feedback
113
- new Colorlib_Login_Customizer_Feedback( $file );
114
- }
115
-
116
  register_activation_hook( $this->file, array( $this, 'install' ) );
117
 
118
  add_action( 'admin_init', array( $this, 'redirect_customizer' ) );
@@ -271,4 +266,103 @@ class Colorlib_Login_Customizer {
271
 
272
  return $template;
273
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
274
  }
108
  // Remove this after Grunt
109
  $this->script_suffix = '';
110
 
 
 
 
 
 
111
  register_activation_hook( $this->file, array( $this, 'install' ) );
112
 
113
  add_action( 'admin_init', array( $this, 'redirect_customizer' ) );
266
 
267
  return $template;
268
  }
269
+
270
+ public function get_defaults(){
271
+ return array(
272
+ /**
273
+ * Templates
274
+ */
275
+ 'templates' => 'default',
276
+ /**
277
+ * Layout
278
+ */
279
+ 'columns' => '1',
280
+ 'columns-width' => array(
281
+ 'left' => 6,
282
+ 'right' => 6,
283
+ ),
284
+ 'form-column-align' => '3',
285
+ 'form-vertical-align' => '2',
286
+ /**
287
+ * Logo section
288
+ */
289
+ 'hide-logo' => 0,
290
+ 'use-text-logo' => 0,
291
+ 'logo-url' => site_url(),
292
+ 'custom-logo' => '',
293
+ 'logo-text-color' => '#444',
294
+ 'logo-text-size' => '20',
295
+ 'logo-text-color-hover' => '#00a0d2',
296
+ 'logo-width' => '',
297
+ 'logo-height' => '',
298
+ /**
299
+ * Background section
300
+ */
301
+ 'custom-background' => '',
302
+ 'custom-background-form' => '',
303
+ 'custom-background-color' => '',
304
+ 'custom-background-color-form' => '',
305
+ /**
306
+ * Form section
307
+ */
308
+ 'form-width' => '',
309
+ 'form-height' => '',
310
+ 'form-background-image' => '',
311
+ 'form-background-color' => '#fff',
312
+ 'form-padding' => '',
313
+ 'form-border' => '',
314
+ 'form-border-radius' => '',
315
+ 'form-shadow' => '',
316
+ 'form-field-width' => '',
317
+ 'form-field-margin' => '',
318
+ 'form-field-border-radius' => 'unset',
319
+ 'form-field-border' => '1px solid #ddd',
320
+ 'form-field-background' => '',
321
+ 'form-field-color' => '',
322
+ 'username-label' => 'Username or Email Address',
323
+ 'password-label' => 'Password',
324
+ 'rememberme-label' => 'Remember Me',
325
+ 'lost-password-text' => 'Lost your password?',
326
+ 'back-to-text' => '&larr; Back to %s',
327
+ 'register-link-label' => 'Register',
328
+
329
+ 'login-label' => 'Log In',
330
+ 'form-label-color' => '',
331
+ 'hide-extra-links' => false,
332
+ /**
333
+ * Registration section
334
+ */
335
+ 'register-username-label' => 'Username',
336
+ 'register-email-label' => 'Email',
337
+ 'register-button-label' => 'Register',
338
+ 'register-confirmation-email' => 'Registration confirmation will be emailed to you.',
339
+ 'login-link-label' => 'Log in',
340
+ /**
341
+ * Lost Password
342
+ */
343
+ 'lostpassword-username-label' => 'Username or Email Address',
344
+ 'lostpassword-button-label' => 'Get New Password',
345
+ /**
346
+ * Others section ( misc )
347
+ */
348
+ 'button-background' => '',
349
+ 'button-background-hover' => '',
350
+ 'button-border-color' => '',
351
+ 'button-border-color-hover' => '',
352
+ 'button-shadow' => '',
353
+ 'button-text-shadow' => '',
354
+ 'button-color' => '',
355
+ 'link-color' => '',
356
+ 'link-color-hover' => '',
357
+ 'hide-rememberme' => false,
358
+ /**
359
+ * Custom CSS
360
+ */
361
+ 'custom-css' => '',
362
+ /**
363
+ * Reset value is not dynamic
364
+ */
365
+ 'initial' => 'initial',
366
+ );
367
+ }
368
  }
includes/lib/class-colorlib-login-customizer-css-customization.php CHANGED
@@ -1,817 +1,1074 @@
1
- <?php
2
- if ( ! defined( 'ABSPATH' ) ) {
3
- exit;
4
- }
5
-
6
- /**
7
- * Class Colorlib_Login_Customizer_Customization
8
- */
9
- class Colorlib_Login_Customizer_CSS_Customization {
10
- /**
11
- * @var array
12
- */
13
- private $options = array();
14
- /**
15
- * @var array
16
- */
17
- private $selectors = array();
18
- /**
19
- * @var string
20
- */
21
- private $base = '';
22
-
23
- /**
24
- * Colorlib_Login_Customizer_CSS_Customization constructor.
25
- */
26
- public function __construct() {
27
- $plugin = Colorlib_Login_Customizer::instance();
28
- $this->key_name = $plugin->key_name;
29
- $this->set_options();
30
-
31
- add_action( 'login_head', array( $this, 'check_labels' ) );
32
- add_action( 'login_header', array( $this, 'add_extra_div' ) );
33
- add_action( 'login_head', array( $this, 'generate_css' ), 15 );
34
- add_action( 'login_footer', array( $this, 'close_extra_div' ) );
35
-
36
- add_filter( 'login_body_class', array( $this, 'body_class' ) );
37
- add_filter( 'login_headerurl', array( $this, 'logo_url' ), 99 );
38
- add_filter( 'login_headertitle', array( $this, 'logo_text' ), 99 );
39
-
40
- //
41
- add_action( 'customize_preview_init', array( $this, 'output_css_object' ), 26 );
42
- }
43
-
44
- private function generate_name( $id ) {
45
- return $this->key_name . '[' . $id . ']';
46
- }
47
-
48
- public function output_css_object() {
49
-
50
- $css_object = array(
51
- 'selectors' => array(),
52
- 'settings' => array(),
53
- );
54
-
55
- foreach ( $this->selectors as $selector => $settings ) {
56
- $css_object['selectors'][ $selector ] = $settings['options'];
57
- foreach ( $settings['options'] as $index => $setting ) {
58
- $css_object['settings'][ $setting ] = array(
59
- 'name' => $this->generate_name( $setting ),
60
- 'value' => $this->options[ $setting ],
61
- 'attribute' => $settings['attributes'][ $index ],
62
- );
63
- }
64
- }
65
-
66
- wp_localize_script( 'colorlib-login-customizer-preview', 'CLC', $css_object );
67
-
68
- }
69
-
70
- /**
71
- * Set the options array, it returns nothing
72
- */
73
- public function set_options() {
74
-
75
- $options = get_option( $this->key_name, array() );
76
-
77
- $defaults = array(
78
- /**
79
- * Templates
80
- */
81
- 'templates' => 'default',
82
- /**
83
- * Layout
84
- */
85
- 'columns' => '1',
86
- 'columns-width' => array(
87
- 'left' => 6,
88
- 'right' => 6,
89
- ),
90
- 'form-column-align' => '3',
91
- 'form-vertical-align' => '2',
92
- /**
93
- * Logo section
94
- */
95
- 'hide-logo' => 0,
96
- 'use-text-logo' => 0,
97
- 'custom-logo-url' => '',
98
- 'custom-logo' => '',
99
- 'logo-text-color' => '#444',
100
- 'logo-text-size' => '20',
101
- 'logo-text-color-hover' => '#00a0d2',
102
- 'logo-width' => '',
103
- 'logo-height' => '',
104
- /**
105
- * Background section
106
- */
107
- 'custom-background' => '',
108
- 'custom-background-form' => '',
109
- 'custom-background-color' => '',
110
- 'custom-background-color-form' => '',
111
- /**
112
- * Form section
113
- */
114
- 'form-width' => '',
115
- 'form-height' => '',
116
- 'form-background-image' => '',
117
- 'form-background-color' => '#fff',
118
- 'form-padding' => '',
119
- 'form-border' => '',
120
- 'form-border-radius' => '',
121
- 'form-shadow' => '',
122
- 'form-field-width' => '',
123
- 'form-field-margin' => '',
124
- 'form-field-border-radius' => 'unset',
125
- 'form-field-border' => '1px solid #ddd',
126
- 'form-field-background' => '',
127
- 'form-field-color' => '',
128
- 'username-label' => 'Username or Email Address',
129
- 'password-label' => 'Password',
130
- 'form-label-color' => '',
131
- 'hide-extra-links' => false,
132
- /**
133
- * Others section ( misc )
134
- */
135
- 'button-background' => '',
136
- 'button-background-hover' => '',
137
- 'button-border-color' => '',
138
- 'button-border-color-hover' => '',
139
- 'button-shadow' => '',
140
- 'button-text-shadow' => '',
141
- 'button-color' => '',
142
- 'link-color' => '',
143
- 'link-color-hover' => '',
144
- 'hide-rememberme' => false,
145
- /**
146
- * Reset value is not dynamic
147
- */
148
- 'initial' => 'initial',
149
- );
150
-
151
- $this->options = wp_parse_args( $options, $defaults );
152
-
153
- $this->selectors = array(
154
- '.wp-core-ui .button-primary.focus, .wp-core-ui .button-primary.hover, .wp-core-ui .button-primary:focus, .wp-core-ui .button-primary:hover' => array(
155
- 'attributes' => array(
156
- 'background',
157
- 'border-color',
158
- ),
159
- 'options' => array(
160
- 'button-background-hover',
161
- 'button-border-color-hover',
162
- ),
163
- ),
164
- '.wp-core-ui .button-primary' => array(
165
- 'attributes' => array(
166
- 'background',
167
- 'border-color',
168
- 'box-shadow',
169
- 'text-shadow',
170
- 'color',
171
- ),
172
- 'options' => array(
173
- 'button-background',
174
- 'button-border-color',
175
- 'button-shadow',
176
- 'button-text-shadow',
177
- 'button-color',
178
- ),
179
- ),
180
- '.login #backtoblog a, .login #nav a' => array(
181
- 'attributes' => array(
182
- 'color',
183
- ),
184
- 'options' => array(
185
- 'link-color',
186
- ),
187
- ),
188
- '.login #backtoblog a:hover, .login #nav a:hover, .login h1 a:hover' => array(
189
- 'attributes' => array(
190
- 'color',
191
- ),
192
- 'options' => array(
193
- 'link-color-hover',
194
- ),
195
- ),
196
- '.ml-container #login' => array(
197
- 'attributes' => array(
198
- 'max-width',
199
- ),
200
- 'options' => array(
201
- 'form-width',
202
- ),
203
- ),
204
- '#loginform' => array(
205
- 'attributes' => array(
206
- 'height',
207
- 'background-image',
208
- 'background-color',
209
- 'padding',
210
- 'border',
211
- 'border-radius',
212
- 'box-shadow',
213
- ),
214
- 'options' => array(
215
- 'form-height',
216
- 'form-background-image',
217
- 'form-background-color',
218
- 'form-padding',
219
- 'form-border',
220
- 'form-border-radius',
221
- 'form-shadow',
222
- ),
223
- ),
224
- '.login form .input, .login input[type="text"]' => array(
225
- 'attributes' => array(
226
- 'max-width',
227
- 'margin',
228
- 'border-radius',
229
- 'border',
230
- 'background',
231
- 'color',
232
- ),
233
- 'options' => array(
234
- 'form-field-width',
235
- 'form-field-margin',
236
- 'form-field-border-radius',
237
- 'form-field-border',
238
- 'form-field-background',
239
- 'form-field-color',
240
- ),
241
- ),
242
- '.login label' => array(
243
- 'attributes' => array(
244
- 'color',
245
- ),
246
- 'options' => array(
247
- 'form-label-color',
248
- ),
249
- ),
250
- '.ml-container .ml-extra-div' => array(
251
- 'attributes' => array(
252
- 'background-image',
253
- 'background-color',
254
- ),
255
- 'options' => array(
256
- 'custom-background',
257
- 'custom-background-color',
258
- ),
259
- ),
260
- '.ml-container .ml-form-container' => array(
261
- 'attributes' => array(
262
- 'background-image',
263
- 'background-color',
264
- ),
265
- 'options' => array(
266
- 'custom-background-form',
267
- 'custom-background-color-form',
268
- )
269
- ),
270
- '.login h1 a' => array(
271
- 'attributes' => array(
272
- 'background-image',
273
- 'width',
274
- 'height',
275
- ),
276
- 'options' => array(
277
- 'custom-logo',
278
- 'logo-width',
279
- 'logo-height',
280
- ),
281
- ),
282
- '.login.clc-text-logo h1 a' => array(
283
- 'attributes' => array(
284
- 'color',
285
- 'font-size',
286
- ),
287
- 'options' => array(
288
- 'logo-text-color',
289
- 'logo-text-size',
290
- ),
291
- ),
292
- '.login.clc-text-logo h1 a:hover' => array(
293
- 'attributes' => array(
294
- 'color',
295
- ),
296
- 'options' => array(
297
- 'logo-text-color-hover',
298
- ),
299
- ),
300
- '#login > h1' => array(
301
- 'attributes' => array(
302
- 'display',
303
- ),
304
- 'options' => array(
305
- 'hide-logo',
306
- ),
307
- ),
308
- '#login > #nav,#login > #backtoblog' => array(
309
- 'attributes' => array(
310
- 'display',
311
- ),
312
- 'options' => array(
313
- 'hide-extra-links',
314
- ),
315
- ),
316
- '#login form .forgetmenot' => array(
317
- 'attributes' => array(
318
- 'display',
319
- ),
320
- 'options' => array(
321
- 'hide-rememberme',
322
- ),
323
- ),
324
- );
325
-
326
- }
327
-
328
- /**
329
- * Create the CSS string for output
330
- *
331
- * @return mixed|string
332
- */
333
- public function create_css() {
334
- /**
335
- * Get an instance of the plugin so we can get the token
336
- */
337
- //$instance = Colorlib_Login_Customizer::instance();
338
-
339
- $string = '';
340
- /**
341
- * In case the array is empty, we return an empty string
342
- */
343
- if ( empty( $this->options ) ) {
344
- return $string;
345
- }
346
-
347
- /**
348
- * Start building the CSS file
349
- */
350
- $string .= $this->_set_background_options();
351
- $string .= $this->_set_logo_options();
352
- $string .= $this->_set_form_options();
353
- $string .= $this->_set_miscellaneous_options();
354
-
355
- return $string;
356
- }
357
-
358
- /**
359
- * @return string
360
- */
361
- public function _set_miscellaneous_options() {
362
- $string = '';
363
-
364
- $string .= $this->create_css_lines(
365
- '.wp-core-ui .button-primary.focus, .wp-core-ui .button-primary.hover, .wp-core-ui .button-primary:focus, .wp-core-ui .button-primary:hover',
366
- array(
367
- 'background',
368
- 'border-color',
369
- ),
370
- array(
371
- 'button-background-hover',
372
- 'button-border-color-hover',
373
- )
374
- );
375
-
376
- $string .= $this->create_css_lines(
377
- '.wp-core-ui .button-primary',
378
- array(
379
- 'background',
380
- 'border-color',
381
- 'box-shadow',
382
- 'text-shadow',
383
- 'color',
384
- ),
385
- array(
386
- 'button-background',
387
- 'button-border-color',
388
- 'button-shadow',
389
- 'button-text-shadow',
390
- 'button-color',
391
- )
392
- );
393
-
394
- $string .= $this->create_css_lines(
395
- '.login #backtoblog a, .login #nav a',
396
- array(
397
- 'color',
398
- ),
399
- array(
400
- 'link-color',
401
- )
402
- );
403
-
404
- $string .= $this->create_css_lines(
405
- '.login #backtoblog a:hover, .login #nav a:hover, .login h1 a:hover',
406
- array(
407
- 'color',
408
- ),
409
- array(
410
- 'link-color-hover',
411
- )
412
- );
413
-
414
- $string .= $this->create_css_lines(
415
- '#login form .forgetmenot',
416
- array(
417
- 'display',
418
- ),
419
- array(
420
- 'hide-rememberme',
421
- )
422
- );
423
-
424
- return $string;
425
- }
426
-
427
- /**
428
- * @return string
429
- */
430
- public function _set_form_options() {
431
- $string = '';
432
-
433
- $string .= $this->create_css_lines(
434
- '.ml-container #login',
435
- array(
436
- 'max-width',
437
- ),
438
- array(
439
- 'form-width',
440
- )
441
- );
442
-
443
- /**
444
- * Set form variables
445
- */
446
- $string .= $this->create_css_lines(
447
- '#loginform',
448
- array(
449
- 'height',
450
- 'background-image',
451
- 'background-color',
452
- 'padding',
453
- 'border',
454
- 'border-radius',
455
- 'box-shadow',
456
- ),
457
- array(
458
- 'form-height',
459
- 'form-background-image',
460
- 'form-background-color',
461
- 'form-padding',
462
- 'form-border',
463
- 'form-border-radius',
464
- 'form-shadow',
465
- )
466
- );
467
-
468
- /**
469
- * Set form field variables
470
- */
471
- $string .= $this->create_css_lines(
472
- '.login form .input, .login input[type="text"]',
473
- array(
474
- 'max-width',
475
- 'margin',
476
- 'border-radius',
477
- 'border',
478
- 'background',
479
- 'color',
480
- ),
481
- array(
482
- 'form-field-width',
483
- 'form-field-margin',
484
- 'form-field-border-radius',
485
- 'form-field-border',
486
- 'form-field-background',
487
- 'form-field-color',
488
- )
489
- );
490
-
491
- /**
492
- * Set form field labels
493
- */
494
- $string .= $this->create_css_lines(
495
- '.login label',
496
- array(
497
- 'color',
498
- ),
499
- array(
500
- 'form-label-color',
501
- )
502
- );
503
-
504
- $string .= $this->create_css_lines(
505
- '#login > #nav,#login > #backtoblog',
506
- array(
507
- 'display',
508
- ),
509
- array(
510
- 'hide-extra-links',
511
- )
512
- );
513
-
514
- return $string;
515
- }
516
-
517
- /**
518
- * @return string
519
- */
520
- public function _set_background_options() {
521
- $string = '';
522
- /**
523
- * Set background-image
524
- */
525
- $string .= $this->create_css_lines(
526
- '.ml-container .ml-extra-div',
527
- array(
528
- 'background-image',
529
- 'background-color',
530
- ),
531
- array(
532
- 'custom-background',
533
- 'custom-background-color',
534
- )
535
- );
536
-
537
- $string .= $this->create_css_lines(
538
- '.ml-container .ml-form-container',
539
- array(
540
- 'background-image',
541
- 'background-color',
542
- ),
543
- array(
544
- 'custom-background-form',
545
- 'custom-background-color-form',
546
- )
547
- );
548
-
549
- return $string;
550
-
551
- }
552
-
553
- /**
554
- * @return string
555
- */
556
- public function _set_logo_options() {
557
- $string = '';
558
- /**
559
- * Set logo dimensions
560
- */
561
- $string .= $this->create_css_lines(
562
- '.login h1 a',
563
- array(
564
- 'background-image',
565
- 'background-size',
566
- 'width',
567
- 'height',
568
- ),
569
- array(
570
- 'custom-logo',
571
- 'logo-width',
572
- 'logo-width',
573
- 'logo-height',
574
- )
575
- );
576
-
577
- $string .= $this->create_css_lines(
578
- '.login.clc-text-logo h1 a',
579
- array(
580
- 'color',
581
- 'font-size',
582
- ),
583
- array(
584
- 'logo-text-color',
585
- 'logo-text-size',
586
- )
587
- );
588
-
589
- $string .= $this->create_css_lines(
590
- '.login.clc-text-logo h1 a:hover',
591
- array(
592
- 'color',
593
- ),
594
- array(
595
- 'logo-text-color-hover',
596
- )
597
- );
598
-
599
- $string .= $this->create_css_lines(
600
- '#login > h1',
601
- array(
602
- 'display',
603
- ),
604
- array(
605
- 'hide-logo',
606
- )
607
- );
608
-
609
- return $string;
610
- }
611
-
612
- /**
613
- * @param $selector
614
- * @param $properties
615
- * @param $options
616
- *
617
- * @return string
618
- */
619
- private function create_css_lines( $selector, $properties, $options ) {
620
- $string = '';
621
- $valued = array();
622
-
623
- $i = 0;
624
- foreach ( $options as $option ) {
625
- if ( ! empty( $this->options[ $option ] ) ) {
626
- $valued[ $properties[ $i ] ] = $this->options[ $option ];
627
- }
628
- $i ++;
629
- }
630
-
631
- if ( ! empty( $valued ) ) {
632
- $string .= $selector . '{' . "\n";
633
-
634
- foreach ( $valued as $index => $value ) {
635
- $string .= $index . ':' . esc_attr( $this->add_artifacts( $index, $value ) ) . ';' . "\n";
636
- }
637
- $string .= '}' . "\n";
638
- }
639
-
640
- return $string;
641
- }
642
-
643
- /**
644
- *
645
- *
646
- * @param $property
647
- * @param $value
648
- *
649
- * @return string
650
- */
651
- private function add_artifacts( $property, $value ) {
652
- switch ( $property ) {
653
- case 'background-image':
654
- $value = 'url(' . $value . ')';
655
- break;
656
-
657
- case 'width':
658
- case 'min-width':
659
- case 'max-width':
660
- case 'background-size':
661
- case 'height':
662
- case 'min-height':
663
- case 'max-height':
664
- case 'font-size':
665
- $value = $value . 'px';
666
- break;
667
- case 'display':
668
- if ( ! $value ) {
669
- $value = 'block';
670
- }else{
671
- $value = 'none';
672
- }
673
- default:
674
- break;
675
- }
676
-
677
- return $value;
678
- }
679
-
680
- public function body_class( $classes ) {
681
-
682
- if ( '2' == $this->options['columns'] ) {
683
- $classes[] = 'ml-half-screen';
684
- if ( isset( $this->options['form-column-align'] ) ) {
685
- $classes[] = 'ml-login-align-' . esc_attr( $this->options['form-column-align'] );
686
- }
687
- }
688
-
689
- if ( isset( $this->options['form-vertical-align'] ) ) {
690
- $classes[] = 'ml-login-vertical-align-' . esc_attr( $this->options['form-vertical-align'] );
691
- }
692
-
693
- if ( isset( $this->options['form-horizontal-align'] ) ) {
694
- $classes[] = 'ml-login-horizontal-align-' . esc_attr( $this->options['form-horizontal-align'] );
695
- }
696
-
697
- if ( isset( $this->options['use-text-logo'] ) && $this->options['use-text-logo'] ) {
698
- $classes[] = 'clc-text-logo';
699
- }
700
-
701
- return $classes;
702
- }
703
-
704
- public function logo_url( $url ) {
705
- if ( '' != $this->options['custom-logo-url'] ) {
706
- return esc_url( $this->options['custom-logo-url'] );
707
- }
708
-
709
- return $url;
710
- }
711
-
712
- public function logo_text( $text ) {
713
- if ( isset( $this->options['use-text-logo'] ) && $this->options['use-text-logo'] ) {
714
- return wp_kses_post( $this->options['logo-text'] );
715
- }
716
-
717
- return $text;
718
- }
719
-
720
- /**
721
- * Output the inline CSS
722
- */
723
- public function generate_css() {
724
- $instance = Colorlib_Login_Customizer::instance();
725
- $css = $this->create_css();
726
- $custom_css = $this->options['custom-css'];
727
- $columns_css = '';
728
-
729
- if ( 2 == $this->options['columns'] ) {
730
- $widths = $this->options['columns-width'];
731
-
732
- $left_width = ( 100 / 12 )*absint( $widths['left'] );
733
- $right_width = ( 100 / 12 )*absint( $widths['right'] );
734
-
735
- $columns_css .= '.ml-half-screen.ml-login-align-3 .ml-container .ml-extra-div,.ml-half-screen.ml-login-align-1 .ml-container .ml-form-container{ width:' . $left_width . '%; }';
736
- $columns_css .= '.ml-half-screen.ml-login-align-4 .ml-container .ml-extra-div,.ml-half-screen.ml-login-align-2 .ml-container .ml-form-container{ flex-basis:' . $left_width . '%; }';
737
-
738
- $columns_css .= '.ml-half-screen.ml-login-align-3 .ml-container .ml-form-container,.ml-half-screen.ml-login-align-1 .ml-container .ml-extra-div{ width:' . $right_width . '%; }';
739
- $columns_css .= '.ml-half-screen.ml-login-align-4 .ml-container .ml-form-container,.ml-half-screen.ml-login-align-2 .ml-container .ml-extra-div{ flex-basis:' . $right_width . '%; }';
740
-
741
- }
742
-
743
- echo '<style type="text/css">.login.clc-text-logo h1 a{ background-image: none !important;text-indent: unset; }#login form p label br{display:none}body:not( .ml-half-screen ) .ml-form-container{background:transparent !important;}.login h1 a{background-position: center;background-size:contain !important;}.ml-container #login{ position:relative;padding: 0;width:100%;max-width:320px;margin:0;}#loginform{box-sizing: border-box;max-height: 100%;background-position: center;background-repeat: no-repeat;background-size: cover;}.ml-container{position:relative;min-height:100vh;display:flex;height:100%;min-width:100%;}.ml-container .ml-extra-div{background-position:center;background-size:cover;background-repeat:no-repeat}body .ml-form-container{display:flex;align-items:center;justify-content:center}body:not( .ml-half-screen ) .ml-container .ml-extra-div{position:absolute;top:0;left:0;width:100%;height:100%}body:not( .ml-half-screen ) .ml-container .ml-form-container{width:100%;min-height:100vh}body.ml-half-screen .ml-container{flex-wrap:wrap}body.ml-half-screen .ml-container>.ml-extra-div,body.ml-half-screen .ml-container>.ml-form-container{width:50%}body.ml-half-screen.ml-login-align-2 .ml-container>div,body.ml-half-screen.ml-login-align-4 .ml-container>div{width:100%;flex-basis:50%;}body.ml-half-screen.ml-login-align-2 .ml-container{flex-direction:column-reverse}body.ml-half-screen.ml-login-align-4 .ml-container{flex-direction:column}body.ml-half-screen.ml-login-align-1 .ml-container{flex-direction:row-reverse}body.ml-login-vertical-align-1 .ml-form-container{align-items:flex-start}body.ml-login-vertical-align-3 .ml-form-container{align-items:flex-end}body.ml-login-horizontal-align-1 .ml-form-container{justify-content:flex-start}body.ml-login-horizontal-align-3 .ml-form-container{justify-content:flex-end}@media only screen and (max-width: 768px) {body.ml-half-screen .ml-container > .ml-extra-div, body.ml-half-screen .ml-container > .ml-form-container{width:100%;}body .ml-container .ml-extra-div{position:absolute;top:0;left:0;width:100%;height:100%;}}</style>';
744
- echo '<style type="text/css" id="clc-style">' . $css . '</style>';
745
- echo '<style type="text/css" id="clc-columns-style">' . $columns_css . '</style>';
746
- echo '<style type="text/css" id="clc-custom-css">' . $custom_css . '</style>';
747
- }
748
-
749
- public function add_extra_div() {
750
- echo '<div class="ml-container"><div class="ml-extra-div"></div><div class="ml-form-container">';
751
- }
752
-
753
- public function close_extra_div() {
754
- echo '</div></div>';
755
- }
756
-
757
- public function check_labels() {
758
-
759
- add_filter( 'gettext', array( $this, 'change_username_label' ), 99, 3 );
760
- add_filter( 'gettext', array( $this, 'change_password_label' ), 99, 3 );
761
-
762
- }
763
-
764
- /**
765
- * Customizer output for custom username label.
766
- *
767
- * @param string|string $translated_text The translated text.
768
- * @param string|string $text The label we want to replace.
769
- * @param string|string $domain The text domain of the site.
770
- * @return string
771
- */
772
- public function change_username_label( $translated_text, $text, $domain ) {
773
- $default = 'Username or Email Address';
774
- $label = $this->options['username-label'];
775
-
776
- // Check if is our text
777
- if ( $default !== $text ) {
778
- return $translated_text;
779
- }
780
-
781
- // Check if the label is changed
782
- if ( $label === $text ) {
783
- return $translated_text;
784
- }else{
785
- $translated_text = esc_html( $label );
786
- }
787
-
788
- return $translated_text;
789
- }
790
- /**
791
- * Customizer output for custom password label.
792
- *
793
- * @param string|string $translated_text The translated text.
794
- * @param string|string $text The label we want to replace.
795
- * @param string|string $domain The text domain of the site.
796
- * @return string
797
- */
798
- public function change_password_label( $translated_text, $text, $domain ) {
799
- $default = 'Password';
800
- $label = $this->options['password-label'];
801
-
802
- // Check if is our text
803
- if ( $default !== $text ) {
804
- return $translated_text;
805
- }
806
-
807
- // Check if the label is changed
808
- if ( $label === $text ) {
809
- return $translated_text;
810
- }else{
811
- $translated_text = esc_html( $label );
812
- }
813
-
814
- return $translated_text;
815
- }
816
-
817
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) {
3
+ exit;
4
+ }
5
+
6
+ /**
7
+ * Class Colorlib_Login_Customizer_Customization
8
+ */
9
+ class Colorlib_Login_Customizer_CSS_Customization {
10
+ /**
11
+ * @var array
12
+ */
13
+ private $options = array();
14
+ /**
15
+ * @var array
16
+ */
17
+ private $selectors = array();
18
+ /**
19
+ * @var string
20
+ */
21
+ private $base = '';
22
+
23
+ private $defaults;
24
+
25
+ /**
26
+ * Colorlib_Login_Customizer_CSS_Customization constructor.
27
+ */
28
+ public function __construct() {
29
+ $plugin = Colorlib_Login_Customizer::instance();
30
+ $this->key_name = $plugin->key_name;
31
+ $this->defaults = $plugin->get_defaults();
32
+ $this->set_options();
33
+
34
+ add_action( 'login_init', array( $this, 'check_general_texts' ) );
35
+
36
+ add_action( 'login_form_login', array( $this, 'check_login_texts' ) );
37
+ add_action( 'login_form_register', array( $this, 'check_register_texts' ) );
38
+ add_action( 'login_form_lostpassword', array( $this, 'check_lostpasswords_texts' ) );
39
+
40
+ add_action( 'login_header', array( $this, 'add_extra_div' ) );
41
+ add_action( 'login_head', array( $this, 'generate_css' ), 15 );
42
+ add_action( 'login_footer', array( $this, 'close_extra_div' ) );
43
+ add_filter( 'login_body_class', array( $this, 'body_class' ) );
44
+ add_filter( 'login_headerurl', array( $this, 'logo_url' ), 99 );
45
+ add_filter('login_headertitle', array($this, 'logo_title'), 99);
46
+ //
47
+ add_action( 'customize_preview_init', array( $this, 'output_css_object' ), 26 );
48
+ }
49
+
50
+ private function generate_name( $id ) {
51
+ return $this->key_name . '[' . $id . ']';
52
+ }
53
+
54
+ public function output_css_object() {
55
+
56
+ $css_object = array(
57
+ 'selectors' => array(),
58
+ 'settings' => array(),
59
+ );
60
+
61
+ foreach ( $this->selectors as $selector => $settings ) {
62
+ $css_object['selectors'][ $selector ] = $settings['options'];
63
+ foreach ( $settings['options'] as $index => $setting ) {
64
+ $css_object['settings'][ $setting ] = array(
65
+ 'name' => $this->generate_name( $setting ),
66
+ 'value' => $this->options[ $setting ],
67
+ 'attribute' => $settings['attributes'][ $index ],
68
+ );
69
+ }
70
+ }
71
+
72
+ wp_localize_script( 'colorlib-login-customizer-preview', 'CLC', $css_object );
73
+
74
+ }
75
+
76
+ /**
77
+ * Set the options array, it returns nothing
78
+ */
79
+ public function set_options() {
80
+
81
+ $options = get_option( $this->key_name, array() );
82
+ $this->options = wp_parse_args( $options, $this->defaults );
83
+
84
+ $this->selectors = array(
85
+ '.wp-core-ui .button-primary.focus, .wp-core-ui .button-primary.hover, .wp-core-ui .button-primary:focus, .wp-core-ui .button-primary:hover' => array(
86
+ 'attributes' => array(
87
+ 'background',
88
+ 'border-color',
89
+ ),
90
+ 'options' => array(
91
+ 'button-background-hover',
92
+ 'button-border-color-hover',
93
+ ),
94
+ ),
95
+ '.wp-core-ui .button-primary' => array(
96
+ 'attributes' => array(
97
+ 'background',
98
+ 'border-color',
99
+ 'box-shadow',
100
+ 'text-shadow',
101
+ 'color',
102
+ ),
103
+ 'options' => array(
104
+ 'button-background',
105
+ 'button-border-color',
106
+ 'button-shadow',
107
+ 'button-text-shadow',
108
+ 'button-color',
109
+ ),
110
+ ),
111
+ '.login #backtoblog a, .login #nav a' => array(
112
+ 'attributes' => array(
113
+ 'color',
114
+ ),
115
+ 'options' => array(
116
+ 'link-color',
117
+ ),
118
+ ),
119
+ '.login #backtoblog a:hover, .login #nav a:hover, .login h1 a:hover' => array(
120
+ 'attributes' => array(
121
+ 'color',
122
+ ),
123
+ 'options' => array(
124
+ 'link-color-hover',
125
+ ),
126
+ ),
127
+ '.ml-container #login' => array(
128
+ 'attributes' => array(
129
+ 'max-width',
130
+ ),
131
+ 'options' => array(
132
+ 'form-width',
133
+ ),
134
+ ),
135
+ '#loginform,#registerform,#lostpasswordform' => array(
136
+ 'attributes' => array(
137
+ 'height',
138
+ 'background-image',
139
+ 'background-color',
140
+ 'padding',
141
+ 'border',
142
+ 'border-radius',
143
+ 'box-shadow',
144
+ ),
145
+ 'options' => array(
146
+ 'form-height',
147
+ 'form-background-image',
148
+ 'form-background-color',
149
+ 'form-padding',
150
+ 'form-border',
151
+ 'form-border-radius',
152
+ 'form-shadow',
153
+ ),
154
+ ),
155
+ '.login form .input, .login input[type="text"]' => array(
156
+ 'attributes' => array(
157
+ 'max-width',
158
+ 'margin',
159
+ 'border-radius',
160
+ 'border',
161
+ 'background',
162
+ 'color',
163
+ ),
164
+ 'options' => array(
165
+ 'form-field-width',
166
+ 'form-field-margin',
167
+ 'form-field-border-radius',
168
+ 'form-field-border',
169
+ 'form-field-background',
170
+ 'form-field-color',
171
+ ),
172
+ ),
173
+ '.login label' => array(
174
+ 'attributes' => array(
175
+ 'color',
176
+ ),
177
+ 'options' => array(
178
+ 'form-label-color',
179
+ ),
180
+ ),
181
+ '.ml-container .ml-extra-div' => array(
182
+ 'attributes' => array(
183
+ 'background-image',
184
+ 'background-color',
185
+ ),
186
+ 'options' => array(
187
+ 'custom-background',
188
+ 'custom-background-color',
189
+ ),
190
+ ),
191
+ '.ml-container .ml-form-container' => array(
192
+ 'attributes' => array(
193
+ 'background-image',
194
+ 'background-color',
195
+ ),
196
+ 'options' => array(
197
+ 'custom-background-form',
198
+ 'custom-background-color-form',
199
+ )
200
+ ),
201
+ '.login h1 a' => array(
202
+ 'attributes' => array(
203
+ 'background-image',
204
+ 'width',
205
+ 'height',
206
+ ),
207
+ 'options' => array(
208
+ 'custom-logo',
209
+ 'logo-width',
210
+ 'logo-height',
211
+ ),
212
+ ),
213
+ '.login.clc-text-logo h1 a' => array(
214
+ 'attributes' => array(
215
+ 'color',
216
+ 'font-size',
217
+ ),
218
+ 'options' => array(
219
+ 'logo-text-color',
220
+ 'logo-text-size',
221
+ ),
222
+ ),
223
+ '.login.clc-text-logo h1 a:hover' => array(
224
+ 'attributes' => array(
225
+ 'color',
226
+ ),
227
+ 'options' => array(
228
+ 'logo-text-color-hover',
229
+ ),
230
+ ),
231
+ '#login > h1' => array(
232
+ 'attributes' => array(
233
+ 'display',
234
+ ),
235
+ 'options' => array(
236
+ 'hide-logo',
237
+ ),
238
+ ),
239
+ '#login > #nav,#login > #backtoblog' => array(
240
+ 'attributes' => array(
241
+ 'display',
242
+ ),
243
+ 'options' => array(
244
+ 'hide-extra-links',
245
+ ),
246
+ ),
247
+ '#login form .forgetmenot' => array(
248
+ 'attributes' => array(
249
+ 'display',
250
+ ),
251
+ 'options' => array(
252
+ 'hide-rememberme',
253
+ ),
254
+ ),
255
+ );
256
+
257
+ }
258
+
259
+ /**
260
+ * Create the CSS string for output
261
+ *
262
+ * @return mixed|string
263
+ */
264
+ public function create_css() {
265
+ /**
266
+ * Get an instance of the plugin so we can get the token
267
+ */
268
+ //$instance = Colorlib_Login_Customizer::instance();
269
+
270
+ $string = '';
271
+ /**
272
+ * In case the array is empty, we return an empty string
273
+ */
274
+ if ( empty( $this->options ) ) {
275
+ return $string;
276
+ }
277
+
278
+ /**
279
+ * Start building the CSS file
280
+ */
281
+ $string .= $this->_set_background_options();
282
+ $string .= $this->_set_logo_options();
283
+ $string .= $this->_set_form_options();
284
+ $string .= $this->_set_miscellaneous_options();
285
+
286
+ return $string;
287
+ }
288
+
289
+ /**
290
+ * @return string
291
+ */
292
+ public function _set_miscellaneous_options() {
293
+ $string = '';
294
+
295
+ $string .= $this->create_css_lines(
296
+ '.wp-core-ui .button-primary.focus, .wp-core-ui .button-primary.hover, .wp-core-ui .button-primary:focus, .wp-core-ui .button-primary:hover',
297
+ array(
298
+ 'background',
299
+ 'border-color',
300
+ ),
301
+ array(
302
+ 'button-background-hover',
303
+ 'button-border-color-hover',
304
+ )
305
+ );
306
+
307
+ $string .= $this->create_css_lines(
308
+ '.wp-core-ui .button-primary',
309
+ array(
310
+ 'background',
311
+ 'border-color',
312
+ 'box-shadow',
313
+ 'text-shadow',
314
+ 'color',
315
+ ),
316
+ array(
317
+ 'button-background',
318
+ 'button-border-color',
319
+ 'button-shadow',
320
+ 'button-text-shadow',
321
+ 'button-color',
322
+ )
323
+ );
324
+
325
+ $string .= $this->create_css_lines(
326
+ '.login #backtoblog a, .login #nav a',
327
+ array(
328
+ 'color',
329
+ ),
330
+ array(
331
+ 'link-color',
332
+ )
333
+ );
334
+
335
+ $string .= $this->create_css_lines(
336
+ '.login #backtoblog a:hover, .login #nav a:hover, .login h1 a:hover',
337
+ array(
338
+ 'color',
339
+ ),
340
+ array(
341
+ 'link-color-hover',
342
+ )
343
+ );
344
+
345
+ $string .= $this->create_css_lines(
346
+ '#login form .forgetmenot',
347
+ array(
348
+ 'display',
349
+ ),
350
+ array(
351
+ 'hide-rememberme',
352
+ )
353
+ );
354
+
355
+ return $string;
356
+ }
357
+
358
+ /**
359
+ * @return string
360
+ */
361
+ public function _set_form_options() {
362
+ $string = '';
363
+
364
+ $string .= $this->create_css_lines(
365
+ '.ml-container #login',
366
+ array(
367
+ 'max-width',
368
+ ),
369
+ array(
370
+ 'form-width',
371
+ )
372
+ );
373
+
374
+ /**
375
+ * Set form variables
376
+ */
377
+ $string .= $this->create_css_lines(
378
+ '#loginform,#registerform,#lostpasswordform',
379
+ array(
380
+ 'height',
381
+ 'background-image',
382
+ 'background-color',
383
+ 'padding',
384
+ 'border',
385
+ 'border-radius',
386
+ 'box-shadow',
387
+ ),
388
+ array(
389
+ 'form-height',
390
+ 'form-background-image',
391
+ 'form-background-color',
392
+ 'form-padding',
393
+ 'form-border',
394
+ 'form-border-radius',
395
+ 'form-shadow',
396
+ )
397
+ );
398
+
399
+ /**
400
+ * Set form field variables
401
+ */
402
+ $string .= $this->create_css_lines(
403
+ '.login form .input, .login input[type="text"]',
404
+ array(
405
+ 'max-width',
406
+ 'margin',
407
+ 'border-radius',
408
+ 'border',
409
+ 'background',
410
+ 'color',
411
+ ),
412
+ array(
413
+ 'form-field-width',
414
+ 'form-field-margin',
415
+ 'form-field-border-radius',
416
+ 'form-field-border',
417
+ 'form-field-background',
418
+ 'form-field-color',
419
+ )
420
+ );
421
+
422
+ /**
423
+ * Set form field labels
424
+ */
425
+ $string .= $this->create_css_lines(
426
+ '.login label',
427
+ array(
428
+ 'color',
429
+ ),
430
+ array(
431
+ 'form-label-color',
432
+ )
433
+ );
434
+
435
+ $string .= $this->create_css_lines(
436
+ '#login > #nav,#login > #backtoblog',
437
+ array(
438
+ 'display',
439
+ ),
440
+ array(
441
+ 'hide-extra-links',
442
+ )
443
+ );
444
+
445
+ return $string;
446
+ }
447
+
448
+ /**
449
+ * @return string
450
+ */
451
+ public function _set_background_options() {
452
+ $string = '';
453
+ /**
454
+ * Set background-image
455
+ */
456
+ $string .= $this->create_css_lines(
457
+ '.ml-container .ml-extra-div',
458
+ array(
459
+ 'background-image',
460
+ 'background-color',
461
+ ),
462
+ array(
463
+ 'custom-background',
464
+ 'custom-background-color',
465
+ )
466
+ );
467
+
468
+ $string .= $this->create_css_lines(
469
+ '.ml-container .ml-form-container',
470
+ array(
471
+ 'background-image',
472
+ 'background-color',
473
+ ),
474
+ array(
475
+ 'custom-background-form',
476
+ 'custom-background-color-form',
477
+ )
478
+ );
479
+
480
+ return $string;
481
+
482
+ }
483
+
484
+ /**
485
+ * @return string
486
+ */
487
+ public function _set_logo_options() {
488
+ $string = '';
489
+ /**
490
+ * Set logo dimensions
491
+ */
492
+ $string .= $this->create_css_lines(
493
+ '.login h1 a',
494
+ array(
495
+ 'background-image',
496
+ 'background-size',
497
+ 'width',
498
+ 'height',
499
+ ),
500
+ array(
501
+ 'custom-logo',
502
+ 'logo-width',
503
+ 'logo-width',
504
+ 'logo-height',
505
+ )
506
+ );
507
+
508
+ $string .= $this->create_css_lines(
509
+ '.login.clc-text-logo h1 a',
510
+ array(
511
+ 'color',
512
+ 'font-size',
513
+ ),
514
+ array(
515
+ 'logo-text-color',
516
+ 'logo-text-size',
517
+ )
518
+ );
519
+
520
+ $string .= $this->create_css_lines(
521
+ '.login.clc-text-logo h1 a:hover',
522
+ array(
523
+ 'color',
524
+ ),
525
+ array(
526
+ 'logo-text-color-hover',
527
+ )
528
+ );
529
+
530
+ $string .= $this->create_css_lines(
531
+ '#login > h1',
532
+ array(
533
+ 'display',
534
+ ),
535
+ array(
536
+ 'hide-logo',
537
+ )
538
+ );
539
+
540
+ return $string;
541
+ }
542
+
543
+ /**
544
+ * @param $selector
545
+ * @param $properties
546
+ * @param $options
547
+ *
548
+ * @return string
549
+ */
550
+ private function create_css_lines( $selector, $properties, $options ) {
551
+ $string = '';
552
+ $valued = array();
553
+
554
+ $i = 0;
555
+ foreach ( $options as $option ) {
556
+ if ( ! empty( $this->options[ $option ] ) ) {
557
+ $valued[ $properties[ $i ] ] = $this->options[ $option ];
558
+ }
559
+ $i ++;
560
+ }
561
+
562
+ if ( ! empty( $valued ) ) {
563
+ $string .= $selector . '{' . "\n";
564
+
565
+ foreach ( $valued as $index => $value ) {
566
+ $string .= $index . ':' . esc_attr( $this->add_artifacts( $index, $value ) ) . ';' . "\n";
567
+ }
568
+ $string .= '}' . "\n";
569
+ }
570
+
571
+ return $string;
572
+ }
573
+
574
+ /**
575
+ *
576
+ *
577
+ * @param $property
578
+ * @param $value
579
+ *
580
+ * @return string
581
+ */
582
+ private function add_artifacts( $property, $value ) {
583
+ switch ( $property ) {
584
+ case 'background-image':
585
+ $value = 'url(' . $value . ')';
586
+ break;
587
+
588
+ case 'width':
589
+ case 'min-width':
590
+ case 'max-width':
591
+ case 'background-size':
592
+ case 'height':
593
+ case 'min-height':
594
+ case 'max-height':
595
+ case 'font-size':
596
+ $value = $value . 'px';
597
+ break;
598
+ case 'display':
599
+ if ( ! $value ) {
600
+ $value = 'block';
601
+ }else{
602
+ $value = 'none';
603
+ }
604
+ default:
605
+ break;
606
+ }
607
+
608
+ return $value;
609
+ }
610
+
611
+ public function body_class( $classes ) {
612
+
613
+ if ( '2' == $this->options['columns'] ) {
614
+ $classes[] = 'ml-half-screen';
615
+ if ( isset( $this->options['form-column-align'] ) ) {
616
+ $classes[] = 'ml-login-align-' . esc_attr( $this->options['form-column-align'] );
617
+ }
618
+ }
619
+
620
+ if ( isset( $this->options['form-vertical-align'] ) ) {
621
+ $classes[] = 'ml-login-vertical-align-' . esc_attr( $this->options['form-vertical-align'] );
622
+ }
623
+
624
+ if ( isset( $this->options['form-horizontal-align'] ) ) {
625
+ $classes[] = 'ml-login-horizontal-align-' . esc_attr( $this->options['form-horizontal-align'] );
626
+ }
627
+
628
+ if ( isset( $this->options['use-text-logo'] ) && $this->options['use-text-logo'] ) {
629
+ $classes[] = 'clc-text-logo';
630
+ }
631
+
632
+ return $classes;
633
+ }
634
+
635
+ public function logo_url( $url ) {
636
+ if ( '' != $this->options['logo-url'] ) {
637
+ return esc_url( $this->options['logo-url'] );
638
+ }
639
+
640
+ return $url;
641
+ }
642
+
643
+ public function logo_title( $title ) {
644
+ if ( isset( $this->options['logo-title'] ) ) {
645
+ return wp_kses_post( $this->options['logo-title'] );
646
+ }
647
+
648
+ return $title;
649
+ }
650
+
651
+ /**
652
+ * Output the inline CSS
653
+ */
654
+ public function generate_css() {
655
+ $instance = Colorlib_Login_Customizer::instance();
656
+ $css = $this->create_css();
657
+ $custom_css = $this->options['custom-css'];
658
+ $columns_css = '';
659
+
660
+ if ( 2 == $this->options['columns'] ) {
661
+ $widths = $this->options['columns-width'];
662
+
663
+ $left_width = ( 100 / 12 )*absint( $widths['left'] );
664
+ $right_width = ( 100 / 12 )*absint( $widths['right'] );
665
+
666
+ $columns_css .= '.ml-half-screen.ml-login-align-3 .ml-container .ml-extra-div,.ml-half-screen.ml-login-align-1 .ml-container .ml-form-container{ width:' . $left_width . '%; }';
667
+ $columns_css .= '.ml-half-screen.ml-login-align-4 .ml-container .ml-extra-div,.ml-half-screen.ml-login-align-2 .ml-container .ml-form-container{ flex-basis:' . $left_width . '%; }';
668
+
669
+ $columns_css .= '.ml-half-screen.ml-login-align-3 .ml-container .ml-form-container,.ml-half-screen.ml-login-align-1 .ml-container .ml-extra-div{ width:' . $right_width . '%; }';
670
+ $columns_css .= '.ml-half-screen.ml-login-align-4 .ml-container .ml-form-container,.ml-half-screen.ml-login-align-2 .ml-container .ml-extra-div{ flex-basis:' . $right_width . '%; }';
671
+
672
+ }
673
+
674
+ echo '<style type="text/css">#registerform #wp-submit{float:none;margin-top:15px;}.login.clc-text-logo h1 a{ background-image: none !important;text-indent: unset;width:auto !important;height: auto !important; }#login form p label br{display:none}body:not( .ml-half-screen ) .ml-form-container{background:transparent !important;}.login h1 a{background-position: center;background-size:contain !important;}.ml-container #login{ position:relative;padding: 0;width:100%;max-width:320px;margin:0;}#loginform,#registerform,#lostpasswordform{box-sizing: border-box;max-height: 100%;background-position: center;background-repeat: no-repeat;background-size: cover;}.ml-container{position:relative;min-height:100vh;display:flex;height:100%;min-width:100%;}.ml-container .ml-extra-div{background-position:center;background-size:cover;background-repeat:no-repeat}body .ml-form-container{display:flex;align-items:center;justify-content:center}body:not( .ml-half-screen ) .ml-container .ml-extra-div{position:absolute;top:0;left:0;width:100%;height:100%}body:not( .ml-half-screen ) .ml-container .ml-form-container{width:100%;min-height:100vh}body.ml-half-screen .ml-container{flex-wrap:wrap}body.ml-half-screen .ml-container>.ml-extra-div,body.ml-half-screen .ml-container>.ml-form-container{width:50%}body.ml-half-screen.ml-login-align-2 .ml-container>div,body.ml-half-screen.ml-login-align-4 .ml-container>div{width:100%;flex-basis:50%;}body.ml-half-screen.ml-login-align-2 .ml-container{flex-direction:column-reverse}body.ml-half-screen.ml-login-align-4 .ml-container{flex-direction:column}body.ml-half-screen.ml-login-align-1 .ml-container{flex-direction:row-reverse}body.ml-login-vertical-align-1 .ml-form-container{align-items:flex-start}body.ml-login-vertical-align-3 .ml-form-container{align-items:flex-end}body.ml-login-horizontal-align-1 .ml-form-container{justify-content:flex-start}body.ml-login-horizontal-align-3 .ml-form-container{justify-content:flex-end}@media only screen and (max-width: 768px) {body.ml-half-screen .ml-container > .ml-extra-div, body.ml-half-screen .ml-container > .ml-form-container{width:100%;}body .ml-container .ml-extra-div{position:absolute;top:0;left:0;width:100%;height:100%;}}.login input[type=text]:focus, .login input[type=search]:focus, .login input[type=radio]:focus, .login input[type=tel]:focus, .login input[type=time]:focus, .login input[type=url]:focus, .login input[type=week]:focus, .login input[type=password]:focus, .login input[type=checkbox]:focus, .login input[type=color]:focus, .login input[type=date]:focus, .login input[type=datetime]:focus, .login input[type=datetime-local]:focus, .login input[type=email]:focus, .login input[type=month]:focus, .login input[type=number]:focus, .login select:focus, .login textarea:focus{ box-shadow: none; }</style>';
675
+ echo '<style type="text/css" id="clc-style">' . $css . '</style>';
676
+ echo '<style type="text/css" id="clc-columns-style">' . $columns_css . '</style>';
677
+ echo '<style type="text/css" id="clc-custom-css">' . $custom_css . '</style>';
678
+ }
679
+
680
+ public function add_extra_div() {
681
+ echo '<div class="ml-container"><div class="ml-extra-div"></div><div class="ml-form-container">';
682
+ }
683
+
684
+ public function close_extra_div() {
685
+ echo '</div></div>';
686
+ }
687
+
688
+ // Check general texts
689
+ public function check_general_texts(){
690
+
691
+ add_filter( 'gettext', array( $this, 'change_lost_password_text' ), 99, 3 );
692
+ add_filter( 'gettext_with_context', array( $this, 'change_back_to_text' ), 99, 4 );
693
+
694
+ }
695
+
696
+ // Check Login page texts
697
+ public function check_login_texts(){
698
+
699
+ add_filter( 'gettext', array( $this, 'change_username_label' ), 99, 3 );
700
+ add_filter( 'gettext', array( $this, 'change_password_label' ), 99, 3 );
701
+ add_filter( 'gettext', array( $this, 'change_rememberme_label' ), 99, 3 );
702
+ add_filter( 'gettext', array( $this, 'change_login_label' ), 99, 3 );
703
+ add_filter( 'gettext', array( $this, 'change_register_login_link_text' ), 99, 3 );
704
+
705
+ }
706
+
707
+ // Check Register page texts
708
+ public function check_register_texts(){
709
+
710
+ add_filter( 'gettext', array( $this, 'change_register_username_label' ), 99, 3 );
711
+ add_filter( 'gettext', array( $this, 'change_register_email_label' ), 99, 3 );
712
+ add_filter( 'gettext', array( $this, 'change_register_register_label' ),99,3);
713
+ add_filter( 'gettext', array( $this, 'change_register_confirmation_text' ), 99, 3 );
714
+ add_filter( 'gettext', array( $this, 'change_login_register_link_text' ), 99, 3 );
715
+
716
+ }
717
+
718
+ // Check Lost Password page texts
719
+ public function check_lostpasswords_texts(){
720
+
721
+ add_filter( 'gettext', array( $this, 'change_lostpasswords_username_label' ), 99, 3 );
722
+ add_filter( 'gettext', array( $this, 'change_lostpasswords_button_label' ), 99, 3 );
723
+
724
+ add_filter( 'gettext', array( $this, 'change_register_login_link_text' ), 99, 3 );
725
+ add_filter( 'gettext', array( $this, 'change_login_register_link_text' ), 99, 3 );
726
+
727
+ }
728
+
729
+
730
+ /**
731
+ * Customizer output for custom username label.
732
+ *
733
+ * @param string|string $translated_text The translated text.
734
+ * @param string|string $text The label we want to replace.
735
+ * @param string|string $domain The text domain of the site.
736
+ * @return string
737
+ */
738
+ public function change_username_label( $translated_text, $text, $domain ) {
739
+ $default = 'Username or Email Address';
740
+ $label = $this->options['username-label'];
741
+
742
+ // Check if is our text
743
+ if ( $default !== $text ) {
744
+ return $translated_text;
745
+ }
746
+
747
+ // Check if the label is changed
748
+ if ( $label === $text ) {
749
+ return $translated_text;
750
+ }else{
751
+ $translated_text = esc_html( $label );
752
+ }
753
+
754
+ return $translated_text;
755
+ }
756
+ /**
757
+ * Customizer output for custom password label.
758
+ *
759
+ * @param string|string $translated_text The translated text.
760
+ * @param string|string $text The label we want to replace.
761
+ * @param string|string $domain The text domain of the site.
762
+ * @return string
763
+ */
764
+ public function change_password_label( $translated_text, $text, $domain ) {
765
+ $default = 'Password';
766
+ $label = $this->options['password-label'];
767
+
768
+ // Check if is our text
769
+ if ( $default !== $text ) {
770
+ return $translated_text;
771
+ }
772
+
773
+ // Check if the label is changed
774
+ if ( $label === $text ) {
775
+ return $translated_text;
776
+ }else{
777
+ $translated_text = esc_html( $label );
778
+ }
779
+
780
+ return $translated_text;
781
+ }
782
+
783
+ /**
784
+ * Customizer output for custom remember me text.
785
+ *
786
+ * @param string|string $translated_text The translated text.
787
+ * @param string|string $text The label we want to replace.
788
+ * @param string|string $domain The text domain of the site.
789
+ * @return string
790
+ */
791
+ public function change_rememberme_label( $translated_text, $text, $domain ) {
792
+ $default = 'Remember Me';
793
+ $label = $this->options['rememberme-label'];
794
+
795
+ // Check if is our text
796
+ if ( $default !== $text ) {
797
+ return $translated_text;
798
+ }
799
+
800
+ // Check if the label is changed
801
+ if ( $label === $text ) {
802
+ return $translated_text;
803
+ } else {
804
+ $translated_text = esc_html( $label );
805
+ }
806
+
807
+ return $translated_text;
808
+ }
809
+
810
+ /**
811
+ * Customizer output for custom lost your password text.
812
+ *
813
+ * @param string|string $translated_text The translated text.
814
+ * @param string|string $text The label we want to replace.
815
+ * @param string|string $domain The text domain of the site.
816
+ * @return string
817
+ */
818
+ public function change_lost_password_text( $translated_text, $text, $domain ) {
819
+ $default = 'Lost your password?';
820
+ $label = $this->options['lost-password-text'];
821
+
822
+ // Check if is our text
823
+ if ( $default !== $text ) {
824
+ return $translated_text;
825
+ }
826
+
827
+ // Check if the label is changed
828
+ if ( $label === $text ) {
829
+ return $translated_text;
830
+ }else{
831
+ $translated_text = esc_html( $label );
832
+ }
833
+
834
+ return $translated_text;
835
+ }
836
+
837
+ /**
838
+ * Customizer output for custom back to text.
839
+ *
840
+ * @param string|string $translated_text The translated text.
841
+ * @param string|string $text The label we want to replace.
842
+ * @param string|string $domain The text domain of the site.
843
+ * @return string
844
+ */
845
+ public function change_back_to_text( $translated_text, $text, $context, $domain ) {
846
+ $default = '&larr; Back to %s';
847
+ $label = $this->options['back-to-text'];
848
+
849
+ // Check if is our text
850
+ if ( $default !== $text ) {
851
+ return $translated_text;
852
+ }
853
+
854
+ // Check if the label is changed
855
+ if ( $label === $text ) {
856
+ return $translated_text;
857
+ }else{
858
+ $translated_text = '&larr; ' . esc_html( $label ) . ' %s';
859
+ }
860
+
861
+ return $translated_text;
862
+ }
863
+
864
+ /**
865
+ * Customizer output for custom login text.
866
+ *
867
+ * @param string|string $translated_text The translated text.
868
+ * @param string|string $text The label we want to replace.
869
+ * @param string|string $domain The text domain of the site.
870
+ * @return string
871
+ */
872
+ public function change_login_label( $translated_text, $text, $domain ) {
873
+ $default = 'Log In';
874
+ $label = $this->options['login-label'];
875
+
876
+ // Check if is our text
877
+ if ( $default !== $text ) {
878
+ return $translated_text;
879
+ }
880
+
881
+ // Check if the label is changed
882
+ if ( $label === $text ) {
883
+ return $translated_text;
884
+ } else {
885
+ $translated_text = esc_attr( $label );
886
+ }
887
+
888
+ return $translated_text;
889
+ }
890
+
891
+ /**
892
+ * Customizer output for custom register username label.
893
+ *
894
+ * @param string|string $translated_text The translated text.
895
+ * @param string|string $text The label we want to replace.
896
+ * @param string|string $domain The text domain of the site.
897
+ * @return string
898
+ */
899
+ public function change_register_username_label( $translated_text, $text, $domain ) {
900
+ $default = 'Username';
901
+ $label = $this->options['register-username-label'];
902
+
903
+ // Check if is our text
904
+ if ( $default !== $text ) {
905
+ return $translated_text;
906
+ }
907
+
908
+ // Check if the label is changed
909
+ if ( $label === $text ) {
910
+ return $translated_text;
911
+ }else{
912
+ $translated_text = esc_html( $label );
913
+ }
914
+
915
+ return $translated_text;
916
+ }
917
+
918
+ /**
919
+ * Customizer output for custom register email label.
920
+ *
921
+ * @param string|string $translated_text The translated text.
922
+ * @param string|string $text The label we want to replace.
923
+ * @param string|string $domain The text domain of the site.
924
+ * @return string
925
+ */
926
+ public function change_register_email_label( $translated_text, $text, $domain ) {
927
+ $default = 'Email';
928
+ $label = $this->options['register-email-label'];
929
+
930
+ // Check if is our text
931
+ if ( $default !== $text ) {
932
+ return $translated_text;
933
+ }
934
+
935
+ // Check if the label is changed
936
+ if ( $label === $text ) {
937
+ return $translated_text;
938
+ }else{
939
+ $translated_text = esc_html( $label );
940
+ }
941
+
942
+ return $translated_text;
943
+ }
944
+
945
+ /**
946
+ * Customizer output for custom registration confirmation text.
947
+ *
948
+ * @param string|string $translated_text The translated text.
949
+ * @param string|string $text The label we want to replace.
950
+ * @param string|string $domain The text domain of the site.
951
+ * @return string
952
+ */
953
+ public function change_register_confirmation_text( $translated_text, $text, $domain ) {
954
+ $default = 'Registration confirmation will be emailed to you.';
955
+ $label = $this->options['register-confirmation-email'];
956
+ // Check if is our text
957
+ if ( $default !== $text ) {
958
+ return $translated_text;
959
+ }
960
+
961
+ // Check if the label is changed
962
+ if ( $label === $text ) {
963
+ return $translated_text;
964
+ }else{
965
+ $translated_text = esc_html( $label );
966
+ }
967
+
968
+
969
+ return $translated_text;
970
+ }
971
+
972
+ /**
973
+ * Customizer output for custom register button text.
974
+ *
975
+ * @param string|string $translated_text The translated text.
976
+ * @param string|string $text The label we want to replace.
977
+ * @param string|string $domain The text domain of the site.
978
+ * @return string
979
+ */
980
+ public function change_register_register_label( $translated_text, $text, $domain ) {
981
+ $default = 'Register';
982
+ $label = $this->options['register-button-label'];
983
+
984
+ // Check if is our text
985
+ if ( $default !== $text ) {
986
+ return $translated_text;
987
+ }
988
+
989
+ // Check if the label is changed
990
+ if ( $label === $text ) {
991
+ return $translated_text;
992
+ }else{
993
+ $translated_text = esc_html( $label );
994
+ }
995
+
996
+ return $translated_text;
997
+ }
998
+
999
+ public function change_login_register_link_text( $translated_text, $text, $domain ) {
1000
+ $default = 'Log in';
1001
+ $label = $this->options['login-link-label'];
1002
+
1003
+ // Check if is our text
1004
+ if ( $default !== $text ) {
1005
+ return $translated_text;
1006
+ }
1007
+
1008
+ // Check if the label is changed
1009
+ if ( $label === $text ) {
1010
+ return $translated_text;
1011
+ }else{
1012
+ $translated_text = esc_html( $label );
1013
+ }
1014
+
1015
+ return $translated_text;
1016
+ }
1017
+
1018
+ public function change_register_login_link_text( $translated_text, $text, $domain ) {
1019
+ $default = 'Register';
1020
+ $label = $this->options['register-link-label'];
1021
+
1022
+ // Check if is our text
1023
+ if ( $default !== $text ) {
1024
+ return $translated_text;
1025
+ }
1026
+
1027
+ // Check if the label is changed
1028
+ if ( $label === $text ) {
1029
+ return $translated_text;
1030
+ }else{
1031
+ $translated_text = esc_html( $label );
1032
+ }
1033
+
1034
+ return $translated_text;
1035
+ }
1036
+
1037
+ public function change_lostpasswords_username_label( $translated_text, $text, $domain ) {
1038
+ $default = 'Username or Email Address';
1039
+ $label = $this->options['lostpassword-username-label'];
1040
+
1041
+ // Check if is our text
1042
+ if ( $default !== $text ) {
1043
+ return $translated_text;
1044
+ }
1045
+
1046
+ // Check if the label is changed
1047
+ if ( $label === $text ) {
1048
+ return $translated_text;
1049
+ }else{
1050
+ $translated_text = esc_html( $label );
1051
+ }
1052
+
1053
+ return $translated_text;
1054
+ }
1055
+
1056
+ public function change_lostpasswords_button_label( $translated_text, $text, $domain ) {
1057
+ $default = 'Get New Password';
1058
+ $label = $this->options['lostpassword-button-label'];
1059
+
1060
+ // Check if is our text
1061
+ if ( $default !== $text ) {
1062
+ return $translated_text;
1063
+ }
1064
+
1065
+ // Check if the label is changed
1066
+ if ( $label === $text ) {
1067
+ return $translated_text;
1068
+ }else{
1069
+ $translated_text = esc_html( $label );
1070
+ }
1071
+
1072
+ return $translated_text;
1073
+ }
1074
+ }
includes/lib/class-colorlib-login-customizer-customizer.php CHANGED
@@ -1,903 +1,1026 @@
1
- <?php
2
-
3
- if ( ! defined( 'ABSPATH' ) ) {
4
- exit;
5
- };
6
-
7
- /**
8
- * Class Colorlib_Login_Customizer_Customizer
9
- */
10
- class Colorlib_Login_Customizer_Customizer {
11
- /**
12
- * @var
13
- */
14
- public $settings;
15
- /**
16
- * The main plugin object.
17
- *
18
- * @var object
19
- * @access public
20
- * @since 1.0.0
21
- */
22
- public $parent = null;
23
-
24
- /**
25
- * Colorlib_Login_Customizer_Customizer constructor.
26
- *
27
- * @param $parent
28
- * @param $manager
29
- */
30
- public function __construct( $parent, $manager ) {
31
- //Plugin object
32
- $this->parent = $parent;
33
- // Initialise settings
34
- $this->init_settings();
35
- // Register plugin sections and settings
36
- $this->register_settings( $manager );
37
- // Load customizer assets
38
- add_action( 'customize_controls_enqueue_scripts', array( $this, 'customizer_enqueue_scripts' ), 25 );
39
- add_action( 'customize_preview_init', array( $this, 'customize_preview_styles' ), 25 );
40
- }
41
-
42
- /**
43
- * Initialise settings
44
- *
45
- * @return void
46
- */
47
- public function init_settings() {
48
- $this->settings = $this->settings_fields();
49
- }
50
-
51
- private function generate_name( $id ) {
52
- return $this->parent->key_name . '[' . $id . ']';
53
- }
54
-
55
- /**
56
- * Build settings fields
57
- *
58
- * @return array Fields to be displayed on settings page
59
- */
60
- private function settings_fields() {
61
- $settings['templates'] = array(
62
- 'title' => esc_html__( 'Templates', 'colorlib-login-customizer' ),
63
- 'description' => '',
64
- 'fields' => array(
65
- array(
66
- 'id' => 'templates',
67
- 'label' => esc_html__( 'Temapltes', 'colorlib-login-customizer' ),
68
- 'description' => '',
69
- 'type' => 'clc-templates',
70
- 'default' => 'default',
71
- 'choices' => array(
72
- 'default' => array(
73
- 'url' => esc_url( $this->parent->assets_url ) . 'img/default.jpg',
74
- 'options' => array(
75
- /**
76
- * Layout
77
- */
78
- 'columns' => '1',
79
- 'columns-width' => array(
80
- 'left' => 6,
81
- 'right' => 6,
82
- ),
83
- 'form-column-align' => '3',
84
- 'form-vertical-align' => '2',
85
- /**
86
- * Logo section
87
- */
88
- 'hide-logo' => 0,
89
- 'use-text-logo' => 0,
90
- 'logo-text' => '',
91
- 'custom-logo-url' => '',
92
- 'custom-logo' => '',
93
- 'logo-text-color' => '#444',
94
- 'logo-text-size' => '20',
95
- 'logo-text-color-hover' => '#00a0d2',
96
- 'logo-width' => '84',
97
- 'logo-height' => '84',
98
- /**
99
- * Background section
100
- */
101
- 'custom-background' => '',
102
- 'custom-background-form' => '',
103
- 'custom-background-color' => '#f1f1f1',
104
- 'custom-background-color-form' => '#f1f1f1',
105
- /**
106
- * Form section
107
- */
108
- 'form-width' => '320',
109
- 'form-height' => '297',
110
- 'form-background-image' => '',
111
- 'form-background-color' => '#ffffff',
112
- 'form-padding' => '26px 24px',
113
- 'form-border' => '0 none',
114
- 'form-shadow' => '0 1px 3px rgba(0,0,0,.13)',
115
- 'form-border-radius' => 'unset',
116
- 'form-field-border-radius' => 'unset',
117
- 'form-field-border' => '1px solid #ddd',
118
- 'form-field-width' => '',
119
- 'form-field-margin' => '2px 6px 16px 0',
120
- 'form-field-background' => '#fbfbfb',
121
- 'form-field-color' => '#32373c',
122
- 'form-label-color' => '#72777c',
123
- 'hide-extra-links' => 0,
124
- 'username-label' => 'Username or Email Address',
125
- 'password-label' => 'Password',
126
- /**
127
- * Others section ( misc )
128
- */
129
- 'button-background' => '#0085ba',
130
- 'button-background-hover' => '#008ec2',
131
- 'button-border-color' => '#0073aa',
132
- 'button-border-color-hover' => '#006799',
133
- 'button-shadow' => '0 1px 0 #006799',
134
- 'button-text-shadow' => '0 -1px 1px #006799, 1px 0 1px #006799, 0 1px 1px #006799, -1px 0 1px #006799',
135
- 'button-color' => '#ffffff',
136
- 'link-color' => '#555d66',
137
- 'link-color-hover' => '#00a0d2',
138
- 'hide-rememberme' => false,
139
- 'custom-css' => '',
140
- ),
141
- ),
142
- 'template-01' => array(
143
- 'url' => esc_url( $this->parent->assets_url ) . 'img/template-01.jpg',
144
- 'options' => array(
145
- 'columns' => '2',
146
- 'form-column-align' => '1',
147
- 'form-background-color' => 'rgba(255, 255, 255, 1)',
148
- 'custom-background' => esc_url( $this->parent->assets_url ) . 'img/background.jpg',
149
- 'custom-css' => '',
150
- ),
151
- ),
152
- 'template-02' => array(
153
- 'url' => esc_url( $this->parent->assets_url ) . 'img/template-02.jpg',
154
- 'options' => array(
155
- 'hide-logo' => '1',
156
- 'hide-extra-links' => '1',
157
- 'custom-background' => esc_url( $this->parent->assets_url ) . 'img/background-1.jpg',
158
- 'form-background-color' => 'rgba(255, 255, 255, 0)',
159
- 'form-shadow' => 'none',
160
- 'custom-css' => '',
161
- ),
162
- ),
163
- 'template-03' => array(
164
- 'url' => esc_url( $this->parent->assets_url ) . 'img/tpl-03/screen.jpg',
165
- 'options' => array(
166
- 'columns' => '2',
167
- 'columns-width' => array(
168
- 'left' => 8,
169
- 'right' => 4,
170
- ),
171
- /**
172
- * Form section
173
- */
174
- 'form-width' => '430',
175
- 'form-height' => '350',
176
- 'form-column-align' => '3',
177
- 'hide-logo' => '1',
178
- 'hide-extra-links' => '1',
179
- 'custom-background-color' => '#f7f7f7',
180
- 'custom-background' => esc_url( $this->parent->assets_url ) . 'img/tpl-03/bg.jpg',
181
- 'form-background-color' => 'rgba(255,255,255,0)',
182
- 'form-shadow' => 'none',
183
- 'custom-css' => ".ml-form-container .submit input[type='submit'] {width: 100%; box-sizing: border-box;display: inline-block;text-align: center;border-radius: 30px;padding: 0 20px;height: 38px;line-height: 1;font-weight: bold;vertical-align: middle; }",
184
- 'form-field-background' => '#f7f7f7',
185
- 'button-background' => '#6675df',
186
- 'button-background-hover' => '#333333',
187
- 'button-border-color' => '#6675df',
188
- 'button-border-color-hover' => '#333333',
189
- 'hide-rememberme' => '1',
190
- /**
191
- * Logo section
192
- */
193
- 'hide-logo' => 0,
194
- 'use-text-logo' => 1,
195
- 'logo-text' => 'Login to continue',
196
- 'custom-logo-url' => '',
197
- 'custom-logo' => '',
198
- 'logo-text-color' => '#333',
199
- 'logo-text-size' => '30',
200
- 'logo-text-color-hover' => '#00a0d2',
201
- 'logo-width' => '350',
202
- 'logo-height' => '0',
203
- 'username-label' => 'Username',
204
- 'password-label' => 'Password',
205
- ),
206
- ),
207
- 'template-04' => array(
208
- 'url' => esc_url( $this->parent->assets_url ) . 'img/tpl-04/screen.jpg',
209
- 'options' => array(
210
- 'form-width' => '350',
211
- 'form-height' => '350',
212
- 'form-padding' => '50px 30px',
213
- 'columns' => '1',
214
- 'hide-logo' => '1',
215
- 'hide-extra-links' => 0,
216
- 'custom-background-color' => '#e9faff',
217
- 'custom-background' => '',
218
- 'form-background-color' => 'rgba(255,255,255,1)',
219
- 'form-shadow' => 'none',
220
- 'form-field-background' => '#FFF',
221
- 'button-background' => '#4272d7',
222
- 'button-background-hover' => '#333333',
223
- 'button-border-color' => '#4272d7',
224
- 'button-border-color-hover' => '#333333',
225
- 'hide-rememberme' => 1,
226
- /**
227
- * Logo section
228
- */
229
- 'hide-logo' => 0,
230
- 'use-text-logo' => 1,
231
- 'logo-text' => 'Account Login',
232
- 'custom-logo-url' => '',
233
- 'custom-logo' => '',
234
- 'logo-text-color' => '#333',
235
- 'logo-text-size' => '20',
236
- 'logo-text-color-hover' => '#00a0d2',
237
- 'logo-width' => '350',
238
- 'logo-height' => '0',
239
- 'username-label' => '',
240
- 'password-label' => '',
241
- 'form-shadow' => '0 3px 20px 0px rgba(0, 0, 0, 0.1)',
242
- 'custom-css' => '',
243
- 'form-field-border-radius' => '0',
244
- 'form-field-margin' => '0',
245
- 'form-field-border' => '1px solid #eee',
246
- 'custom-css' => ".ml-form-container .submit input[type='submit'] {width: 100%; box-sizing: border-box;display: inline-block;text-align: center;padding: 0 20px;height: 38px;line-height: 1;font-weight: bold;vertical-align: middle; margin-top: 15px;} .ml-form-container input[type='text'], .ml-form-container input[type='password'] { height: 50px; } .login .ml-form-container #backtoblog,.login .ml-form-container #nav{position:absolute;left:0;right:0;margin-right:auto!important;bottom:50px;max-width:100%;text-align:center}.login .ml-form-container #nav{bottom:40px}.ml-form-container #login>h1{position:absolute;top:50px}",
247
- ),
248
- ),
249
- ),
250
- ),
251
- ),
252
- );
253
-
254
- $settings['logo'] = array(
255
- 'title' => esc_html__( 'Logo options', 'colorlib-login-customizer' ),
256
- 'description' => '',
257
- 'fields' => array(
258
- array(
259
- 'id' => 'hide-logo',
260
- 'label' => esc_html__( 'Hide Logo', 'colorlib-login-customizer' ),
261
- 'description' => esc_html__( 'Show/Hide the logo from login page', 'colorlib-login-customizer' ),
262
- 'type' => 'clc-toggle',
263
- 'default' => 0,
264
- ),
265
- array(
266
- 'id' => 'use-text-logo',
267
- 'label' => esc_html__( 'Use Text Logo', 'colorlib-login-customizer' ),
268
- 'description' => esc_html__( 'Show/Hide the logo text from login page', 'colorlib-login-customizer' ),
269
- 'type' => 'clc-toggle',
270
- 'default' => 0,
271
- ),
272
- array(
273
- 'id' => 'logo-text',
274
- 'label' => esc_html__( 'Logo text', 'colorlib-login-customizer' ),
275
- 'description' => esc_html__( 'This is will be your logo.', 'colorlib-login-customizer' ),
276
- 'type' => 'text',
277
- 'default' => '',
278
- 'active_callback' => array( $this, 'check_if_text_logo' ),
279
- ),
280
- array(
281
- 'id' => 'logo-text-color',
282
- 'label' => esc_html__( 'Logo text color', 'colorlib-login-customizer' ),
283
- 'description' => esc_html__( 'This will change the color text property.', 'colorlib-login-customizer' ),
284
- 'type' => 'color',
285
- 'default' => '#444',
286
- 'active_callback' => array( $this, 'check_if_text_logo' ),
287
- ),
288
- array(
289
- 'id' => 'logo-text-color-hover',
290
- 'label' => esc_html__( 'Logo text color hover', 'colorlib-login-customizer' ),
291
- 'description' => esc_html__( 'This will change the color text property on hover.', 'colorlib-login-customizer' ),
292
- 'type' => 'color',
293
- 'default' => '#00a0d2',
294
- 'active_callback' => array( $this, 'check_if_text_logo' ),
295
- ),
296
- array(
297
- 'id' => 'logo-text-size',
298
- 'label' => esc_html__( 'Logo text size', 'colorlib-login-customizer' ),
299
- 'description' => esc_html__( 'This will change the text size of logo.', 'colorlib-login-customizer' ),
300
- 'default' => 20,
301
- 'choices' => array(
302
- 'min' => 10,
303
- 'max' => 120,
304
- 'step' => 1,
305
- ),
306
- 'type' => 'clc-range-slider',
307
- 'active_callback' => array( $this, 'check_if_text_logo' ),
308
- ),
309
- array(
310
- 'id' => 'custom-logo-url',
311
- 'label' => esc_html__( 'Custom logo URL', 'colorlib-login-customizer' ),
312
- 'description' => esc_html__( 'This is where the logo will link to.', 'colorlib-login-customizer' ),
313
- 'type' => 'text',
314
- 'default' => esc_url( get_home_url() ),
315
- ),
316
- array(
317
- 'id' => 'custom-logo',
318
- 'label' => esc_html__( 'Custom logo', 'colorlib-login-customizer' ),
319
- 'description' => esc_html__( 'This will upload an image to your media library and store the attachment ID in the option field. Once you have uploaded an imge the thumbnail will display above these buttons.', 'colorlib-login-customizer' ),
320
- 'type' => 'image',
321
- 'default' => '',
322
- 'active_callback' => array( $this, 'check_if_not_text_logo' ),
323
- ),
324
- array(
325
- 'id' => 'logo-width',
326
- 'label' => esc_html__( 'Logo Width', 'colorlib-login-customizer' ),
327
- 'description' => esc_html__( 'Make sure you set the logo width to match your image.', 'colorlib-login-customizer' ),
328
- 'default' => 84,
329
- 'choices' => array(
330
- 'min' => 0,
331
- 'max' => 1000,
332
- 'step' => 5,
333
- ),
334
- 'type' => 'clc-range-slider',
335
- ),
336
- array(
337
- 'id' => 'logo-height',
338
- 'label' => esc_html__( 'Logo Height', 'colorlib-login-customizer' ),
339
- 'description' => esc_html__( 'Make sure you set the logo height to match your image.', 'colorlib-login-customizer' ),
340
- 'default' => 20,
341
- 'choices' => array(
342
- 'min' => 0,
343
- 'max' => 1000,
344
- 'step' => 5,
345
- ),
346
- 'type' => 'clc-range-slider',
347
- ),
348
- ),
349
- );
350
-
351
- $settings['layout'] = array(
352
- 'title' => esc_html__( 'Layout options', 'colorlib-login-customizer' ),
353
- 'description' => '',
354
- 'fields' => array(
355
- array(
356
- 'id' => 'columns',
357
- 'label' => esc_html__( 'Columns', 'colorlib-login-customizer' ),
358
- 'description' => '',
359
- 'default' => 1,
360
- 'choices' => array(
361
- 1 => array(
362
- 'value' => 1,
363
- 'png' => COLORLIB_LOGIN_CUSTOMIZER_URL . '/assets/img/one-column.png',
364
- ),
365
- 2 => array(
366
- 'value' => 2,
367
- 'png' => COLORLIB_LOGIN_CUSTOMIZER_URL . '/assets/img/two-column.png',
368
- ),
369
- ),
370
- 'type' => 'clc-button-group',
371
- ),
372
- array(
373
- 'id' => 'columns-width',
374
- 'label' => esc_html__( 'Columns Width', 'colorlib-login-customizer' ),
375
- 'description' => '',
376
- 'type' => 'clc-column-width',
377
- 'active_callback' => array( $this, 'check_two_column_layout' ),
378
- ),
379
- array(
380
- 'id' => 'form-column-align',
381
- 'label' => esc_html__( 'Form Column Alignment', 'colorlib-login-customizer' ),
382
- 'description' => '',
383
- 'default' => 3,
384
- 'choices' => array(
385
- 'left' => array(
386
- 'value' => 1,
387
- 'png' => COLORLIB_LOGIN_CUSTOMIZER_URL . '/assets/img/form-align-left.jpg',
388
- ),
389
- 'top' => array(
390
- 'value' => 2,
391
- 'png' => COLORLIB_LOGIN_CUSTOMIZER_URL . '/assets/img/form-align-top.jpg',
392
- ),
393
- 'right' => array(
394
- 'value' => 3,
395
- 'png' => COLORLIB_LOGIN_CUSTOMIZER_URL . '/assets/img/form-align-right.jpg',
396
- ),
397
- 'bottom' => array(
398
- 'value' => 4,
399
- 'png' => COLORLIB_LOGIN_CUSTOMIZER_URL . '/assets/img/form-align-bottom.jpg',
400
- ),
401
- ),
402
- 'type' => 'clc-button-group',
403
- 'active_callback' => array( $this, 'check_two_column_layout' ),
404
- ),
405
- array(
406
- 'id' => 'form-vertical-align',
407
- 'label' => esc_html__( 'Form Vertical Alignment', 'colorlib-login-customizer' ),
408
- 'description' => '',
409
- 'default' => 2,
410
- 'choices' => array(
411
- 'top' => array(
412
- 'value' => 1,
413
- 'png' => COLORLIB_LOGIN_CUSTOMIZER_URL . '/assets/img/form-vertical-align-top.png',
414
- ),
415
- 'middle' => array(
416
- 'value' => 2,
417
- 'png' => COLORLIB_LOGIN_CUSTOMIZER_URL . '/assets/img/form-vertical-align-middle.png',
418
- ),
419
- 'bottom' => array(
420
- 'value' => 3,
421
- 'png' => COLORLIB_LOGIN_CUSTOMIZER_URL . '/assets/img/form-vertical-align-bottom.png',
422
- ),
423
- ),
424
- 'type' => 'clc-button-group',
425
- ),
426
- array(
427
- 'id' => 'form-horizontal-align',
428
- 'label' => esc_html__( 'Form Horizontal Alignment', 'colorlib-login-customizer' ),
429
- 'description' => '',
430
- 'default' => 2,
431
- 'choices' => array(
432
- 'left' => array(
433
- 'value' => 1,
434
- 'png' => COLORLIB_LOGIN_CUSTOMIZER_URL . '/assets/img/form-horizontal-align-left.png',
435
- ),
436
- 'middle' => array(
437
- 'value' => 2,
438
- 'png' => COLORLIB_LOGIN_CUSTOMIZER_URL . '/assets/img/form-vertical-align-middle.png',
439
- ),
440
- 'right' => array(
441
- 'value' => 3,
442
- 'png' => COLORLIB_LOGIN_CUSTOMIZER_URL . '/assets/img/form-horizontal-align-right.png',
443
- ),
444
- ),
445
- 'type' => 'clc-button-group',
446
- ),
447
- ),
448
- );
449
-
450
- $settings['background'] = array(
451
- 'title' => esc_html__( 'Background options', 'colorlib-login-customizer' ),
452
- 'description' => '',
453
- 'fields' => array(
454
- array(
455
- 'id' => 'custom-background-color',
456
- 'label' => esc_html__( 'Custom background color', 'colorlib-login-customizer' ),
457
- 'description' => esc_html__( 'This will change the background color property.', 'colorlib-login-customizer' ),
458
- 'type' => 'color',
459
- 'default' => '#f1f1f1',
460
- ),
461
- array(
462
- 'id' => 'custom-background',
463
- 'label' => esc_html__( 'Custom background', 'colorlib-login-customizer' ),
464
- 'description' => esc_html__( 'This will upload an image to your media library and store the attachment ID in the option field. Once you have uploaded an imge the thumbnail will display above these buttons.', 'colorlib-login-customizer' ),
465
- 'type' => 'image',
466
- 'default' => '',
467
- ),
468
- array(
469
- 'id' => 'custom-background-color-form',
470
- 'label' => esc_html__( 'Form Column background color', 'colorlib-login-customizer' ),
471
- 'description' => esc_html__( 'This will change the background color property.', 'colorlib-login-customizer' ),
472
- 'type' => 'color',
473
- 'default' => '#f1f1f1',
474
- 'active_callback' => array( $this, 'check_two_column_layout' ),
475
- ),
476
- array(
477
- 'id' => 'custom-background-form',
478
- 'label' => esc_html__( 'Form Column background', 'colorlib-login-customizer' ),
479
- 'description' => esc_html__( 'This will upload an image to your media library and store the attachment ID in the option field. Once you have uploaded an imge the thumbnail will display above these buttons.', 'colorlib-login-customizer' ),
480
- 'type' => 'image',
481
- 'default' => '',
482
- 'active_callback' => array( $this, 'check_two_column_layout' ),
483
- ),
484
- ),
485
- );
486
-
487
- $settings['form'] = array(
488
- 'title' => esc_html__( 'Form options', 'colorlib-login-customizer' ),
489
- 'description' => '',
490
- 'fields' => array(
491
- array(
492
- 'id' => 'form-width',
493
- 'label' => esc_html__( 'Form Width', 'colorlib-login-customizer' ),
494
- 'description' => esc_html__( 'Please input the desired width for the login form in pixels. Example: 20', 'colorlib-login-customizer' ),
495
- 'default' => 320,
496
- 'type' => 'clc-range-slider',
497
- 'choices' => array(
498
- 'min' => 150,
499
- 'max' => 1000,
500
- 'step' => 5,
501
- ),
502
- ),
503
- array(
504
- 'id' => 'form-height',
505
- 'label' => esc_html__( 'Form Height', 'colorlib-login-customizer' ),
506
- 'description' => esc_html__( 'Please input the desired height for the login form in pixels. Example: 20', 'colorlib-login-customizer' ),
507
- 'default' => 194,
508
- 'choices' => array(
509
- 'min' => 150,
510
- 'max' => 1000,
511
- 'step' => 5,
512
- ),
513
- 'type' => 'clc-range-slider',
514
- ),
515
- array(
516
- 'id' => 'form-background-image',
517
- 'label' => esc_html__( 'Form background image', 'colorlib-login-customizer' ),
518
- 'description' => esc_html__( 'This will change the background image property of login form.', 'colorlib-login-customizer' ),
519
- 'type' => 'image',
520
- 'default' => '',
521
- ),
522
- array(
523
- 'id' => 'form-background-color',
524
- 'label' => esc_html__( 'Form background color', 'colorlib-login-customizer' ),
525
- 'description' => esc_html__( 'This will change the background color property.', 'colorlib-login-customizer' ),
526
- 'type' => 'color',
527
- 'default' => '#ffffff',
528
- ),
529
- array(
530
- 'id' => 'form-padding',
531
- 'label' => esc_html__( 'Form padding', 'colorlib-login-customizer' ),
532
- 'description' => esc_html__( 'This will change the padding property. Example: 26px 24px 46px 30px', 'colorlib-login-customizer' ),
533
- 'type' => 'text',
534
- 'default' => '26px 24px',
535
- ),
536
- array(
537
- 'id' => 'form-border',
538
- 'label' => esc_html__( 'Form border', 'colorlib-login-customizer' ),
539
- 'description' => esc_html__( 'This will change the border property. Example: 2px dotted black', 'colorlib-login-customizer' ),
540
- 'type' => 'text',
541
- 'default' => '0 none',
542
- ),
543
- array(
544
- 'id' => 'form-border-radius',
545
- 'label' => esc_html__( 'Form border radius', 'colorlib-login-customizer' ),
546
- 'description' => esc_html__( 'This will change the border radius property. Example: 2px 2px 2px 2px', 'colorlib-login-customizer' ),
547
- 'type' => 'text',
548
- 'default' => '0',
549
- ),
550
- array(
551
- 'id' => 'form-shadow',
552
- 'label' => esc_html__( 'Form shadow', 'colorlib-login-customizer' ),
553
- 'description' => esc_html__( 'This will change the form\'s shadow property. Example: 0 1px 0 #006799', 'colorlib-login-customizer' ),
554
- 'type' => 'text',
555
- 'default' => '0 1px 3px rgba(0,0,0,.13)',
556
- ),
557
- array(
558
- 'id' => 'form-field-width',
559
- 'label' => esc_html__( 'Form field width', 'colorlib-login-customizer' ),
560
- 'description' => esc_html__( 'Please input the desired width for the form field in pixels. Example: 20', 'colorlib-login-customizer' ),
561
- 'type' => 'text',
562
- 'default' => '100%',
563
- ),
564
- array(
565
- 'id' => 'form-field-margin',
566
- 'label' => esc_html__( 'Form field margin', 'colorlib-login-customizer' ),
567
- 'description' => esc_html__( 'This will change the margin property. Example: 26px 24px 46px 30px', 'colorlib-login-customizer' ),
568
- 'type' => 'text',
569
- 'default' => '2px 6px 16px 0',
570
- ),
571
- array(
572
- 'id' => 'form-field-border',
573
- 'label' => esc_html__( 'Form field border', 'colorlib-login-customizer' ),
574
- 'description' => esc_html__( 'Please input the desired border for the form field. Example: 2px dotted black', 'colorlib-login-customizer' ),
575
- 'type' => 'text',
576
- 'default' => '1px solid #ddd',
577
- ),
578
- array(
579
- 'id' => 'form-field-border-radius',
580
- 'label' => esc_html__( 'Form field border radius', 'colorlib-login-customizer' ),
581
- 'description' => esc_html__( 'Please input the desired border radiuse for the form field. Example: 5px 5px 5px 5px', 'colorlib-login-customizer' ),
582
- 'type' => 'text',
583
- 'default' => 'unset',
584
- ),
585
- array(
586
- 'id' => 'form-field-background',
587
- 'label' => esc_html__( 'Form field background', 'colorlib-login-customizer' ),
588
- 'description' => esc_html__( 'This will change the background color property.', 'colorlib-login-customizer' ),
589
- 'type' => 'color',
590
- 'default' => '#fbfbfb',
591
- ),
592
- array(
593
- 'id' => 'form-field-color',
594
- 'label' => esc_html__( 'Form field color', 'colorlib-login-customizer' ),
595
- 'description' => esc_html__( 'This will change the text color property.', 'colorlib-login-customizer' ),
596
- 'type' => 'color',
597
- 'default' => '#32373c',
598
- ),
599
- array(
600
- 'id' => 'form-label-color',
601
- 'label' => esc_html__( 'Form label color', 'colorlib-login-customizer' ),
602
- 'description' => esc_html__( 'This will change the label text color property.', 'colorlib-login-customizer' ),
603
- 'type' => 'color',
604
- 'default' => '#72777c',
605
- ),
606
- array(
607
- 'id' => 'username-label',
608
- 'label' => esc_html__( 'Username label', 'colorlib-login-customizer' ),
609
- 'description' => esc_html__( 'You can change the default text for username label or just delete it.', 'colorlib-login-customizer' ),
610
- 'type' => 'text',
611
- 'default' => 'Username or Email Address',
612
- ),
613
- array(
614
- 'id' => 'password-label',
615
- 'label' => esc_html__( 'Password label', 'colorlib-login-customizer' ),
616
- 'description' => esc_html__( 'You can change the default text for password label or just delete it.', 'colorlib-login-customizer' ),
617
- 'type' => 'text',
618
- 'default' => 'Password',
619
- ),
620
- array(
621
- 'id' => 'hide-extra-links',
622
- 'label' => esc_html__( 'Hide Extra Links', 'colorlib-login-customizer' ),
623
- 'description' => esc_html__( 'Show/Hide the links under the login form', 'colorlib-login-customizer' ),
624
- 'type' => 'clc-toggle',
625
- 'default' => 0,
626
- ),
627
- ),
628
- );
629
-
630
- $settings['general'] = array(
631
- 'title' => esc_html__( 'Form Button & Links', 'colorlib-login-customizer' ),
632
- 'description' => '',
633
- 'fields' => array(
634
- array(
635
- 'id' => 'button-background',
636
- 'label' => esc_html__( 'Button background', 'colorlib-login-customizer' ),
637
- 'description' => esc_html__( 'This will change the submit button\'s background property', 'colorlib-login-customizer' ),
638
- 'type' => 'color',
639
- 'default' => '#0085ba',
640
- ),
641
- array(
642
- 'id' => 'button-background-hover',
643
- 'label' => esc_html__( 'Button background hover state', 'colorlib-login-customizer' ),
644
- 'description' => esc_html__( 'This will change the submit button\'s background property on hover', 'colorlib-login-customizer' ),
645
- 'type' => 'color',
646
- 'default' => '#008ec2',
647
- ),
648
- array(
649
- 'id' => 'button-border-color',
650
- 'label' => esc_html__( 'Button border color', 'colorlib-login-customizer' ),
651
- 'description' => esc_html__( 'This will change the submit button\'s border color property', 'colorlib-login-customizer' ),
652
- 'type' => 'color',
653
- 'default' => '#0073aa',
654
- ),
655
- array(
656
- 'id' => 'button-border-color-hover',
657
- 'label' => esc_html__( 'Button border hover state', 'colorlib-login-customizer' ),
658
- 'description' => esc_html__( 'This will change the submit button\'s border property on hover', 'colorlib-login-customizer' ),
659
- 'type' => 'color',
660
- 'default' => '#006799',
661
- ),
662
- array(
663
- 'id' => 'button-shadow',
664
- 'label' => esc_html__( 'Button shadow', 'colorlib-login-customizer' ),
665
- 'description' => esc_html__( 'This will change the submit button\'s shadow property. Example: 0 1px 0 #006799', 'colorlib-login-customizer' ),
666
- 'type' => 'text',
667
- 'default' => '0 1px 0 #006799',
668
- ),
669
- array(
670
- 'id' => 'button-text-shadow',
671
- 'label' => esc_html__( 'Button text shadow', 'colorlib-login-customizer' ),
672
- 'description' => esc_html__( 'This will change the submit button text\'s shadow property. Example: 0 -1px 1px #006799', 'colorlib-login-customizer' ),
673
- 'type' => 'text',
674
- 'default' => '0 -1px 1px #006799',
675
- ),
676
- array(
677
- 'id' => 'button-color',
678
- 'label' => esc_html__( 'Button color', 'colorlib-login-customizer' ),
679
- 'description' => esc_html__( 'This will change the submit button\'s text color property', 'colorlib-login-customizer' ),
680
- 'type' => 'color',
681
- 'default' => '#ffffff',
682
- ),
683
- array(
684
- 'id' => 'link-color',
685
- 'label' => esc_html__( 'Link color', 'colorlib-login-customizer' ),
686
- 'description' => esc_html__( 'This will change the text color of links that are underneath the login form', 'colorlib-login-customizer' ),
687
- 'type' => 'color',
688
- 'default' => '#555d66',
689
- ),
690
- array(
691
- 'id' => 'link-color-hover',
692
- 'label' => esc_html__( 'Link color hover', 'colorlib-login-customizer' ),
693
- 'description' => esc_html__( 'This will change the text color of links, that are underneath the login form, on hover', 'colorlib-login-customizer' ),
694
- 'type' => 'color',
695
- 'default' => '#00a0d2',
696
- ),
697
- array(
698
- 'id' => 'hide-rememberme',
699
- 'label' => esc_html__( 'Hide "Remember Me"', 'colorlib-login-customizer' ),
700
- 'description' => esc_html__( 'Show/Hide the "Remember Me" checkbox', 'colorlib-login-customizer' ),
701
- 'type' => 'clc-toggle',
702
- 'default' => 0,
703
- ),
704
- ),
705
- );
706
-
707
- $settings['clc-custom-css'] = array(
708
- 'title' => esc_html__( 'Custom CSS', 'colorlib-login-customizer' ),
709
- 'description' => '',
710
- 'fields' => array(
711
- array(
712
- 'id' => 'custom-css',
713
- 'label' => __( 'CSS code', 'colorlib-login-customizer' ),
714
- 'description' => '',
715
- 'code_type' => 'text/css',
716
- 'type' => 'custom-css',
717
- 'input_attrs' => array(
718
- 'aria-describedby' => 'editor-keyboard-trap-help-1 editor-keyboard-trap-help-2 editor-keyboard-trap-help-3 editor-keyboard-trap-help-4',
719
- ),
720
- ),
721
- ),
722
- );
723
-
724
- $settings = apply_filters( $this->parent->_token . '_settings_fields', $settings );
725
-
726
- return $settings;
727
- }
728
-
729
- /**
730
- * Register settings in the customizer
731
- */
732
- public function register_settings( $manager ) {
733
- $manager->add_panel(
734
- 'clc_main_panel',
735
- array(
736
- 'capability' => 'edit_theme_options',
737
- 'theme_supports' => '',
738
- 'title' => esc_html__( 'Colorlib Login Customizer', 'colorlib-login-customizer' ),
739
- )
740
- );
741
-
742
- foreach ( $this->settings as $section => $properties ) {
743
- $manager->add_section(
744
- 'clc_' . $section,
745
- array(
746
- 'title' => $properties['title'],
747
- 'description' => $properties['description'],
748
- 'panel' => 'clc_main_panel',
749
- )
750
- );
751
-
752
- foreach ( $properties['fields'] as $setting ) {
753
- $key_name = $this->generate_name( $setting['id'] );
754
- $settings_args = array(
755
- 'type' => 'option',
756
- 'transport' => 'postMessage',
757
- );
758
-
759
- if ( isset( $setting['default'] ) ) {
760
- $settings_args['default'] = $setting['default'];
761
- }
762
-
763
- $manager->add_setting( $key_name, $settings_args );
764
-
765
- $control_args = array(
766
- 'label' => $setting['label'],
767
- 'description' => $setting['description'],
768
- 'section' => 'clc_' . $section,
769
- );
770
-
771
- if ( isset( $setting['active_callback'] ) ) {
772
- $control_args['active_callback'] = $setting['active_callback'];
773
- }
774
-
775
- if ( isset( $setting['choices'] ) ) {
776
- $control_args['choices'] = $setting['choices'];
777
- }
778
-
779
- if ( isset( $setting['code_type'] ) ) {
780
- $control_args['code_type'] = $setting['code_type'];
781
- }
782
-
783
- if ( isset( $setting['input_attrs'] ) ) {
784
- $control_args['input_attrs'] = $setting['input_attrs'];
785
- }
786
-
787
- switch ( $setting['type'] ) {
788
- case 'image':
789
- $manager->add_control(
790
- new WP_Customize_Image_Control( $manager, $key_name, $control_args )
791
- );
792
- break;
793
- case 'color':
794
- $manager->add_control(
795
- new Colorlib_Login_Customizer_Control_Color_Picker( $manager, $key_name, $control_args )
796
- );
797
- break;
798
- case 'clc-range-slider':
799
- $manager->add_control(
800
- new Colorlib_Login_Customizer_Range_Slider_Control( $manager, $key_name, $control_args )
801
- );
802
- break;
803
- case 'clc-templates':
804
- $manager->add_control(
805
- new Colorlib_Login_Customizer_Template_Control( $manager, $key_name, $control_args )
806
- );
807
- break;
808
- case 'clc-button-group':
809
- $manager->add_control(
810
- new Colorlib_Login_Customizer_Button_Group_Control( $manager, $key_name, $control_args )
811
- );
812
- break;
813
- case 'clc-column-width':
814
- $manager->add_control(
815
- new Colorlib_Login_Customizer_Column_Width( $manager, $key_name, $control_args )
816
- );
817
- break;
818
- case 'clc-toggle':
819
- $manager->add_control(
820
- new Colorlib_Login_Customizer_Control_Toggle( $manager, $key_name, $control_args )
821
- );
822
- break;
823
- case 'custom-css':
824
- $manager->add_control(
825
- new WP_Customize_Code_Editor_Control( $manager, $key_name, $control_args )
826
- );
827
- break;
828
- default:
829
- $manager->add_control( $key_name, $control_args );
830
- break;
831
- }
832
- }
833
- }
834
-
835
- }
836
-
837
- /**
838
- * Binds JS handlers to make Theme Customizer preview reload changes asynchronously.
839
- */
840
- public function customize_preview_styles() {
841
- wp_enqueue_style( 'colorlib-login-customizer-previewer', esc_url( $this->parent->assets_url ) . 'css/clc-customizer-previewer.css' );
842
- wp_enqueue_script( 'colorlib-login-customizer-preview', esc_url( $this->parent->assets_url ) . 'js/clc-preview.js', array( 'customize-preview' ), false, true );
843
- }
844
-
845
- /*
846
- * Our Customizer script
847
- *
848
- * Dependencies: Customizer Controls script (core)
849
- */
850
- public function customizer_enqueue_scripts() {
851
- wp_enqueue_style( 'colorlib-login-customizer-minicolors-styles', esc_url( $this->parent->assets_url ) . 'css/jquery.minicolors.css' );
852
- wp_enqueue_style( 'colorlib-login-customizer-styles', esc_url( $this->parent->assets_url ) . 'css/clc-customizer.css' );
853
- wp_enqueue_script(
854
- 'colorlib-login-customizer-minicolors-script', esc_url( $this->parent->assets_url ) . 'js/jquery.minicolors.js', array(
855
- 'jquery',
856
- ), false, true
857
- );
858
- wp_enqueue_script(
859
- 'colorlib-login-customizer-script', esc_url( $this->parent->assets_url ) . 'js/clc-customizer.js', array(
860
- 'jquery',
861
- 'customize-controls',
862
- 'colorlib-login-customizer-minicolors-script',
863
- ), false, true
864
- );
865
-
866
- wp_localize_script(
867
- 'colorlib-login-customizer-script', 'CLCUrls', array(
868
- 'siteurl' => get_option( 'siteurl' ),
869
- )
870
- );
871
- }
872
-
873
- // Active callbacks
874
- public function check_two_column_layout( $control ) {
875
- $options = get_option( 'clc-options', array() );
876
-
877
- if ( '2' == $control->manager->get_setting( 'clc-options[columns]' )->value() ) {
878
- return true;
879
- }
880
-
881
- return false;
882
- }
883
-
884
- public function check_if_text_logo( $control ) {
885
- $options = get_option( 'clc-options', array() );
886
-
887
- if ( 1 == $control->manager->get_setting( 'clc-options[use-text-logo]' )->value() ) {
888
- return true;
889
- }
890
-
891
- return false;
892
- }
893
-
894
- public function check_if_not_text_logo( $control ) {
895
- $options = get_option( 'clc-options', array() );
896
-
897
- if ( 1 == $control->manager->get_setting( 'clc-options[use-text-logo]' )->value() ) {
898
- return false;
899
- }
900
-
901
- return true;
902
- }
903
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if ( ! defined( 'ABSPATH' ) ) {
4
+ exit;
5
+ };
6
+
7
+ /**
8
+ * Class Colorlib_Login_Customizer_Customizer
9
+ */
10
+ class Colorlib_Login_Customizer_Customizer {
11
+ /**
12
+ * @var
13
+ */
14
+ public $settings;
15
+ /**
16
+ * The main plugin object.
17
+ *
18
+ * @var object
19
+ * @access public
20
+ * @since 1.0.0
21
+ */
22
+ public $parent = null;
23
+
24
+ /**
25
+ * Colorlib_Login_Customizer_Customizer constructor.
26
+ *
27
+ * @param $parent
28
+ * @param $manager
29
+ */
30
+ public function __construct( $parent, $manager ) {
31
+ //Plugin object
32
+ $this->parent = $parent;
33
+ // Initialise settings
34
+ $this->init_settings();
35
+ // Register plugin sections and settings
36
+ $this->register_settings( $manager );
37
+ // Load customizer assets
38
+ add_action( 'customize_controls_enqueue_scripts', array( $this, 'customizer_enqueue_scripts' ), 25 );
39
+ add_action( 'customize_preview_init', array( $this, 'customize_preview_styles' ), 25 );
40
+ }
41
+
42
+ /**
43
+ * Initialise settings
44
+ *
45
+ * @return void
46
+ */
47
+ public function init_settings() {
48
+ $this->settings = $this->settings_fields();
49
+ }
50
+
51
+ private function generate_name( $id ) {
52
+ return $this->parent->key_name . '[' . $id . ']';
53
+ }
54
+
55
+ /**
56
+ * Build settings fields
57
+ *
58
+ * @return array Fields to be displayed on settings page
59
+ */
60
+ private function settings_fields() {
61
+ $settings['templates'] = array(
62
+ 'title' => esc_html__( 'Templates', 'colorlib-login-customizer' ),
63
+ 'description' => '',
64
+ 'fields' => array(
65
+ array(
66
+ 'id' => 'templates',
67
+ 'label' => esc_html__( 'Temapltes', 'colorlib-login-customizer' ),
68
+ 'description' => '',
69
+ 'type' => 'clc-templates',
70
+ 'default' => 'default',
71
+ 'choices' => array(
72
+ 'default' => array(
73
+ 'url' => esc_url( $this->parent->assets_url ) . 'img/default.jpg',
74
+ 'options' => array(
75
+ /**
76
+ * Layout
77
+ */
78
+ 'columns' => '1',
79
+ 'columns-width' => array(
80
+ 'left' => 6,
81
+ 'right' => 6,
82
+ ),
83
+ 'form-column-align' => '3',
84
+ 'form-vertical-align' => '2',
85
+ /**
86
+ * Logo section
87
+ */
88
+ 'hide-logo' => 0,
89
+ 'use-text-logo' => 0,
90
+ 'logo-url' => site_url(),
91
+ 'custom-logo' => '',
92
+ 'logo-text-color' => '#444',
93
+ 'logo-text-size' => '20',
94
+ 'logo-text-color-hover' => '#00a0d2',
95
+ 'logo-width' => '84',
96
+ 'logo-height' => '84',
97
+ /**
98
+ * Background section
99
+ */
100
+ 'custom-background' => '',
101
+ 'custom-background-form' => '',
102
+ 'custom-background-color' => '#f1f1f1',
103
+ 'custom-background-color-form' => '#f1f1f1',
104
+ /**
105
+ * Form section
106
+ */
107
+ 'form-width' => '320',
108
+ 'form-height' => '297',
109
+ 'form-background-image' => '',
110
+ 'form-background-color' => '#ffffff',
111
+ 'form-padding' => '26px 24px',
112
+ 'form-border' => '0 none',
113
+ 'form-shadow' => '0 1px 3px rgba(0,0,0,.13)',
114
+ 'form-border-radius' => 'unset',
115
+ 'form-field-border-radius' => 'unset',
116
+ 'form-field-border' => '1px solid #ddd',
117
+ 'form-field-width' => '',
118
+ 'form-field-margin' => '2px 6px 16px 0',
119
+ 'form-field-background' => '#fbfbfb',
120
+ 'form-field-color' => '#32373c',
121
+ 'form-label-color' => '#72777c',
122
+ 'hide-extra-links' => 0,
123
+ 'username-label' => 'Username or Email Address',
124
+ 'password-label' => 'Password',
125
+ /**
126
+ * Others section ( misc )
127
+ */
128
+ 'button-background' => '#0085ba',
129
+ 'button-background-hover' => '#008ec2',
130
+ 'button-border-color' => '#0073aa',
131
+ 'button-border-color-hover' => '#006799',
132
+ 'button-shadow' => '0 1px 0 #006799',
133
+ 'button-text-shadow' => '0 -1px 1px #006799, 1px 0 1px #006799, 0 1px 1px #006799, -1px 0 1px #006799',
134
+ 'button-color' => '#ffffff',
135
+ 'link-color' => '#555d66',
136
+ 'link-color-hover' => '#00a0d2',
137
+ 'hide-rememberme' => false,
138
+ 'custom-css' => '',
139
+ ),
140
+ ),
141
+ 'template-01' => array(
142
+ 'url' => esc_url( $this->parent->assets_url ) . 'img/template-01.jpg',
143
+ 'options' => array(
144
+ 'columns' => '2',
145
+ 'form-column-align' => '1',
146
+ 'form-background-color' => 'rgba(255, 255, 255, 1)',
147
+ 'custom-background' => esc_url( $this->parent->assets_url ) . 'img/background.jpg',
148
+ 'custom-css' => '.ml-form-container .submit input[type=\'submit\']{box-shadow:none;}.ml-form-container input[type=\'text\'],.ml-form-container input[type=\'password\']{box-shadow:none;} ',
149
+ 'lost-password-text' => 'Lost your password?',
150
+ 'back-to-text' => 'Back to',
151
+ ),
152
+ ),
153
+ 'template-02' => array(
154
+ 'url' => esc_url( $this->parent->assets_url ) . 'img/template-02.jpg',
155
+ 'options' => array(
156
+ 'hide-logo' => '1',
157
+ 'hide-extra-links' => '1',
158
+ 'custom-background' => esc_url( $this->parent->assets_url ) . 'img/background-1.jpg',
159
+ 'form-background-color' => 'rgba(255, 255, 255, 0)',
160
+ 'form-shadow' => 'none',
161
+ 'custom-css' => '.ml-form-container input[type=\'password\'],.ml-form-container input[type=\'text\']{box-shadow:none;}.ml-form-container .submit input[type=\'submit\']{box-shadow:none;}',
162
+ ),
163
+ ),
164
+ 'template-03' => array(
165
+ 'url' => esc_url( $this->parent->assets_url ) . 'img/tpl-03/screen.jpg',
166
+ 'options' => array(
167
+ 'columns' => '2',
168
+ 'columns-width' => array(
169
+ 'left' => 8,
170
+ 'right' => 4,
171
+ ),
172
+ /**
173
+ * Form section
174
+ */
175
+ 'form-width' => '430',
176
+ 'form-height' => '350',
177
+ 'form-column-align' => '3',
178
+ 'hide-logo' => '1',
179
+ 'hide-extra-links' => '1',
180
+ 'custom-background-color' => '#f7f7f7',
181
+ 'custom-background' => esc_url( $this->parent->assets_url ) . 'img/tpl-03/bg.jpg',
182
+ 'form-background-color' => 'rgba(255,255,255,0)',
183
+ 'form-shadow' => 'none',
184
+ 'custom-css' => ".ml-form-container .submit input[type='submit'] {width: 100%; box-sizing: border-box;display: inline-block;text-align: center;border-radius: 30px;padding: 0 20px;height: 38px;line-height: 1;font-weight: bold;vertical-align: middle;box-shadow:none; }.ml-form-container input[type='password'],.ml-form-container input[type='text']{box-shadow:none;}",
185
+ 'form-field-background' => '#f7f7f7',
186
+ 'button-background' => '#6675df',
187
+ 'button-background-hover' => '#333333',
188
+ 'button-border-color' => '#6675df',
189
+ 'button-border-color-hover' => '#333333',
190
+ 'hide-rememberme' => '1',
191
+ /**
192
+ * Logo section
193
+ */
194
+ 'hide-logo' => 0,
195
+ 'use-text-logo' => 1,
196
+ 'logo-title' => 'Login to continue',
197
+ 'logo-url' => site_url(),
198
+ 'custom-logo' => '',
199
+ 'logo-text-color' => '#333',
200
+ 'logo-text-size' => '30',
201
+ 'logo-text-color-hover' => '#00a0d2',
202
+ 'logo-width' => '350',
203
+ 'logo-height' => '0',
204
+ 'username-label' => 'Username',
205
+ 'password-label' => 'Password',
206
+ ),
207
+ ),
208
+ 'template-04' => array(
209
+ 'url' => esc_url( $this->parent->assets_url ) . 'img/tpl-04/screen.jpg',
210
+ 'options' => array(
211
+ 'form-width' => '350',
212
+ 'form-height' => '450',
213
+ 'form-padding' => '50px 30px',
214
+ 'columns' => '1',
215
+ 'hide-logo' => '1',
216
+ 'hide-extra-links' => 0,
217
+ 'custom-background-color' => '#e9faff',
218
+ 'custom-background' => '',
219
+ 'form-background-color' => 'rgba(255,255,255,1)',
220
+ 'form-shadow' => 'none',
221
+ 'form-field-background' => '#FFF',
222
+ 'button-background' => '#4272d7',
223
+ 'button-background-hover' => '#333333',
224
+ 'button-border-color' => '#4272d7',
225
+ 'button-border-color-hover' => '#333333',
226
+ 'hide-rememberme' => 1,
227
+ /**
228
+ * Logo section
229
+ */
230
+ 'hide-logo' => 0,
231
+ 'use-text-logo' => 1,
232
+ 'logo-title' => 'Account Login',
233
+ 'logo-url' => site_url(),
234
+ 'custom-logo' => '',
235
+ 'logo-text-color' => '#333',
236
+ 'logo-text-size' => '20',
237
+ 'logo-text-color-hover' => '#00a0d2',
238
+ 'logo-width' => '350',
239
+ 'logo-height' => '0',
240
+ 'username-label' => '',
241
+ 'password-label' => '',
242
+ 'form-shadow' => '0 3px 20px 0px rgba(0, 0, 0, 0.1)',
243
+ 'custom-css' => '',
244
+ 'form-field-border-radius' => '0',
245
+ 'form-field-margin' => '0',
246
+ 'form-field-border' => '1px solid #eee',
247
+ 'custom-css' => ".ml-form-container .submit input[type='submit'] {width: 100%; box-sizing: border-box;display: inline-block;text-align: center;padding: 0 20px;height: 38px;line-height: 1;font-weight: bold;vertical-align: middle; margin-top: 15px;box-shadow:none;} .ml-form-container input[type='text'], .ml-form-container input[type='password'] { height: 50px; } .login .ml-form-container #backtoblog,.login .ml-form-container #nav{position:absolute;left:0;right:0;margin-right:auto!important;bottom:50px;max-width:100%;text-align:center}.login .ml-form-container #nav{bottom:40px}.ml-form-container #login>h1{position:absolute;top:40px}.login-action-register .ml-form-container #login>h1{top:65px;}.ml-form-container input[type='text'],.ml-form-container input[type='password']{box-shadow:none;}",
248
+ ),
249
+ ),
250
+ ),
251
+ ),
252
+ ),
253
+ );
254
+
255
+ $settings['logo'] = array(
256
+ 'title' => esc_html__( 'Logo options', 'colorlib-login-customizer' ),
257
+ 'description' => '',
258
+ 'fields' => array(
259
+ array(
260
+ 'id' => 'hide-logo',
261
+ 'label' => esc_html__( 'Hide Logo', 'colorlib-login-customizer' ),
262
+ 'description' => esc_html__( 'Show/Hide the logo from login page', 'colorlib-login-customizer' ),
263
+ 'type' => 'clc-toggle',
264
+ 'default' => 0,
265
+ ),
266
+ array(
267
+ 'id' => 'use-text-logo',
268
+ 'label' => esc_html__( 'Use Text Logo', 'colorlib-login-customizer' ),
269
+ 'description' => esc_html__( 'Show/Hide the logo text from login page', 'colorlib-login-customizer' ),
270
+ 'type' => 'clc-toggle',
271
+ 'default' => 0,
272
+ ),
273
+ array(
274
+ 'id' => 'logo-url',
275
+ 'label' => esc_html__( 'Logo URL', 'colorlib-login-customizer' ),
276
+ 'description' => esc_html__( 'This is where the logo will link to.', 'colorlib-login-customizer' ),
277
+ 'type' => 'text',
278
+ 'default' => site_url(),
279
+ ),
280
+ array(
281
+ 'id' => 'logo-title',
282
+ 'label' => esc_html__( 'Logo Title', 'colorlib-login-customizer' ),
283
+ 'description' => esc_html__( 'The tooltip that will be displayed when hovering over the logo. Also this is used as Logo text when you select "Use Text Logo"', 'colorlib-login-customizer' ),
284
+ 'type' => 'text',
285
+ 'default' => 'Powered by WordPress',
286
+ ),
287
+ array(
288
+ 'id' => 'logo-text-color',
289
+ 'label' => esc_html__( 'Logo text color', 'colorlib-login-customizer' ),
290
+ 'description' => esc_html__( 'This will change the color text property.', 'colorlib-login-customizer' ),
291
+ 'type' => 'color',
292
+ 'default' => '#444',
293
+ 'active_callback' => array( $this, 'check_if_text_logo' ),
294
+ ),
295
+ array(
296
+ 'id' => 'logo-text-color-hover',
297
+ 'label' => esc_html__( 'Logo text color hover', 'colorlib-login-customizer' ),
298
+ 'description' => esc_html__( 'This will change the color text property on hover.', 'colorlib-login-customizer' ),
299
+ 'type' => 'color',
300
+ 'default' => '#00a0d2',
301
+ 'active_callback' => array( $this, 'check_if_text_logo' ),
302
+ ),
303
+ array(
304
+ 'id' => 'logo-text-size',
305
+ 'label' => esc_html__( 'Logo text size', 'colorlib-login-customizer' ),
306
+ 'description' => esc_html__( 'This will change the text size of logo.', 'colorlib-login-customizer' ),
307
+ 'default' => 20,
308
+ 'choices' => array(
309
+ 'min' => 10,
310
+ 'max' => 120,
311
+ 'step' => 1,
312
+ ),
313
+ 'type' => 'clc-range-slider',
314
+ 'active_callback' => array( $this, 'check_if_text_logo' ),
315
+ ),
316
+ array(
317
+ 'id' => 'custom-logo',
318
+ 'label' => esc_html__( 'Custom logo', 'colorlib-login-customizer' ),
319
+ 'description' => esc_html__( 'This will upload an image to your media library and store the attachment ID in the option field. Once you have uploaded an imge the thumbnail will display above these buttons.', 'colorlib-login-customizer' ),
320
+ 'type' => 'image',
321
+ 'default' => '',
322
+ 'active_callback' => array( $this, 'check_if_not_text_logo' ),
323
+ ),
324
+ array(
325
+ 'id' => 'logo-width',
326
+ 'label' => esc_html__( 'Logo Width', 'colorlib-login-customizer' ),
327
+ 'description' => esc_html__( 'Make sure you set the logo width to match your image.', 'colorlib-login-customizer' ),
328
+ 'default' => 84,
329
+ 'choices' => array(
330
+ 'min' => 0,
331
+ 'max' => 1000,
332
+ 'step' => 5,
333
+ ),
334
+ 'type' => 'clc-range-slider',
335
+ 'active_callback' => array( $this, 'check_if_not_text_logo' ),
336
+ ),
337
+ array(
338
+ 'id' => 'logo-height',
339
+ 'label' => esc_html__( 'Logo Height', 'colorlib-login-customizer' ),
340
+ 'description' => esc_html__( 'Make sure you set the logo height to match your image.', 'colorlib-login-customizer' ),
341
+ 'default' => 20,
342
+ 'choices' => array(
343
+ 'min' => 0,
344
+ 'max' => 1000,
345
+ 'step' => 5,
346
+ ),
347
+ 'type' => 'clc-range-slider',
348
+ 'active_callback' => array( $this, 'check_if_not_text_logo' ),
349
+ ),
350
+ ),
351
+ );
352
+
353
+ $settings['layout'] = array(
354
+ 'title' => esc_html__( 'Layout options', 'colorlib-login-customizer' ),
355
+ 'description' => '',
356
+ 'fields' => array(
357
+ array(
358
+ 'id' => 'columns',
359
+ 'label' => esc_html__( 'Columns', 'colorlib-login-customizer' ),
360
+ 'description' => '',
361
+ 'default' => 1,
362
+ 'choices' => array(
363
+ 1 => array(
364
+ 'value' => 1,
365
+ 'png' => COLORLIB_LOGIN_CUSTOMIZER_URL . '/assets/img/one-column.png',
366
+ ),
367
+ 2 => array(
368
+ 'value' => 2,
369
+ 'png' => COLORLIB_LOGIN_CUSTOMIZER_URL . '/assets/img/two-column.png',
370
+ ),
371
+ ),
372
+ 'type' => 'clc-button-group',
373
+ ),
374
+ array(
375
+ 'id' => 'columns-width',
376
+ 'label' => esc_html__( 'Columns Width', 'colorlib-login-customizer' ),
377
+ 'description' => '',
378
+ 'type' => 'clc-column-width',
379
+ 'active_callback' => array( $this, 'check_two_column_layout' ),
380
+ ),
381
+ array(
382
+ 'id' => 'form-column-align',
383
+ 'label' => esc_html__( 'Form Column Alignment', 'colorlib-login-customizer' ),
384
+ 'description' => '',
385
+ 'default' => 3,
386
+ 'choices' => array(
387
+ 'left' => array(
388
+ 'value' => 1,
389
+ 'png' => COLORLIB_LOGIN_CUSTOMIZER_URL . '/assets/img/form-align-left.jpg',
390
+ ),
391
+ 'top' => array(
392
+ 'value' => 2,
393
+ 'png' => COLORLIB_LOGIN_CUSTOMIZER_URL . '/assets/img/form-align-top.jpg',
394
+ ),
395
+ 'right' => array(
396
+ 'value' => 3,
397
+ 'png' => COLORLIB_LOGIN_CUSTOMIZER_URL . '/assets/img/form-align-right.jpg',
398
+ ),
399
+ 'bottom' => array(
400
+ 'value' => 4,
401
+ 'png' => COLORLIB_LOGIN_CUSTOMIZER_URL . '/assets/img/form-align-bottom.jpg',
402
+ ),
403
+ ),
404
+ 'type' => 'clc-button-group',
405
+ 'active_callback' => array( $this, 'check_two_column_layout' ),
406
+ ),
407
+ array(
408
+ 'id' => 'form-vertical-align',
409
+ 'label' => esc_html__( 'Form Vertical Alignment', 'colorlib-login-customizer' ),
410
+ 'description' => '',
411
+ 'default' => 2,
412
+ 'choices' => array(
413
+ 'top' => array(
414
+ 'value' => 1,
415
+ 'png' => COLORLIB_LOGIN_CUSTOMIZER_URL . '/assets/img/form-vertical-align-top.png',
416
+ ),
417
+ 'middle' => array(
418
+ 'value' => 2,
419
+ 'png' => COLORLIB_LOGIN_CUSTOMIZER_URL . '/assets/img/form-vertical-align-middle.png',
420
+ ),
421
+ 'bottom' => array(
422
+ 'value' => 3,
423
+ 'png' => COLORLIB_LOGIN_CUSTOMIZER_URL . '/assets/img/form-vertical-align-bottom.png',
424
+ ),
425
+ ),
426
+ 'type' => 'clc-button-group',
427
+ ),
428
+ array(
429
+ 'id' => 'form-horizontal-align',
430
+ 'label' => esc_html__( 'Form Horizontal Alignment', 'colorlib-login-customizer' ),
431
+ 'description' => '',
432
+ 'default' => 2,
433
+ 'choices' => array(
434
+ 'left' => array(
435
+ 'value' => 1,
436
+ 'png' => COLORLIB_LOGIN_CUSTOMIZER_URL . '/assets/img/form-horizontal-align-left.png',
437
+ ),
438
+ 'middle' => array(
439
+ 'value' => 2,
440
+ 'png' => COLORLIB_LOGIN_CUSTOMIZER_URL . '/assets/img/form-vertical-align-middle.png',
441
+ ),
442
+ 'right' => array(
443
+ 'value' => 3,
444
+ 'png' => COLORLIB_LOGIN_CUSTOMIZER_URL . '/assets/img/form-horizontal-align-right.png',
445
+ ),
446
+ ),
447
+ 'type' => 'clc-button-group',
448
+ ),
449
+ ),
450
+ );
451
+
452
+ $settings['background'] = array(
453
+ 'title' => esc_html__( 'Background options', 'colorlib-login-customizer' ),
454
+ 'description' => '',
455
+ 'fields' => array(
456
+ array(
457
+ 'id' => 'custom-background-color',
458
+ 'label' => esc_html__( 'Custom background color', 'colorlib-login-customizer' ),
459
+ 'description' => esc_html__( 'This will change the background color property.', 'colorlib-login-customizer' ),
460
+ 'type' => 'color',
461
+ 'default' => '#f1f1f1',
462
+ ),
463
+ array(
464
+ 'id' => 'custom-background',
465
+ 'label' => esc_html__( 'Custom background', 'colorlib-login-customizer' ),
466
+ 'description' => esc_html__( 'This will upload an image to your media library and store the attachment ID in the option field. Once you have uploaded an imge the thumbnail will display above these buttons.', 'colorlib-login-customizer' ),
467
+ 'type' => 'image',
468
+ 'default' => '',
469
+ ),
470
+ array(
471
+ 'id' => 'custom-background-color-form',
472
+ 'label' => esc_html__( 'Form Column background color', 'colorlib-login-customizer' ),
473
+ 'description' => esc_html__( 'This will change the background color property.', 'colorlib-login-customizer' ),
474
+ 'type' => 'color',
475
+ 'default' => '#f1f1f1',
476
+ 'active_callback' => array( $this, 'check_two_column_layout' ),
477
+ ),
478
+ array(
479
+ 'id' => 'custom-background-form',
480
+ 'label' => esc_html__( 'Form Column background', 'colorlib-login-customizer' ),
481
+ 'description' => esc_html__( 'This will upload an image to your media library and store the attachment ID in the option field. Once you have uploaded an imge the thumbnail will display above these buttons.', 'colorlib-login-customizer' ),
482
+ 'type' => 'image',
483
+ 'default' => '',
484
+ 'active_callback' => array( $this, 'check_two_column_layout' ),
485
+ ),
486
+ ),
487
+ );
488
+
489
+ $settings['form'] = array(
490
+ 'title' => esc_html__( 'General Form options', 'colorlib-login-customizer' ),
491
+ 'description' => '',
492
+ 'fields' => array(
493
+ array(
494
+ 'id' => 'form-width',
495
+ 'label' => esc_html__( 'Form Width', 'colorlib-login-customizer' ),
496
+ 'description' => esc_html__( 'Please input the desired width for the login form in pixels. Example: 20', 'colorlib-login-customizer' ),
497
+ 'default' => 320,
498
+ 'type' => 'clc-range-slider',
499
+ 'choices' => array(
500
+ 'min' => 150,
501
+ 'max' => 1000,
502
+ 'step' => 5,
503
+ ),
504
+ ),
505
+ array(
506
+ 'id' => 'form-height',
507
+ 'label' => esc_html__( 'Form Height', 'colorlib-login-customizer' ),
508
+ 'description' => esc_html__( 'Please input the desired height for the login form in pixels. Example: 20', 'colorlib-login-customizer' ),
509
+ 'default' => 194,
510
+ 'choices' => array(
511
+ 'min' => 150,
512
+ 'max' => 1000,
513
+ 'step' => 5,
514
+ ),
515
+ 'type' => 'clc-range-slider',
516
+ ),
517
+ array(
518
+ 'id' => 'form-background-image',
519
+ 'label' => esc_html__( 'Form background image', 'colorlib-login-customizer' ),
520
+ 'description' => esc_html__( 'This will change the background image property of login form.', 'colorlib-login-customizer' ),
521
+ 'type' => 'image',
522
+ 'default' => '',
523
+ ),
524
+ array(
525
+ 'id' => 'form-background-color',
526
+ 'label' => esc_html__( 'Form background color', 'colorlib-login-customizer' ),
527
+ 'description' => esc_html__( 'This will change the background color property.', 'colorlib-login-customizer' ),
528
+ 'type' => 'color',
529
+ 'default' => '#ffffff',
530
+ ),
531
+ array(
532
+ 'id' => 'form-padding',
533
+ 'label' => esc_html__( 'Form padding', 'colorlib-login-customizer' ),
534
+ 'description' => esc_html__( 'This will change the padding property. Example: 26px 24px 46px 30px', 'colorlib-login-customizer' ),
535
+ 'type' => 'text',
536
+ 'default' => '26px 24px',
537
+ ),
538
+ array(
539
+ 'id' => 'form-border',
540
+ 'label' => esc_html__( 'Form border', 'colorlib-login-customizer' ),
541
+ 'description' => esc_html__( 'This will change the border property. Example: 2px dotted black', 'colorlib-login-customizer' ),
542
+ 'type' => 'text',
543
+ 'default' => '0 none',
544
+ ),
545
+ array(
546
+ 'id' => 'form-border-radius',
547
+ 'label' => esc_html__( 'Form border radius', 'colorlib-login-customizer' ),
548
+ 'description' => esc_html__( 'This will change the border radius property. Example: 2px 2px 2px 2px', 'colorlib-login-customizer' ),
549
+ 'type' => 'text',
550
+ 'default' => '0',
551
+ ),
552
+ array(
553
+ 'id' => 'form-shadow',
554
+ 'label' => esc_html__( 'Form shadow', 'colorlib-login-customizer' ),
555
+ 'description' => esc_html__( 'This will change the form\'s shadow property. Example: 0 1px 0 #006799', 'colorlib-login-customizer' ),
556
+ 'type' => 'text',
557
+ 'default' => '0 1px 3px rgba(0,0,0,.13)',
558
+ ),
559
+ array(
560
+ 'id' => 'form-field-width',
561
+ 'label' => esc_html__( 'Form field width', 'colorlib-login-customizer' ),
562
+ 'description' => esc_html__( 'Please input the desired width for the form field in pixels. Example: 20', 'colorlib-login-customizer' ),
563
+ 'type' => 'text',
564
+ 'default' => '100%',
565
+ ),
566
+ array(
567
+ 'id' => 'form-field-margin',
568
+ 'label' => esc_html__( 'Form field margin', 'colorlib-login-customizer' ),
569
+ 'description' => esc_html__( 'This will change the margin property. Example: 26px 24px 46px 30px', 'colorlib-login-customizer' ),
570
+ 'type' => 'text',
571
+ 'default' => '2px 6px 16px 0',
572
+ ),
573
+ array(
574
+ 'id' => 'form-field-border',
575
+ 'label' => esc_html__( 'Form field border', 'colorlib-login-customizer' ),
576
+ 'description' => esc_html__( 'Please input the desired border for the form field. Example: 2px dotted black', 'colorlib-login-customizer' ),
577
+ 'type' => 'text',
578
+ 'default' => '1px solid #ddd',
579
+ ),
580
+ array(
581
+ 'id' => 'form-field-border-radius',
582
+ 'label' => esc_html__( 'Form field border radius', 'colorlib-login-customizer' ),
583
+ 'description' => esc_html__( 'Please input the desired border radiuse for the form field. Example: 5px 5px 5px 5px', 'colorlib-login-customizer' ),
584
+ 'type' => 'text',
585
+ 'default' => 'unset',
586
+ ),
587
+ array(
588
+ 'id' => 'form-field-background',
589
+ 'label' => esc_html__( 'Form field background', 'colorlib-login-customizer' ),
590
+ 'description' => esc_html__( 'This will change the background color property.', 'colorlib-login-customizer' ),
591
+ 'type' => 'color',
592
+ 'default' => '#fbfbfb',
593
+ ),
594
+ array(
595
+ 'id' => 'form-field-color',
596
+ 'label' => esc_html__( 'Form field color', 'colorlib-login-customizer' ),
597
+ 'description' => esc_html__( 'This will change the text color property.', 'colorlib-login-customizer' ),
598
+ 'type' => 'color',
599
+ 'default' => '#32373c',
600
+ ),
601
+ array(
602
+ 'id' => 'form-label-color',
603
+ 'label' => esc_html__( 'Form label color', 'colorlib-login-customizer' ),
604
+ 'description' => esc_html__( 'This will change the label text color property.', 'colorlib-login-customizer' ),
605
+ 'type' => 'color',
606
+ 'default' => '#72777c',
607
+ ),
608
+ array(
609
+ 'id' => 'lost-password-text',
610
+ 'label' => esc_html__( 'Lost Password Text', 'colorlib-login-customizer' ),
611
+ 'description' => esc_html__( 'You can change the default text for "Lost your password" ', 'colorlib-login-customizer' ),
612
+ 'type' => 'text',
613
+ 'default' => 'Lost your password?',
614
+ ),
615
+ array(
616
+ 'id' => 'back-to-text',
617
+ 'label' => esc_html__( 'Back to site text', 'colorlib-login-customizer' ),
618
+ 'description' => esc_html__( 'You can change the default text for "Back to" site ', 'colorlib-login-customizer' ),
619
+ 'type' => 'text',
620
+ 'default' => 'Back to site',
621
+ ),
622
+ array(
623
+ 'id' => 'hide-extra-links',
624
+ 'label' => esc_html__( 'Hide Extra Links', 'colorlib-login-customizer' ),
625
+ 'description' => esc_html__( 'Show/Hide the links under the login form', 'colorlib-login-customizer' ),
626
+ 'type' => 'clc-toggle',
627
+ 'default' => 0,
628
+ ),
629
+ ),
630
+ );
631
+
632
+ $settings['login-form'] = array(
633
+ 'title' => esc_html__( 'Login Form Texts', 'colorlib-login-customizer' ),
634
+ 'description' => '',
635
+ 'fields' => array(
636
+ array(
637
+ 'id' => 'username-label',
638
+ 'label' => esc_html__( 'Username label', 'colorlib-login-customizer' ),
639
+ 'description' => esc_html__( 'You can change the default text for username label or just delete it.', 'colorlib-login-customizer' ),
640
+ 'type' => 'text',
641
+ 'default' => 'Username or Email Address',
642
+ ),
643
+ array(
644
+ 'id' => 'password-label',
645
+ 'label' => esc_html__( 'Password label', 'colorlib-login-customizer' ),
646
+ 'description' => esc_html__( 'You can change the default text for password label or just delete it.', 'colorlib-login-customizer' ),
647
+ 'type' => 'text',
648
+ 'default' => 'Password',
649
+ ),
650
+ array(
651
+ 'id' => 'rememberme-label',
652
+ 'label' => esc_html__( 'Remember Me label', 'colorlib-login-customizer' ),
653
+ 'description' => esc_html__( 'You can change the default remember me text.', 'colorlib-login-customizer' ),
654
+ 'type' => 'text',
655
+ 'default' => 'Remember Me',
656
+ ),
657
+ array(
658
+ 'id' => 'login-label',
659
+ 'label' => esc_html__( 'Login label', 'colorlib-login-customizer' ),
660
+ 'description' => esc_html__( 'You can change the default text for the log in button.', 'colorlib-login-customizer' ),
661
+ 'type' => 'text',
662
+ 'default' => 'Log In',
663
+ ),
664
+ array(
665
+ 'id' => 'register-link-label',
666
+ 'label' => esc_html__( 'Register link', 'colorlib-login-customizer' ),
667
+ 'description' => esc_html__( 'You can change the default text for the register link at the end of the form.', 'colorlib-login-customizer' ),
668
+ 'type' => 'text',
669
+ 'default' => 'Register',
670
+ 'active_callback' => array( $this, 'check_if_user_can_register' ),
671
+ ),
672
+ ),
673
+ );
674
+
675
+ $settings['register-form'] = array(
676
+ 'title' => esc_html__( 'Register Form Texts', 'colorlib-login-customizer' ),
677
+ 'description' => '',
678
+ 'fields' => array(
679
+ array(
680
+ 'id' => 'register-username-label',
681
+ 'label' => esc_html__( 'Username label', 'colorlib-login-customizer' ),
682
+ 'description' => esc_html__( 'You can change the default text for username label or just delete it.', 'colorlib-login-customizer' ),
683
+ 'type' => 'text',
684
+ 'default' => 'Username',
685
+ 'active_callback' => array( $this, 'check_if_user_can_register' ),
686
+ ),
687
+ array(
688
+ 'id' => 'register-email-label',
689
+ 'label' => esc_html__( 'Email label', 'colorlib-login-customizer' ),
690
+ 'description' => esc_html__( 'You can change the default text for email label or just delete it.', 'colorlib-login-customizer' ),
691
+ 'type' => 'text',
692
+ 'default' => 'Email',
693
+ 'active_callback' => array( $this, 'check_if_user_can_register' ),
694
+ ),
695
+ array(
696
+ 'id' => 'register-confirmation-email',
697
+ 'label' => esc_html__( 'Registration confirmation text', 'colorlib-login-customizer' ),
698
+ 'description' => esc_html__( 'You can change the default registration confirmation text.', 'colorlib-login-customizer' ),
699
+ 'type' => 'text',
700
+ 'default' => 'Registration confirmation will be emailed to you.',
701
+ 'active_callback' => array( $this, 'check_if_user_can_register' ),
702
+ ),
703
+ array(
704
+ 'id' => 'register-button-label',
705
+ 'label' => esc_html__( 'Button label', 'colorlib-login-customizer' ),
706
+ 'description' => esc_html__( 'You can change the default text for the register button.', 'colorlib-login-customizer' ),
707
+ 'type' => 'text',
708
+ 'default' => 'Register',
709
+ 'active_callback' => array( $this, 'check_if_user_can_register' ),
710
+ ),
711
+ array(
712
+ 'id' => 'login-link-label',
713
+ 'label' => esc_html__( 'Login link', 'colorlib-login-customizer' ),
714
+ 'description' => esc_html__( 'You can change the default text for the login link at the end of the form.', 'colorlib-login-customizer' ),
715
+ 'type' => 'text',
716
+ 'default' => 'Log in',
717
+ 'active_callback' => array( $this, 'check_if_user_can_register' ),
718
+ ),
719
+ ),
720
+ );
721
+
722
+ $settings['lostpassword-form'] = array(
723
+ 'title' => esc_html__( 'Lost Password Form Texts', 'colorlib-login-customizer' ),
724
+ 'description' => '',
725
+ 'fields' => array(
726
+ array(
727
+ 'id' => 'lostpassword-username-label',
728
+ 'label' => esc_html__( 'Username label', 'colorlib-login-customizer' ),
729
+ 'description' => esc_html__( 'You can change the default text for username label or just delete it.', 'colorlib-login-customizer' ),
730
+ 'type' => 'text',
731
+ 'default' => 'Username or Email Address',
732
+ ),
733
+ array(
734
+ 'id' => 'lostpassword-button-label',
735
+ 'label' => esc_html__( 'Button label', 'colorlib-login-customizer' ),
736
+ 'description' => esc_html__( 'You can change the default text for the lost password button.', 'colorlib-login-customizer' ),
737
+ 'type' => 'text',
738
+ 'default' => 'Get New Password',
739
+ ),
740
+ ),
741
+
742
+ );
743
+
744
+ $settings['general'] = array(
745
+ 'title' => esc_html__( 'Form Button & Links', 'colorlib-login-customizer' ),
746
+ 'description' => '',
747
+ 'fields' => array(
748
+ array(
749
+ 'id' => 'button-background',
750
+ 'label' => esc_html__( 'Button background', 'colorlib-login-customizer' ),
751
+ 'description' => esc_html__( 'This will change the submit button\'s background property', 'colorlib-login-customizer' ),
752
+ 'type' => 'color',
753
+ 'default' => '#0085ba',
754
+ ),
755
+ array(
756
+ 'id' => 'button-background-hover',
757
+ 'label' => esc_html__( 'Button background hover state', 'colorlib-login-customizer' ),
758
+ 'description' => esc_html__( 'This will change the submit button\'s background property on hover', 'colorlib-login-customizer' ),
759
+ 'type' => 'color',
760
+ 'default' => '#008ec2',
761
+ ),
762
+ array(
763
+ 'id' => 'button-border-color',
764
+ 'label' => esc_html__( 'Button border color', 'colorlib-login-customizer' ),
765
+ 'description' => esc_html__( 'This will change the submit button\'s border color property', 'colorlib-login-customizer' ),
766
+ 'type' => 'color',
767
+ 'default' => '#0073aa',
768
+ ),
769
+ array(
770
+ 'id' => 'button-border-color-hover',
771
+ 'label' => esc_html__( 'Button border hover state', 'colorlib-login-customizer' ),
772
+ 'description' => esc_html__( 'This will change the submit button\'s border property on hover', 'colorlib-login-customizer' ),
773
+ 'type' => 'color',
774
+ 'default' => '#006799',
775
+ ),
776
+ array(
777
+ 'id' => 'button-shadow',
778
+ 'label' => esc_html__( 'Button shadow', 'colorlib-login-customizer' ),
779
+ 'description' => esc_html__( 'This will change the submit button\'s shadow property. Example: 0 1px 0 #006799', 'colorlib-login-customizer' ),
780
+ 'type' => 'text',
781
+ 'default' => '0 1px 0 #006799',
782
+ ),
783
+ array(
784
+ 'id' => 'button-text-shadow',
785
+ 'label' => esc_html__( 'Button text shadow', 'colorlib-login-customizer' ),
786
+ 'description' => esc_html__( 'This will change the submit button text\'s shadow property. Example: 0 -1px 1px #006799', 'colorlib-login-customizer' ),
787
+ 'type' => 'text',
788
+ 'default' => '0 -1px 1px #006799',
789
+ ),
790
+ array(
791
+ 'id' => 'button-color',
792
+ 'label' => esc_html__( 'Button color', 'colorlib-login-customizer' ),
793
+ 'description' => esc_html__( 'This will change the submit button\'s text color property', 'colorlib-login-customizer' ),
794
+ 'type' => 'color',
795
+ 'default' => '#ffffff',
796
+ ),
797
+ array(
798
+ 'id' => 'link-color',
799
+ 'label' => esc_html__( 'Link color', 'colorlib-login-customizer' ),
800
+ 'description' => esc_html__( 'This will change the text color of links that are underneath the login form', 'colorlib-login-customizer' ),
801
+ 'type' => 'color',
802
+ 'default' => '#555d66',
803
+ ),
804
+ array(
805
+ 'id' => 'link-color-hover',
806
+ 'label' => esc_html__( 'Link color hover', 'colorlib-login-customizer' ),
807
+ 'description' => esc_html__( 'This will change the text color of links, that are underneath the login form, on hover', 'colorlib-login-customizer' ),
808
+ 'type' => 'color',
809
+ 'default' => '#00a0d2',
810
+ ),
811
+ array(
812
+ 'id' => 'hide-rememberme',
813
+ 'label' => esc_html__( 'Hide "Remember Me"', 'colorlib-login-customizer' ),
814
+ 'description' => esc_html__( 'Show/Hide the "Remember Me" checkbox', 'colorlib-login-customizer' ),
815
+ 'type' => 'clc-toggle',
816
+ 'default' => 0,
817
+ ),
818
+ ),
819
+ );
820
+
821
+ $settings['clc-custom-css'] = array(
822
+ 'title' => esc_html__( 'Custom CSS', 'colorlib-login-customizer' ),
823
+ 'description' => '',
824
+ 'fields' => array(
825
+ array(
826
+ 'id' => 'custom-css',
827
+ 'label' => __( 'CSS code', 'colorlib-login-customizer' ),
828
+ 'description' => '',
829
+ 'code_type' => 'text/css',
830
+ 'type' => 'custom-css',
831
+ 'input_attrs' => array(
832
+ 'aria-describedby' => 'editor-keyboard-trap-help-1 editor-keyboard-trap-help-2 editor-keyboard-trap-help-3 editor-keyboard-trap-help-4',
833
+ ),
834
+ ),
835
+ ),
836
+ );
837
+
838
+ $settings = apply_filters( $this->parent->_token . '_settings_fields', $settings );
839
+
840
+ return $settings;
841
+ }
842
+
843
+ /**
844
+ * Register settings in the customizer
845
+ */
846
+ public function register_settings( $manager ) {
847
+ $manager->add_panel(
848
+ 'clc_main_panel',
849
+ array(
850
+ 'capability' => 'edit_theme_options',
851
+ 'theme_supports' => '',
852
+ 'title' => esc_html__( 'Colorlib Login Customizer', 'colorlib-login-customizer' ),
853
+ )
854
+ );
855
+
856
+ foreach ( $this->settings as $section => $properties ) {
857
+ $manager->add_section(
858
+ 'clc_' . $section,
859
+ array(
860
+ 'title' => $properties['title'],
861
+ 'description' => $properties['description'],
862
+ 'panel' => 'clc_main_panel',
863
+ )
864
+ );
865
+
866
+ foreach ( $properties['fields'] as $setting ) {
867
+ $key_name = $this->generate_name( $setting['id'] );
868
+ $settings_args = array(
869
+ 'type' => 'option',
870
+ 'transport' => 'postMessage',
871
+ );
872
+
873
+ if ( isset( $setting['default'] ) ) {
874
+ $settings_args['default'] = $setting['default'];
875
+ }
876
+
877
+ $manager->add_setting( $key_name, $settings_args );
878
+
879
+ $control_args = array(
880
+ 'label' => $setting['label'],
881
+ 'description' => $setting['description'],
882
+ 'section' => 'clc_' . $section,
883
+ );
884
+
885
+ if ( isset( $setting['active_callback'] ) ) {
886
+ $control_args['active_callback'] = $setting['active_callback'];
887
+ }
888
+
889
+ if ( isset( $setting['choices'] ) ) {
890
+ $control_args['choices'] = $setting['choices'];
891
+ }
892
+
893
+ if ( isset( $setting['code_type'] ) ) {
894
+ $control_args['code_type'] = $setting['code_type'];
895
+ }
896
+
897
+ if ( isset( $setting['input_attrs'] ) ) {
898
+ $control_args['input_attrs'] = $setting['input_attrs'];
899
+ }
900
+
901
+ switch ( $setting['type'] ) {
902
+ case 'image':
903
+ $manager->add_control(
904
+ new WP_Customize_Image_Control( $manager, $key_name, $control_args )
905
+ );
906
+ break;
907
+ case 'color':
908
+ $manager->add_control(
909
+ new Colorlib_Login_Customizer_Control_Color_Picker( $manager, $key_name, $control_args )
910
+ );
911
+ break;
912
+ case 'clc-range-slider':
913
+ $manager->add_control(
914
+ new Colorlib_Login_Customizer_Range_Slider_Control( $manager, $key_name, $control_args )
915
+ );
916
+ break;
917
+ case 'clc-templates':
918
+ $manager->add_control(
919
+ new Colorlib_Login_Customizer_Template_Control( $manager, $key_name, $control_args )
920
+ );
921
+ break;
922
+ case 'clc-button-group':
923
+ $manager->add_control(
924
+ new Colorlib_Login_Customizer_Button_Group_Control( $manager, $key_name, $control_args )
925
+ );
926
+ break;
927
+ case 'clc-column-width':
928
+ $manager->add_control(
929
+ new Colorlib_Login_Customizer_Column_Width( $manager, $key_name, $control_args )
930
+ );
931
+ break;
932
+ case 'clc-toggle':
933
+ $manager->add_control(
934
+ new Colorlib_Login_Customizer_Control_Toggle( $manager, $key_name, $control_args )
935
+ );
936
+ break;
937
+ case 'custom-css':
938
+ $manager->add_control(
939
+ new WP_Customize_Code_Editor_Control( $manager, $key_name, $control_args )
940
+ );
941
+ break;
942
+ default:
943
+ $manager->add_control( $key_name, $control_args );
944
+ break;
945
+ }
946
+ }
947
+ }
948
+
949
+ }
950
+
951
+ /**
952
+ * Binds JS handlers to make Theme Customizer preview reload changes asynchronously.
953
+ */
954
+ public function customize_preview_styles() {
955
+ wp_enqueue_style( 'colorlib-login-customizer-previewer', esc_url( $this->parent->assets_url ) . 'css/clc-customizer-previewer.css' );
956
+ wp_enqueue_script( 'colorlib-login-customizer-preview', esc_url( $this->parent->assets_url ) . 'js/clc-preview.js', array( 'customize-preview' ), false, true );
957
+ }
958
+
959
+ /*
960
+ * Our Customizer script
961
+ *
962
+ * Dependencies: Customizer Controls script (core)
963
+ */
964
+ public function customizer_enqueue_scripts() {
965
+ wp_enqueue_style( 'colorlib-login-customizer-minicolors-styles', esc_url( $this->parent->assets_url ) . 'css/jquery.minicolors.css' );
966
+ wp_enqueue_style( 'colorlib-login-customizer-styles', esc_url( $this->parent->assets_url ) . 'css/clc-customizer.css' );
967
+ wp_enqueue_script(
968
+ 'colorlib-login-customizer-minicolors-script', esc_url( $this->parent->assets_url ) . 'js/jquery.minicolors.js', array(
969
+ 'jquery',
970
+ ), false, true
971
+ );
972
+ wp_enqueue_script(
973
+ 'colorlib-login-customizer-script', esc_url( $this->parent->assets_url ) . 'js/clc-customizer.js', array(
974
+ 'jquery',
975
+ 'customize-controls',
976
+ 'colorlib-login-customizer-minicolors-script',
977
+ ), false, true
978
+ );
979
+
980
+ wp_localize_script(
981
+ 'colorlib-login-customizer-script', 'CLCUrls', array(
982
+ 'siteurl' => get_option( 'siteurl' ),
983
+ 'register_url' => wp_registration_url()
984
+ )
985
+ );
986
+ }
987
+
988
+ // Active callbacks
989
+ public function check_two_column_layout( $control ) {
990
+ $options = get_option( 'clc-options', array() );
991
+
992
+ if ( '2' == $control->manager->get_setting( 'clc-options[columns]' )->value() ) {
993
+ return true;
994
+ }
995
+
996
+ return false;
997
+ }
998
+
999
+ public function check_if_text_logo( $control ) {
1000
+ $options = get_option( 'clc-options', array() );
1001
+
1002
+ if ( 1 == $control->manager->get_setting( 'clc-options[use-text-logo]' )->value() ) {
1003
+ return true;
1004
+ }
1005
+
1006
+ return false;
1007
+ }
1008
+
1009
+ public function check_if_not_text_logo( $control ) {
1010
+ $options = get_option( 'clc-options', array() );
1011
+
1012
+ if ( 1 == $control->manager->get_setting( 'clc-options[use-text-logo]' )->value() ) {
1013
+ return false;
1014
+ }
1015
+
1016
+ return true;
1017
+ }
1018
+
1019
+ public function check_if_user_can_register(){
1020
+ $user_can_register = get_option('users_can_register');
1021
+ if($user_can_register == '0'){
1022
+ return false;
1023
+ }
1024
+ return true;
1025
+ }
1026
+ }
includes/login-template.php CHANGED
@@ -7,6 +7,10 @@
7
  *
8
  */
9
 
 
 
 
 
10
 
11
  /**
12
  * Output the login page header.
@@ -79,6 +83,7 @@ do_action( 'login_init' );
79
  * @since 2.8.0
80
  */
81
  do_action( 'login_form_login' );
 
82
 
83
  /**
84
  * Filters the separator used between login form navigation links.
@@ -157,13 +162,13 @@ $classes = apply_filters( 'login_body_class', $classes, 'login' );
157
  <div id="login">
158
 
159
  <h1>
160
- <a href="<?php echo esc_url( $login_header_url ); ?>" title="<?php echo esc_attr( $login_header_title ); ?>" tabindex="-1">
161
  <span id="clc-logo" class="clc-preview-event" data-section="clc_logo"><span class="dashicons dashicons-edit"></span></span>
162
  <span id="logo-text"><?php echo $login_header_text ?></span>
163
  </a>
164
  </h1>
165
 
166
- <form name="loginform" id="loginform" action="<?php echo esc_url( site_url( 'wp-login.php', 'login_post' ) ); ?>" method="post">
167
  <div id="clc-loginform" class="clc-preview-event" data-section="clc_form"><span class="dashicons dashicons-edit"></span></div>
168
  <p>
169
  <label for="user_login"><span id="clc-username-label"><?php _e( 'Username or Email Address', 'colorlib-login-customizer' ); ?></span><br />
@@ -181,27 +186,75 @@ $classes = apply_filters( 'login_body_class', $classes, 'login' );
181
  */
182
  do_action( 'login_form' );
183
  ?>
184
- <p class="forgetmenot"><label for="rememberme"><input name="rememberme" type="checkbox" id="rememberme" value="forever" /> <?php esc_html_e( 'Remember Me', 'colorlib-login-customizer' ); ?></label></p>
185
- <p class="submit"><input type="submit" name="wp-submit" id="wp-submit" class="button button-primary button-large" value="<?php esc_attr_e( 'Log In', 'colorlib-login-customizer' ); ?>" /></p>
186
  </form>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
187
  <p id="nav">
188
  <?php
189
  if ( get_option( 'users_can_register' ) ) :
190
- $registration_url = sprintf( '<a href="%s">%s</a>', esc_url( wp_registration_url() ), __( 'Register', 'colorlib-login-customizer' ) );
 
 
191
 
192
  /** This filter is documented in wp-includes/general-template.php */
193
  echo apply_filters( 'register', $registration_url );
194
 
195
- echo esc_html( $login_link_separator );
 
 
 
 
196
  endif;
197
  ?>
198
- <a href="<?php echo esc_url( wp_lostpassword_url() ); ?>"><?php _e( 'Lost your password?', 'colorlib-login-customizer' ); ?></a>
199
  </p>
200
  <p id="backtoblog">
201
  <a href="<?php echo esc_url( home_url( '/' ) ); ?>">
202
- <?php
203
- /* translators: %s: site title */
204
- printf( _x( '&larr; Back to %s', 'site', 'colorlib-login-customizer' ), esc_html( get_bloginfo( 'title', 'display' ) ) );
 
 
 
 
205
  ?>
206
  </a>
207
  </p>
7
  *
8
  */
9
 
10
+ $clc_core = Colorlib_Login_Customizer::instance();
11
+ $clc_defaults = $clc_core->get_defaults();
12
+ $clc_options = get_option( 'clc-options', array() );
13
+ $clc_options = wp_parse_args( $clc_options, $clc_defaults );
14
 
15
  /**
16
  * Output the login page header.
83
  * @since 2.8.0
84
  */
85
  do_action( 'login_form_login' );
86
+ do_action( 'login_form_register' );
87
 
88
  /**
89
  * Filters the separator used between login form navigation links.
162
  <div id="login">
163
 
164
  <h1>
165
+ <a id="clc-logo-link" href="<?php echo esc_url( $login_header_url ); ?>" title="<?php echo esc_attr( $login_header_title ); ?>" tabindex="-1">
166
  <span id="clc-logo" class="clc-preview-event" data-section="clc_logo"><span class="dashicons dashicons-edit"></span></span>
167
  <span id="logo-text"><?php echo $login_header_text ?></span>
168
  </a>
169
  </h1>
170
 
171
+ <form name="loginform" class="show-only_login" id="loginform" action="<?php echo esc_url( site_url( 'wp-login.php', 'login_post' ) ); ?>" method="post">
172
  <div id="clc-loginform" class="clc-preview-event" data-section="clc_form"><span class="dashicons dashicons-edit"></span></div>
173
  <p>
174
  <label for="user_login"><span id="clc-username-label"><?php _e( 'Username or Email Address', 'colorlib-login-customizer' ); ?></span><br />
186
  */
187
  do_action( 'login_form' );
188
  ?>
189
+ <p class="forgetmenot"><label for="rememberme"><input name="rememberme" type="checkbox" id="rememberme" value="forever" /> <span id="clc-rememberme-label"><?php esc_html_e( 'Remember Me', 'colorlib-login-customizer' ); ?></span></label></p>
190
+ <p class="submit"><input type="submit" name="wp-submit" class="button button-primary button-large" value="<?php esc_attr_e( 'Log In', 'colorlib-login-customizer' ); ?>" /></p>
191
  </form>
192
+
193
+ <form name="registerform" style="display:none" class="show-only_register" id="registerform" action="<?php echo esc_url( wp_registration_url() ); ?>" method="post">
194
+ <p>
195
+ <label for="user_register"><span id="clc-register-sername-label"><?php _e( 'Username', 'colorlib-login-customizer' ); ?></span><br />
196
+ <input type="text" name="log" id="user_register" class="input" value="<?php echo esc_attr( $user_login ); ?>" size="20" /></label>
197
+ </p>
198
+ <p>
199
+ <label for="user_email"><span id="clc-register-email-label"><?php _e( 'Email', 'colorlib-login-customizer' ); ?></span><br />
200
+ <input type="email" name="email" id="user_email" class="input" value="" size="20" /></label>
201
+ </p>
202
+ <?php
203
+ /**
204
+ * Fires following the 'Password' field in the login form.
205
+ *
206
+ * @since 2.1.0
207
+ */
208
+ do_action( 'login_form' );
209
+ ?>
210
+ <p id="reg_passmail"><?php _e('Registration confirmation will be emailed to you.','colorlib-login-customizer'); ?></p>
211
+ <p class="submit"><input type="submit" name="wp-submit" class="button button-primary button-large" value="<?php esc_attr_e( 'Register', 'colorlib-login-customizer' ); ?>" /></p>
212
+ </form>
213
+
214
+ <form style="display:none;" class="show-only_lostpassword" name="lostpasswordform" id="lostpasswordform" action="" method="post">
215
+ <p>
216
+ <label for="user_login" ><span><?php _e( 'Username or Email Address', 'colorlib-login-customizer' ); ?></span><br />
217
+ <input type="text" name="user_login" id="user_login" class="input" value="<?php echo esc_attr( $user_login ); ?>" size="20" autocapitalize="off" /></label>
218
+ </p>
219
+ <?php
220
+ /**
221
+ * Fires inside the lostpassword form tags, before the hidden fields.
222
+ *
223
+ * @since 2.1.0
224
+ */
225
+ do_action( 'lostpassword_form' );
226
+ ?>
227
+ <p class="submit"><input type="submit" name="wp-submit" id="wp-submit" class="button button-primary button-large" value="<?php esc_attr_e( 'Get New Password', 'colorlib-login-customizer' ); ?>" /></p>
228
+ </form>
229
+
230
  <p id="nav">
231
  <?php
232
  if ( get_option( 'users_can_register' ) ) :
233
+ $registration_url = sprintf( '<a id="register-link-label" href="%s" class="show-only_login show-only_lostpassword">%s</a>', esc_url( wp_registration_url() ), $clc_options['register-link-label'] );
234
+
235
+
236
 
237
  /** This filter is documented in wp-includes/general-template.php */
238
  echo apply_filters( 'register', $registration_url );
239
 
240
+ echo '<span style="display:none" class="show-only_lostpassword">'.esc_html( $login_link_separator ).'</span>';
241
+
242
+ echo '<a href="#" id="login-link-label" class="show-only_register show-only_lostpassword" style="display:none">' . $clc_options['login-link-label'] . '</a>';
243
+
244
+ echo '<span class="show-only_register show-only_login">'.esc_html( $login_link_separator ).'</span>';
245
  endif;
246
  ?>
247
+ <a class="show-only_register show-only_login" href="<?php echo esc_url( wp_lostpassword_url() ); ?>" id="clc-lost-password-text"><?php _e( 'Lost your password?', 'colorlib-login-customizer' ); ?></a>
248
  </p>
249
  <p id="backtoblog">
250
  <a href="<?php echo esc_url( home_url( '/' ) ); ?>">
251
+ <span id="clc-back-to-text">
252
+ <?php
253
+ echo '&larr; '; _e('Back to','colorlib-login-customizer');
254
+ ?>
255
+ </span>
256
+ <?php
257
+ echo esc_html( get_bloginfo( 'title', 'display' ) );
258
  ?>
259
  </a>
260
  </p>
languages/colorlib-login-customizer.po ADDED
@@ -0,0 +1,640 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright (C) 2019 Colorlib
2
+ # This file is distributed under the same license as the Colorlib Login Customizer package.
3
+ msgid ""
4
+ msgstr ""
5
+ "Project-Id-Version: Colorlib Login Customizer 1.2.7\n"
6
+ "Report-Msgid-Bugs-To: "
7
+ "https://wordpress.org/support/plugin/colorlib-login-customizer\n"
8
+ "POT-Creation-Date: 2019-01-29 12:17:39+00:00\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=utf-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "PO-Revision-Date: 2019-MO-DA HO:MI+ZONE\n"
13
+ "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14
+ "Language-Team: LANGUAGE <LL@li.org>\n"
15
+ "Language: en\n"
16
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
17
+ "X-Poedit-Country: United States\n"
18
+ "X-Poedit-SourceCharset: UTF-8\n"
19
+ "X-Poedit-KeywordsList: "
20
+ "__;_e;_x:1,2c;_ex:1,2c;_n:1,2;_nx:1,2,4c;_n_noop:1,2;_nx_noop:1,2,3c;esc_"
21
+ "attr__;esc_html__;esc_attr_e;esc_html_e;esc_attr_x:1,2c;esc_html_x:1,2c;\n"
22
+ "X-Poedit-Basepath: ../\n"
23
+ "X-Poedit-SearchPath-0: .\n"
24
+ "X-Poedit-Bookmarks: \n"
25
+ "X-Textdomain-Support: yes\n"
26
+ "X-Generator: grunt-wp-i18n1.0.2\n"
27
+
28
+ #: includes/class-colorlib-login-customizer-review.php:22
29
+ msgid ""
30
+ "Hey, I noticed you have installed our plugin for %s day(s) - that's "
31
+ "awesome! Could you please do me a BIG favor and give it a 5-star rating on "
32
+ "WordPress? Just to help us spread the word and boost our motivation."
33
+ msgstr ""
34
+
35
+ #: includes/class-colorlib-login-customizer-review.php:23
36
+ msgid "Ok, you deserve it"
37
+ msgstr ""
38
+
39
+ #: includes/class-colorlib-login-customizer-review.php:24
40
+ msgid "I already did"
41
+ msgstr ""
42
+
43
+ #: includes/class-colorlib-login-customizer-review.php:25
44
+ msgid "No, not good enough"
45
+ msgstr ""
46
+
47
+ #: includes/class-colorlib-login-customizer.php:216
48
+ #: includes/class-colorlib-login-customizer.php:225
49
+ #: includes/lib/class-colorlib-login-customizer-settings.php:130
50
+ #: includes/lib/class-colorlib-login-customizer-settings.php:139
51
+ msgid "Cheatin&#8217; huh?"
52
+ msgstr ""
53
+
54
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:62
55
+ msgid "Templates"
56
+ msgstr ""
57
+
58
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:67
59
+ msgid "Temapltes"
60
+ msgstr ""
61
+
62
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:256
63
+ msgid "Logo options"
64
+ msgstr ""
65
+
66
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:261
67
+ msgid "Hide Logo"
68
+ msgstr ""
69
+
70
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:262
71
+ msgid "Show/Hide the logo from login page"
72
+ msgstr ""
73
+
74
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:268
75
+ msgid "Use Text Logo"
76
+ msgstr ""
77
+
78
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:269
79
+ msgid "Show/Hide the logo text from login page"
80
+ msgstr ""
81
+
82
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:275
83
+ msgid "Logo URL"
84
+ msgstr ""
85
+
86
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:276
87
+ msgid "This is where the logo will link to."
88
+ msgstr ""
89
+
90
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:282
91
+ msgid "Logo Title"
92
+ msgstr ""
93
+
94
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:283
95
+ msgid ""
96
+ "The tooltip that will be displayed when hovering over the logo. Also this "
97
+ "is used as Logo text when you select \"Use Text Logo\""
98
+ msgstr ""
99
+
100
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:289
101
+ msgid "Logo text color"
102
+ msgstr ""
103
+
104
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:290
105
+ msgid "This will change the color text property."
106
+ msgstr ""
107
+
108
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:297
109
+ msgid "Logo text color hover"
110
+ msgstr ""
111
+
112
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:298
113
+ msgid "This will change the color text property on hover."
114
+ msgstr ""
115
+
116
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:305
117
+ msgid "Logo text size"
118
+ msgstr ""
119
+
120
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:306
121
+ msgid "This will change the text size of logo."
122
+ msgstr ""
123
+
124
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:318
125
+ msgid "Custom logo"
126
+ msgstr ""
127
+
128
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:319
129
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:466
130
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:481
131
+ msgid ""
132
+ "This will upload an image to your media library and store the attachment ID "
133
+ "in the option field. Once you have uploaded an imge the thumbnail will "
134
+ "display above these buttons."
135
+ msgstr ""
136
+
137
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:326
138
+ msgid "Logo Width"
139
+ msgstr ""
140
+
141
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:327
142
+ msgid "Make sure you set the logo width to match your image."
143
+ msgstr ""
144
+
145
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:339
146
+ msgid "Logo Height"
147
+ msgstr ""
148
+
149
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:340
150
+ msgid "Make sure you set the logo height to match your image."
151
+ msgstr ""
152
+
153
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:354
154
+ msgid "Layout options"
155
+ msgstr ""
156
+
157
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:359
158
+ msgid "Columns"
159
+ msgstr ""
160
+
161
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:376
162
+ msgid "Columns Width"
163
+ msgstr ""
164
+
165
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:383
166
+ msgid "Form Column Alignment"
167
+ msgstr ""
168
+
169
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:409
170
+ msgid "Form Vertical Alignment"
171
+ msgstr ""
172
+
173
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:430
174
+ msgid "Form Horizontal Alignment"
175
+ msgstr ""
176
+
177
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:453
178
+ msgid "Background options"
179
+ msgstr ""
180
+
181
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:458
182
+ msgid "Custom background color"
183
+ msgstr ""
184
+
185
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:459
186
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:473
187
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:527
188
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:590
189
+ msgid "This will change the background color property."
190
+ msgstr ""
191
+
192
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:465
193
+ msgid "Custom background"
194
+ msgstr ""
195
+
196
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:472
197
+ msgid "Form Column background color"
198
+ msgstr ""
199
+
200
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:480
201
+ msgid "Form Column background"
202
+ msgstr ""
203
+
204
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:490
205
+ msgid "General Form options"
206
+ msgstr ""
207
+
208
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:495
209
+ msgid "Form Width"
210
+ msgstr ""
211
+
212
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:496
213
+ msgid "Please input the desired width for the login form in pixels. Example: 20"
214
+ msgstr ""
215
+
216
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:507
217
+ msgid "Form Height"
218
+ msgstr ""
219
+
220
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:508
221
+ msgid "Please input the desired height for the login form in pixels. Example: 20"
222
+ msgstr ""
223
+
224
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:519
225
+ msgid "Form background image"
226
+ msgstr ""
227
+
228
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:520
229
+ msgid "This will change the background image property of login form."
230
+ msgstr ""
231
+
232
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:526
233
+ msgid "Form background color"
234
+ msgstr ""
235
+
236
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:533
237
+ msgid "Form padding"
238
+ msgstr ""
239
+
240
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:534
241
+ msgid "This will change the padding property. Example: 26px 24px 46px 30px"
242
+ msgstr ""
243
+
244
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:540
245
+ msgid "Form border"
246
+ msgstr ""
247
+
248
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:541
249
+ msgid "This will change the border property. Example: 2px dotted black"
250
+ msgstr ""
251
+
252
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:547
253
+ msgid "Form border radius"
254
+ msgstr ""
255
+
256
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:548
257
+ msgid "This will change the border radius property. Example: 2px 2px 2px 2px"
258
+ msgstr ""
259
+
260
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:554
261
+ msgid "Form shadow"
262
+ msgstr ""
263
+
264
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:555
265
+ msgid "This will change the form's shadow property. Example: 0 1px 0 #006799"
266
+ msgstr ""
267
+
268
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:561
269
+ msgid "Form field width"
270
+ msgstr ""
271
+
272
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:562
273
+ msgid "Please input the desired width for the form field in pixels. Example: 20"
274
+ msgstr ""
275
+
276
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:568
277
+ msgid "Form field margin"
278
+ msgstr ""
279
+
280
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:569
281
+ msgid "This will change the margin property. Example: 26px 24px 46px 30px"
282
+ msgstr ""
283
+
284
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:575
285
+ msgid "Form field border"
286
+ msgstr ""
287
+
288
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:576
289
+ msgid ""
290
+ "Please input the desired border for the form field. Example: 2px dotted "
291
+ "black"
292
+ msgstr ""
293
+
294
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:582
295
+ msgid "Form field border radius"
296
+ msgstr ""
297
+
298
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:583
299
+ msgid ""
300
+ "Please input the desired border radiuse for the form field. Example: 5px "
301
+ "5px 5px 5px"
302
+ msgstr ""
303
+
304
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:589
305
+ msgid "Form field background"
306
+ msgstr ""
307
+
308
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:596
309
+ msgid "Form field color"
310
+ msgstr ""
311
+
312
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:597
313
+ msgid "This will change the text color property."
314
+ msgstr ""
315
+
316
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:603
317
+ msgid "Form label color"
318
+ msgstr ""
319
+
320
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:604
321
+ msgid "This will change the label text color property."
322
+ msgstr ""
323
+
324
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:610
325
+ msgid "Lost Password Text"
326
+ msgstr ""
327
+
328
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:611
329
+ msgid "You can change the default text for \"Lost your password\" "
330
+ msgstr ""
331
+
332
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:617
333
+ msgid "Back to site text"
334
+ msgstr ""
335
+
336
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:618
337
+ msgid "You can change the default text for \"Back to\" site "
338
+ msgstr ""
339
+
340
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:624
341
+ msgid "Hide Extra Links"
342
+ msgstr ""
343
+
344
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:625
345
+ msgid "Show/Hide the links under the login form"
346
+ msgstr ""
347
+
348
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:633
349
+ msgid "Login Form Texts"
350
+ msgstr ""
351
+
352
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:638
353
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:681
354
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:728
355
+ msgid "Username label"
356
+ msgstr ""
357
+
358
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:639
359
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:682
360
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:729
361
+ msgid "You can change the default text for username label or just delete it."
362
+ msgstr ""
363
+
364
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:645
365
+ msgid "Password label"
366
+ msgstr ""
367
+
368
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:646
369
+ msgid "You can change the default text for password label or just delete it."
370
+ msgstr ""
371
+
372
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:652
373
+ msgid "Remember Me label"
374
+ msgstr ""
375
+
376
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:653
377
+ msgid "You can change the default remember me text."
378
+ msgstr ""
379
+
380
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:659
381
+ msgid "Login label"
382
+ msgstr ""
383
+
384
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:660
385
+ msgid "You can change the default text for the log in button."
386
+ msgstr ""
387
+
388
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:666
389
+ msgid "Register link"
390
+ msgstr ""
391
+
392
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:667
393
+ msgid ""
394
+ "You can change the default text for the register link at the end of the "
395
+ "form."
396
+ msgstr ""
397
+
398
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:676
399
+ msgid "Register Form Texts"
400
+ msgstr ""
401
+
402
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:689
403
+ msgid "Email label"
404
+ msgstr ""
405
+
406
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:690
407
+ msgid "You can change the default text for email label or just delete it."
408
+ msgstr ""
409
+
410
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:697
411
+ msgid "Registration confirmation text"
412
+ msgstr ""
413
+
414
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:698
415
+ msgid "You can change the default registration confirmation text."
416
+ msgstr ""
417
+
418
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:705
419
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:735
420
+ msgid "Button label"
421
+ msgstr ""
422
+
423
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:706
424
+ msgid "You can change the default text for the register button."
425
+ msgstr ""
426
+
427
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:713
428
+ msgid "Login link"
429
+ msgstr ""
430
+
431
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:714
432
+ msgid "You can change the default text for the login link at the end of the form."
433
+ msgstr ""
434
+
435
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:723
436
+ msgid "Lost Password Form Texts"
437
+ msgstr ""
438
+
439
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:736
440
+ msgid "You can change the default text for the lost password button."
441
+ msgstr ""
442
+
443
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:745
444
+ msgid "Form Button & Links"
445
+ msgstr ""
446
+
447
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:750
448
+ msgid "Button background"
449
+ msgstr ""
450
+
451
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:751
452
+ msgid "This will change the submit button's background property"
453
+ msgstr ""
454
+
455
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:757
456
+ msgid "Button background hover state"
457
+ msgstr ""
458
+
459
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:758
460
+ msgid "This will change the submit button's background property on hover"
461
+ msgstr ""
462
+
463
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:764
464
+ msgid "Button border color"
465
+ msgstr ""
466
+
467
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:765
468
+ msgid "This will change the submit button's border color property"
469
+ msgstr ""
470
+
471
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:771
472
+ msgid "Button border hover state"
473
+ msgstr ""
474
+
475
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:772
476
+ msgid "This will change the submit button's border property on hover"
477
+ msgstr ""
478
+
479
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:778
480
+ msgid "Button shadow"
481
+ msgstr ""
482
+
483
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:779
484
+ msgid ""
485
+ "This will change the submit button's shadow property. Example: 0 1px 0 "
486
+ "#006799"
487
+ msgstr ""
488
+
489
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:785
490
+ msgid "Button text shadow"
491
+ msgstr ""
492
+
493
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:786
494
+ msgid ""
495
+ "This will change the submit button text's shadow property. Example: 0 -1px "
496
+ "1px #006799"
497
+ msgstr ""
498
+
499
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:792
500
+ msgid "Button color"
501
+ msgstr ""
502
+
503
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:793
504
+ msgid "This will change the submit button's text color property"
505
+ msgstr ""
506
+
507
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:799
508
+ msgid "Link color"
509
+ msgstr ""
510
+
511
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:800
512
+ msgid "This will change the text color of links that are underneath the login form"
513
+ msgstr ""
514
+
515
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:806
516
+ msgid "Link color hover"
517
+ msgstr ""
518
+
519
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:807
520
+ msgid ""
521
+ "This will change the text color of links, that are underneath the login "
522
+ "form, on hover"
523
+ msgstr ""
524
+
525
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:813
526
+ msgid "Hide \"Remember Me\""
527
+ msgstr ""
528
+
529
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:814
530
+ msgid "Show/Hide the \"Remember Me\" checkbox"
531
+ msgstr ""
532
+
533
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:822
534
+ msgid "Custom CSS"
535
+ msgstr ""
536
+
537
+ #: includes/lib/class-colorlib-login-customizer-customizer.php:827
538
+ msgid "CSS code"
539
+ msgstr ""
540
+
541
+ #. Plugin Name of the plugin/theme
542
+ msgid "Colorlib Login Customizer"
543
+ msgstr ""
544
+
545
+ #: includes/lib/class-colorlib-login-customizer-settings.php:68
546
+ msgid "Login Customizer"
547
+ msgstr ""
548
+
549
+ #: includes/lib/class-colorlib-login-customizer-settings.php:83
550
+ msgid "Settings"
551
+ msgstr ""
552
+
553
+ #: includes/lib/class-colorlib-login-customizer-settings.php:99
554
+ msgid ""
555
+ "Login Customizer plugin allows you to easily customize your login page "
556
+ "straight from your WordPress Customizer! You can preview your changes "
557
+ "before you save them! Awesome, right?"
558
+ msgstr ""
559
+
560
+ #: includes/lib/class-colorlib-login-customizer-settings.php:100
561
+ msgid "Start Customizing!"
562
+ msgstr ""
563
+
564
+ #: includes/lib/controls/class-colorlib-login-customizer-control-color-picker.php:74
565
+ msgid "(clear)"
566
+ msgstr ""
567
+
568
+ #: includes/login-template.php:34
569
+ #. translators: Login screen title. 1: Login screen name, 2: Network or site
570
+ #. name
571
+ msgid "%1$s &lsaquo; %2$s &#8212; WordPress"
572
+ msgstr ""
573
+
574
+ #: includes/login-template.php:101 includes/login-template.php:190
575
+ msgid "Log In"
576
+ msgstr ""
577
+
578
+ #: includes/login-template.php:103
579
+ msgid "https://wordpress.org/"
580
+ msgstr ""
581
+
582
+ #: includes/login-template.php:104
583
+ msgid "Powered by WordPress"
584
+ msgstr ""
585
+
586
+ #: includes/login-template.php:174 includes/login-template.php:216
587
+ msgid "Username or Email Address"
588
+ msgstr ""
589
+
590
+ #: includes/login-template.php:178
591
+ msgid "Password"
592
+ msgstr ""
593
+
594
+ #: includes/login-template.php:189
595
+ msgid "Remember Me"
596
+ msgstr ""
597
+
598
+ #: includes/login-template.php:195
599
+ msgid "Username"
600
+ msgstr ""
601
+
602
+ #: includes/login-template.php:199
603
+ msgid "Email"
604
+ msgstr ""
605
+
606
+ #: includes/login-template.php:210
607
+ msgid "Registration confirmation will be emailed to you."
608
+ msgstr ""
609
+
610
+ #: includes/login-template.php:211
611
+ msgid "Register"
612
+ msgstr ""
613
+
614
+ #: includes/login-template.php:227
615
+ msgid "Get New Password"
616
+ msgstr ""
617
+
618
+ #: includes/login-template.php:247
619
+ msgid "Lost your password?"
620
+ msgstr ""
621
+
622
+ #: includes/login-template.php:253
623
+ msgid "Back to"
624
+ msgstr ""
625
+
626
+ #. Description of the plugin/theme
627
+ msgid ""
628
+ "Colorlib Login Customizer is an awesome and intuitive plugin that helps you "
629
+ "personalize your login form directly from the Customizer. The plugin fully "
630
+ "supports the Live Customizer feature and you can see all the changes in "
631
+ "real time and edit them."
632
+ msgstr ""
633
+
634
+ #. Author of the plugin/theme
635
+ msgid "Colorlib"
636
+ msgstr ""
637
+
638
+ #. Author URI of the plugin/theme
639
+ msgid "https://colorlib.com/"
640
+ msgstr ""
readme.txt CHANGED
@@ -1,109 +1,134 @@
1
- === Custom Login Page Customizer by Colorlib ===
2
- Contributors: colorlibplugins, silkalns
3
- Tags: customize login, login, custom login, customize wordpress login, wordpress login, customizer, custom admin, login logo, logo, login customizer, custom wp-login
4
- Requires at least: 4.7
5
- Tested up to: 4.9
6
- Stable tag: trunk
7
- License: GPLv2 or later
8
- License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
-
10
- Colorlib Login Customizer by Colorlib is a plugin that helps you personalize your login form directly from the Customizer.
11
-
12
- == Description ==
13
-
14
- Custom Login Page Customizer by Colorlib is an awesome and intuitive login page plugin that helps you personalize your login page and login form directly from the Customizer. Custom Login Page Customizer fully supports the Live Customizer feature and you can see all the changes in real time on your login page and edit them.
15
-
16
- All this plugin’s tools and options can be found by going to Appearance > Customize > Custom Login Page Customizer. There you have templates you can use on your login page, custom login page logo, custom login page background options, custom login page form customizations, login form custom width, login form padding and borders, and more all leading to you having a brand new and custom login page.
17
-
18
- Custom Login Page Customizer is without doubt one of the easiest to use WordPress plugins that allows the customization of the login page and login form. It was designed and developed to be powerful and user friendly so it can be enjoyed by both beginner and advanced developers. With Custom Login Page Customizer you can build a custom login page and custom login form in a matter of seconds, unlike some other login customizer plugins. Custom Login Page Customizer marks the end of a boring and bland login page and login form as you will be able to fine tune every aspect of the form to match your style and view and create a unique and custom login page.
19
-
20
- Build and personalize your WordPress login page and login form from start to finish. Custom Login Page Customizer has the following features:
21
-
22
- • Custom login page logo options: you can add a custom login page logo and set up its height and weight.
23
- • Custom login page and login form background options: from here you can upload a background image or change the background’s color.
24
- • Custom login form options: you can change the login form’s width and height, add a background image, change the background color, add padding and borders, and change the login form’s field background color, width, and margin.
25
- Miscellaneous: in here you will find the options to change the login form button’s background, color, hover state, border, shadow, and the link’s color and hover color.
26
-
27
- Custom Login Page Customizer by Colorlib detailed features:
28
-
29
- - Custom login page templates
30
- - Hide/show login logo from login page
31
- - Show/hide the logo text from login page
32
- - Custom logo on login page
33
- - Change logo width on login page
34
- - Change logo height on login page
35
- - Change number of columns on your login page
36
- - Customize width of the columns on your login page
37
- - Change login form column alignment
38
- - Customize login form vertical alignment
39
- - Customize login form horizontal alignment
40
- - Customize background color on the login page
41
- - Add a custom background image on login page
42
- - Customize login form column background color
43
- - Add a custom background image for login form column
44
- - Customize login form width
45
- - Customize login form width
46
- - Add custom background image for login form
47
- - Customize the background color for login form
48
- - Customize login form border radius
49
- - Customize login form fields’ width
50
- - Customize login form fields’ margin
51
- - Customize login form fields’ border
52
- - Customize login form fields’ border radius
53
- - Customize login form fields’ background color
54
- - Customize login form fields’ text color
55
- - Customize login form fields’ label color
56
- - Customize login form username label
57
- - Customize login form password label
58
- - Show/hide the links on login page under the login form
59
- - Customize login form button background color
60
- - Customize login form button hover background color
61
- - Customize login form button border color
62
- - Customize login form button border color on hover
63
- - Customize login form button shadow
64
- - Customize login form button text shadow
65
- - Customize login form links color
66
- - Customize login form links color on hover
67
- - Hide/Show ‘Remember me?’ option on login form
68
- - Custom CSS option to customize further the login form and login page
69
-
70
- Build and personalize your WordPress login form from start to finish. Colorlib Login Customizer has the following features:
71
-
72
- - Logo options: you can add a custom logo and set up its height and weight.
73
- - Background options: from here you can upload a background image or change the background’s color.
74
- - Form options: you can change the form’s width and height, add a background image, change the background color, add padding and borders, and change the form’s field background color, width, and margin.
75
- - Miscellaneous: in here you will find the options to change the button’s background, color, hover state, border, shadow, and the link’s color and hover color.
76
-
77
- = Further Reading =
78
-
79
- This plugin is developed and maintained by Colorlib. Which is well know for their free <a href="https://colorlib.com/wp/themes/" target="_blank"></a>WordPress themes. However, now they are looking to extend their presence in plugin development and believe that Colorlib Login Customizer is a great way to start.
80
-
81
- If you are new to WordPress and want to learn more we have got you covered. Colorlib will teach you how to <a href="https://colorlib.com/">start a blog</a> or <a href="https://colorlib.com/wp/how-to-make-a-website/">create a website</a> and much more. If you are already familiar with WordPress you likely want to learn how to make it faster and more reliable. That's when you want to look into hosting and more specifically <a href="http://colorlib.com/wp/wordpress-hosting">WordPress hosting</a>.
82
-
83
- If you enjoy using Colorlib Login Customizer for WordPress please leave a [positive feedback](https://wordpress.org/support/plugin/colorlib-login-customiezr/reviews/?filter=5). We are committed to make it the best Login Customizer plugin for WordPress.
84
-
85
-
86
- == Installation ==
87
-
88
- 1. Download the plugin (.zip file) on your hard drive.
89
- 2. Unzip the zip file contents.
90
- 3. Upload the `colorlib-login-customizer` folder to the `/wp-content/plugins/` directory.
91
- 4. Activate the plugin through the 'Plugins' menu in WordPress.
92
- 5. A new sub menu item `Colorlib Login Customizer` will appear in your main Settings menu.
93
-
94
- == Changelog ==
95
-
96
- = 1.2.1 =
97
- * Minor fixes.
98
-
99
- = 1.2.0 =
100
- * Implemented everything from here: https://github.com/puikinsh/colorlib-login-customizer/milestone/1?closed=1
101
-
102
- = 1.1 =
103
- * Changed templates functionality
104
- * Added new layout options
105
- * Fixed live preview editing
106
- * Fixed minor bugs
107
-
108
- = 1.0 =
109
- * Initial release
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === Custom Login Page Customizer by Colorlib ===
2
+ Contributors: colorlibplugins, silkalns
3
+ Tags: customize login, login, custom login, customize wordpress login, wordpress login, customizer, custom admin, login logo, logo, login customizer, custom wp-login
4
+ Requires at least: 4.7
5
+ Tested up to: 5.1
6
+ Requires PHP: 5.6
7
+ Stable tag: 1.2.7
8
+ License: GPLv3 or later
9
+ License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
+
11
+ Colorlib Login Customizer by Colorlib is a plugin that helps you personalize your login form directly from the Customizer.
12
+
13
+ == Description ==
14
+
15
+ Custom Login Page Customizer by Colorlib is an awesome and intuitive login page plugin that helps you personalize your login page and login form directly from the Customizer. Custom Login Page Customizer fully supports the Live Customizer feature and you can see all the changes in real time on your login page and edit them.
16
+
17
+ All this plugin’s tools and options can be found by going to Appearance > Customize > Custom Login Page Customizer. There you have templates you can use on your login page, custom login page logo, custom login page background options, custom login page form customizations, login form custom width, login form padding and borders, and more all leading to you having a brand new and custom login page.
18
+
19
+ Custom Login Page Customizer is without doubt one of the easiest to use WordPress plugins that allows the customization of the login page and login form. It was designed and developed to be powerful and user friendly so it can be enjoyed by both beginner and advanced developers. With Custom Login Page Customizer you can build a custom login page and custom login form in a matter of seconds, unlike some other login customizer plugins. Custom Login Page Customizer marks the end of a boring and bland login page and login form as you will be able to fine tune every aspect of the form to match your style and view and create a unique and custom login page.
20
+
21
+ Build and personalize your WordPress login page and login form from start to finish. Custom Login Page Customizer has the following features:
22
+
23
+ • Custom login page logo options: you can add a custom login page logo and set up its height and weight.
24
+ • Custom login page and login form background options: from here you can upload a background image or change the background’s color.
25
+ Custom login form options: you can change the login form’s width and height, add a background image, change the background color, add padding and borders, and change the login form’s field background color, width, and margin.
26
+ • Miscellaneous: in here you will find the options to change the login form button’s background, color, hover state, border, shadow, and the link’s color and hover color.
27
+
28
+ Custom Login Page Customizer by Colorlib detailed features:
29
+
30
+ - Custom login page templates
31
+ - Hide/show login logo from login page
32
+ - Show/hide the logo text from login page
33
+ - Custom logo on login page
34
+ - Change logo width on login page
35
+ - Change logo height on login page
36
+ - Change number of columns on your login page
37
+ - Customize width of the columns on your login page
38
+ - Change login form column alignment
39
+ - Customize login form vertical alignment
40
+ - Customize login form horizontal alignment
41
+ - Customize background color on the login page
42
+ - Add a custom background image on login page
43
+ - Customize login form column background color
44
+ - Add a custom background image for login form column
45
+ - Customize login form width
46
+ - Customize login form width
47
+ - Add custom background image for login form
48
+ - Customize the background color for login form
49
+ - Customize login form border radius
50
+ - Customize login form fields’ width
51
+ - Customize login form fields’ margin
52
+ - Customize login form fields’ border
53
+ - Customize login form fields’ border radius
54
+ - Customize login form fields’ background color
55
+ - Customize login form fields’ text color
56
+ - Customize login form fields’ label color
57
+ - Customize login form username label
58
+ - Customize login form password label
59
+ - Show/hide the links on login page under the login form
60
+ - Customize login form button background color
61
+ - Customize login form button hover background color
62
+ - Customize login form button border color
63
+ - Customize login form button border color on hover
64
+ - Customize login form button shadow
65
+ - Customize login form button text shadow
66
+ - Customize login form links color
67
+ - Customize login form links color on hover
68
+ - Hide/Show ‘Remember me?’ option on login form
69
+ - Custom CSS option to customize further the login form and login page
70
+
71
+ Build and personalize your WordPress login form from start to finish. Colorlib Login Customizer has the following features:
72
+
73
+ - Logo options: you can add a custom logo and set up its height and weight.
74
+ - Background options: from here you can upload a background image or change the background’s color.
75
+ - Form options: you can change the form’s width and height, add a background image, change the background color, add padding and borders, and change the form’s field background color, width, and margin.
76
+ - Miscellaneous: in here you will find the options to change the button’s background, color, hover state, border, shadow, and the link’s color and hover color.
77
+
78
+ = Further Reading =
79
+
80
+ This plugin is developed and maintained by Colorlib. Which is well know for their free <a href="https://colorlib.com/wp/themes/" target="_blank"></a>WordPress themes. However, now they are looking to extend their presence in plugin development and believe that Colorlib Login Customizer is a great way to start.
81
+
82
+ If you are new to WordPress and want to learn more we have got you covered. Colorlib will teach you how to <a href="https://colorlib.com/">start a blog</a> or <a href="https://colorlib.com/wp/how-to-make-a-website/">create a website</a> and much more. If you are already familiar with WordPress you likely want to learn how to make it faster and more reliable. That's when you want to look into hosting and more specifically <a href="http://colorlib.com/wp/wordpress-hosting">WordPress hosting</a>.
83
+
84
+ If you enjoy using Colorlib Login Customizer for WordPress please leave a [positive feedback](https://wordpress.org/support/plugin/colorlib-login-customiezr/reviews/?filter=5). We are committed to make it the best Login Customizer plugin for WordPress.
85
+
86
+
87
+ == Installation ==
88
+
89
+ 1. Download the plugin (.zip file) on your hard drive.
90
+ 2. Unzip the zip file contents.
91
+ 3. Upload the `colorlib-login-customizer` folder to the `/wp-content/plugins/` directory.
92
+ 4. Activate the plugin through the 'Plugins' menu in WordPress.
93
+ 5. A new sub menu item `Colorlib Login Customizer` will appear in your main Settings menu.
94
+
95
+ == Changelog ==
96
+
97
+ = 1.2.7 =
98
+ * Added options to edit register form
99
+ * Added options to edit lost password form
100
+
101
+ = 1.2.6 =
102
+ * Customizer CSS editor full height
103
+ * Apply login form settings to registration form
104
+ * Removed duplicate control for logo text
105
+
106
+ = 1.2.5 =
107
+ * Remove uninstall feedback
108
+
109
+ = 1.2.4 =
110
+ * Fixed https://github.com/ColorlibHQ/colorlib-login-customizer/issues/30
111
+ * Fixed https://github.com/ColorlibHQ/colorlib-login-customizer/issues/41
112
+ * Added https://github.com/ColorlibHQ/colorlib-login-customizer/issues/27
113
+
114
+ = 1.2.3 =
115
+ * Fixed `Logo Url` setting
116
+ * Added `Logo Title` setting
117
+
118
+ = 1.2.2 =
119
+ * Added the possibility to change the `Remember Me` and `Log In` texts
120
+
121
+ = 1.2.1 =
122
+ * Minor tweaks & version bump
123
+
124
+ = 1.2.0 =
125
+ * Implemented everything from here: https://github.com/puikinsh/colorlib-login-customizer/milestone/1?closed=1
126
+
127
+ = 1.1 =
128
+ * Changed templates functionality
129
+ * Added new layout options
130
+ * Fixed live preview editing
131
+ * Fixed minor bugs
132
+
133
+ = 1.0 =
134
+ * Initial release