PluginProbe
LoginPress | wp-login Custom Login Page Customizer / 1.7.0
LoginPress | wp-login Custom Login Page Customizer v1.7.0
6.2.5 6.2.4 6.2.3 6.2.2 6.2.1 trunk 1.0.0 1.0.1 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.15 1.0.16 1.0.17 1.0.18 1.0.19 1.0.2 1.0.20 1.0.21 1.0.22 1.0.23 1.0.3 1.0.4 All 118 releases
loginpress / custom.php

custom.php in LoginPress | wp-login Custom Login Page Customizer 1.7.0, at custom.php

2,138 lines 86.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 class LoginPress_Entities {
4
5 /**
6 * Variable that Check for LoginPress Key.
7 *
8 * @var string
9 * @since 1.0.0
10 * @version 1.2.0
11 */
12 public $loginpress_key;
13
14 /**
15 * LoginPress template name.
16 *
17 * @since 1.6.4
18 * @var string LoginPress template name.
19 */
20 public $loginpress_preset;
21
22
23 /**
24 * Class constructor
25 */
26 public function __construct() {
27
28 $this->loginpress_key = get_option( 'loginpress_customization' );
29 $this->loginpress_preset = get_option( 'customize_presets_settings', 'default1' );
30
31 $this->_hooks();
32 }
33
34
35 /**
36 * Hook into actions and filters
37 *
38 * @since 1.0.0
39 * @version 1.4.0
40 */
41 private function _hooks() {
42
43 add_filter( 'login_title', array( $this, 'login_page_title' ), 99);
44 add_filter( 'login_headerurl', array( $this, 'login_page_logo_url' ) );
45 if ( version_compare( $GLOBALS['wp_version'], '5.2', '<' ) ) {
46 add_filter( 'login_headertitle', array( $this, 'login_page_logo_title' ) );
47 } else {
48 add_filter( 'login_headertext', array( $this, 'login_page_logo_title' ) );
49 }
50 add_filter( 'login_errors', array( $this, 'login_error_messages' ) );
51 add_filter( 'login_message', array( $this, 'change_welcome_message' ) );
52 add_action( 'customize_register', array( $this, 'customize_login_panel' ) );
53 add_action( 'login_footer', array( $this, 'login_page_custom_footer' ) );
54 add_action( 'login_head', array( $this, 'login_page_custom_head' ) );
55 add_action( 'init', array( $this, 'redirect_to_custom_page' ) );
56 add_action( 'admin_menu', array( $this, 'menu_url' ), 10 );
57 add_filter( 'wp_login_errors', array( $this, 'remove_error_messages_in_wp_customizer' ), 10, 2 );
58
59 if ( version_compare( $GLOBALS['wp_version'], '5.9', '>=' ) ) {
60 add_filter( 'login_display_language_dropdown', array( $this, 'loginpress_language_switch' ) );
61 }
62
63 /**
64 * This function enqueues scripts and styles in the Customizer.
65 */
66 add_action( 'customize_controls_enqueue_scripts', array( $this, 'loginpress_customizer_js' ) );
67
68 /**
69 * This function is triggered on the initialization of the Previewer in the Customizer.
70 * We add actions that pertain to the Previewer window here.
71 * The actions added here are triggered only in the Previewer and not in the Customizer.
72 * @since 1.0.23
73 */
74 add_action( 'customize_preview_init', array( $this, 'loginpress_customizer_previewer_js' ) );
75 add_filter( 'woocommerce_process_login_errors', array( $this, 'loginpress_woo_login_errors' ), 10, 3 );
76
77 }
78
79
80 /**
81 * Enqueue jQuery and use wp_localize_script.
82 *
83 * @since 1.0.9
84 * @version 1.6.4
85 */
86 function loginpress_customizer_js() {
87
88 wp_enqueue_script('jquery');
89 wp_enqueue_script( 'loginpress-customize-control', plugins_url( 'js/customize-controls.js' , LOGINPRESS_ROOT_FILE ), array( 'jquery' ), LOGINPRESS_VERSION, true );
90
91 /*
92 * Our Customizer script
93 *
94 * Dependencies: Customizer Controls script (core)
95 */
96 wp_enqueue_script( 'loginpress-control-script', plugins_url( 'js/customizer.js' , LOGINPRESS_ROOT_FILE ), array( 'customize-controls' ), LOGINPRESS_VERSION, true );
97
98 // Get Background URL for use in Customizer JS.
99 $user = wp_get_current_user();
100 $name = empty( $user->user_firstname ) ? ucfirst( $user->display_name ) : ucfirst( $user->user_firstname );
101 $loginpress_bg = get_option( 'loginpress_customization');
102 $loginpress_st = get_option( 'loginpress_setting');
103 $cap_type = isset( $loginpress_st['recaptcha_type'] ) ? $loginpress_st['recaptcha_type'] : 'v2-robot'; // 1.2.1
104 $loginpress_bg_url = $loginpress_bg['setting_background'] ? $loginpress_bg['setting_background'] : false;
105
106 if( isset( $_GET['autofocus'] ) && $_GET['autofocus'] == 'loginpress_panel' ) { // 1.2.0
107 $loginpress_auto_focus = true;
108 } else {
109 $loginpress_auto_focus = false;
110 }
111
112 // Array for localize.
113 $loginpress_localize = array(
114 'admin_url' => admin_url(),
115 'ajaxurl' => admin_url( 'admin-ajax.php' ),
116 'plugin_url' => plugins_url(),
117 'login_theme' => $this->loginpress_preset,
118 'loginpress_bg_url' => $loginpress_bg_url,
119 'preset_nonce' => wp_create_nonce( 'loginpress-preset-nonce' ),
120 'attachment_nonce' => wp_create_nonce( 'loginpress-attachment-nonce' ),
121 'preset_loader' => includes_url( 'js/tinymce/skins/lightgray/img/loader.gif' ),
122 'autoFocusPanel' => $loginpress_auto_focus,
123 'recaptchaType' => $cap_type,
124 'filter_bg' => apply_filters( 'loginpress_default_bg', '' ),
125 );
126
127 wp_localize_script( 'loginpress-customize-control', 'loginpress_script', $loginpress_localize );
128
129 }
130
131 /**
132 * This function is called only on the Previwer and enqueues scripts and styles.
133 * Our Customizer script
134 *
135 * Dependencies: Customizer Preview script (core)
136 * @since 1.0.23
137 */
138 function loginpress_customizer_previewer_js() {
139
140 wp_enqueue_style( 'loginpress-customizer-previewer-style', plugins_url( 'css/style-previewer.css' , LOGINPRESS_ROOT_FILE ), array(), LOGINPRESS_VERSION );
141
142 wp_enqueue_script( 'loginpress-customizer-previewer-script', plugins_url( 'js/customizer-previewer.js' , LOGINPRESS_ROOT_FILE ), array( 'customize-preview' ), LOGINPRESS_VERSION, true );
143
144 }
145
146 /**
147 * Create a method of setting and control for LoginPress_Range_Control.
148 * @param object $wp_customize
149 * @param string $control
150 * @param string $default
151 * @param string $label
152 * @param array $input_attr
153 * @param array $unit
154 * @param int $index
155 * @return object
156 * @since 1.1.3
157 */
158 function loginpress_rangle_seting( $wp_customize, $control, $default, $label, $input_attr, $unit, $section, $index, $priority = '' ){
159
160 $wp_customize->add_setting( "loginpress_customization[{$control[$index]}]", array(
161 'default' => $default[$index],
162 'type' => 'option',
163 'capability' => 'manage_options',
164 'transport' => 'postMessage',
165 'sanitize_callback' => 'absint',
166 ) );
167
168 $wp_customize->add_control( new LoginPress_Range_Control( $wp_customize, "loginpress_customization[{$control[$index]}]", array(
169 'type' => 'loginpress-range',
170 'label' => $label[$index],
171 'section' => $section,
172 'priority' => $priority,
173 'settings' => "loginpress_customization[{$control[$index]}]",
174 'default' => $default[$index],
175 'input_attrs' => $input_attr[$index],
176 'unit' => $unit[$index],
177 ) ) );
178 }
179
180 /**
181 * Create a method of setting and control for LoginPress_Group_Control.
182 * @param object $wp_customize
183 * @param string $control
184 * @param string $label
185 * @param string $section
186 * @param string $info_test
187 * @param int $index
188 * @return object
189 * @since 1.1.3
190 */
191 function loginpress_group_setting( $wp_customize, $control, $label, $info_test, $section, $index, $priority = '' ){
192
193 $wp_customize->add_setting( "loginpress_customization[{$control[$index]}]", array(
194 'type' => 'option',
195 'capability' => 'manage_options',
196 'transport' => 'postMessage'
197 ) );
198
199 $wp_customize->add_control( new LoginPress_Group_Control( $wp_customize, "loginpress_customization[{$control[$index]}]", array(
200 'settings' => "loginpress_customization[{$control[$index]}]",
201 'label' => $label[$index],
202 'section' => $section,
203 'type' => 'group',
204 'info_text' => $info_test[$index],
205 'priority' => $priority,
206 ) ) );
207 }
208
209 /**
210 * Create a method of setting and control for WP_Customize_Color_Control.
211 * @param object $wp_customize
212 * @param string $control
213 * @param string $label
214 * @param string $section
215 * @param int $index
216 * @return object
217 * @since 1.1.3
218 */
219 function loginpress_color_setting( $wp_customize, $control, $label, $section, $index, $priority = '' ){
220
221 $wp_customize->add_setting( "loginpress_customization[{$control[$index]}]", array(
222 // 'default' => $form_color_default[$form_color],
223 'type' => 'option',
224 'capability' => 'manage_options',
225 'transport' => 'postMessage',
226 'sanitize_callback' => 'sanitize_hex_color' // validates 3 or 6 digit HTML hex color code.
227 ) );
228
229 $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, "loginpress_customization[{$control[$index]}]", array(
230 'label' => $label[$index],
231 'section' => $section,
232 'settings' => "loginpress_customization[{$control[$index]}]",
233 'priority' => $priority,
234 ) ) );
235 }
236
237 function loginpress_hr_setting( $wp_customize, $control, $section, $index, $priority = '' ){
238
239 $wp_customize->add_setting( "loginpress_customization[{$control[$index]}]", array(
240 'sanitize_callback' => 'sanitize_text_field',
241 ) );
242
243 $wp_customize->add_control( new LoginPress_Misc_Control( $wp_customize, "loginpress_customization[{$control[$index]}]", array(
244 'section' => $section,
245 'type' => 'hr',
246 'priority' => $priority,
247 ) ) );
248 }
249
250 /**
251 * Register plugin settings Panel in WP Customizer
252 *
253 * @param $wp_customize
254 * @since 1.0.0
255 */
256 public function customize_login_panel( $wp_customize ) {
257
258 include LOGINPRESS_ROOT_PATH . 'classes/control-presets.php';
259
260 include LOGINPRESS_ROOT_PATH . 'classes/controls/background-gallery.php';
261
262 include LOGINPRESS_ROOT_PATH . 'classes/controls/range.php';
263
264 include LOGINPRESS_ROOT_PATH . 'classes/controls/group.php';
265
266 include LOGINPRESS_ROOT_PATH . 'classes/controls/radio-button.php';
267
268 include LOGINPRESS_ROOT_PATH . 'classes/controls/miscellaneous.php';
269
270 include LOGINPRESS_ROOT_PATH . 'include/customizer-strings.php';
271
272 include LOGINPRESS_ROOT_PATH . 'include/customizer-validation.php';
273
274 if ( ! has_action( 'loginpress_pro_add_template' ) ) :
275 include LOGINPRESS_ROOT_PATH . 'classes/class-loginpress-promo.php';
276 endif;
277
278 // =============================
279 // = Panel for the LoginPress =
280 // =============================
281 $wp_customize->add_panel( 'loginpress_panel', array(
282 'title' => __( 'LoginPress', 'loginpress' ),
283 'description' => __( 'Customize Your WordPress Login Page with LoginPress :)', 'loginpress' ),
284 'priority' => 30,
285 ) );
286
287 /**
288 * =============================
289 * = Section for Presets =
290 * =============================
291 *
292 * @since 1.0.9
293 * @version 1.1.16
294 */
295 $wp_customize->add_section( 'customize_presets', array(
296 'title' => __( 'Themes', 'loginpress' ),
297 'description' => __( 'Choose Theme', 'loginpress' ),
298 'priority' => 1,
299 'panel' => 'loginpress_panel',
300 ) );
301
302 $wp_customize->add_setting( 'customize_presets_settings', array(
303 'default' => 'default1',
304 'type' => 'option',
305 // 'transport' => 'postMessage',
306 'capability' => 'manage_options',
307 ) );
308
309 $loginpress_free_templates = array();
310 $loginpress_theme_name = array( "", "",
311 __( 'Company', 'loginpress' ),
312 __( 'Persona', 'loginpress' ),
313 __( 'Corporate', 'loginpress' ),
314 __( 'Corporate', 'loginpress' ),
315 __( 'Startup', 'loginpress' ),
316 __( 'Wedding', 'loginpress' ),
317 __( 'Wedding #2', 'loginpress' ),
318 __( 'Company', 'loginpress' ),
319 __( 'Bikers', 'loginpress' ),
320 __( 'Fitness', 'loginpress' ),
321 __( 'Shopping', 'loginpress' ),
322 __( 'Writers', 'loginpress' ),
323 __( 'Persona', 'loginpress' ),
324 __( 'Geek', 'loginpress' ),
325 __( 'Innovation', 'loginpress' ),
326 __( 'Photographers', 'loginpress' ),
327 __( 'Animated Wapo', 'loginpress' ),
328 __( 'Animated Wapo 2','loginpress' ) );
329
330 // 1st template that is default
331 $loginpress_free_templates["default1" ] = array(
332 // 'img' => plugins_url( 'img/bg.jpg', LOGINPRESS_ROOT_FILE ),
333 // 'thumbnail' => plugins_url( 'img/thumbnail/default-1.png', LOGINPRESS_ROOT_FILE ),
334 'img' => esc_url( apply_filters( 'loginpress_default_bg', plugins_url( 'img/bg.jpg', LOGINPRESS_PLUGIN_BASENAME ) ) ),
335 'thumbnail' => esc_url( apply_filters( 'loginpress_default_bg', plugins_url( 'img/thumbnail/default-1.png', LOGINPRESS_ROOT_FILE ) ) ),
336 'id' => 'default1',
337 'name' => 'Default'
338 ) ;
339
340 // Loof through the templates.
341 $_count = 2;
342 while ( $_count <= 18 ) :
343
344 $loginpress_free_templates["default{$_count}" ] = array(
345 // 'img' => plugins_url( 'img/bg.jpg', LOGINPRESS_ROOT_FILE ),
346 'thumbnail' => plugins_url( "img/thumbnail/default-{$_count}.png", LOGINPRESS_ROOT_FILE ),
347 'id' => "default{$_count}",
348 'name' => $loginpress_theme_name[$_count],
349 'pro' => 'yes'
350 );
351 $_count++;
352 endwhile;
353
354 // 18th template for custom design.
355 $loginpress_free_templates["default19" ] = array(
356 'img' => plugins_url( 'loginpress/img/bg17.jpg', LOGINPRESS_ROOT_PATH ),
357 'thumbnail' => plugins_url( 'loginpress/img/thumbnail/custom-design.png', LOGINPRESS_ROOT_PATH ),
358 'id' => 'default19',
359 'name' => __( 'Custom Design', 'loginpress' ),
360 'link' => 'yes'
361 );
362 $loginpress_templates = apply_filters( 'loginpress_pro_add_template', $loginpress_free_templates );
363
364 $wp_customize->add_control( new LoginPress_Presets( $wp_customize, 'customize_presets_settings',
365 array(
366 'section' => 'customize_presets',
367 // 'label' => __( 'Themes', 'loginpress' ),
368 'choices' => $loginpress_templates
369 ) ) );
370 //End of Presets.
371
372
373 // =============================
374 // = Section for Login Logo =
375 // =============================
376 $wp_customize->add_section( 'customize_logo_section', array(
377 'title' => __( 'Logo', 'loginpress' ),
378 'description' => __( 'Customize Your Logo Section', 'loginpress' ),
379 'priority' => 5,
380 'panel' => 'loginpress_panel',
381 ) );
382
383 /**
384 * [ Enable / Disabe Logo Image with LoginPress_Radio_Control ]
385 * @since 1.1.3
386 */
387
388 $wp_customize->add_setting( 'loginpress_customization[setting_logo_display]', array(
389 'default' => false,
390 'type' => 'option',
391 'capability' => 'manage_options',
392 'transport' => 'postMessage',
393 'sanitize_callback' => 'loginpress_sanitize_checkbox'
394 ) );
395
396 $wp_customize->add_control( new LoginPress_Radio_Control( $wp_customize, 'loginpress_customization[setting_logo_display]', array(
397 'settings' => 'loginpress_customization[setting_logo_display]',
398 'label' => __( 'Disable Logo:', 'loginpress'),
399 'section' => 'customize_logo_section',
400 'priority' => 4,
401 'type' => 'ios', // light, ios, flat
402 ) ) );
403
404 $wp_customize->add_setting( 'loginpress_customization[setting_logo]', array(
405 'type' => 'option',
406 'capability' => 'manage_options',
407 'transport' => 'postMessage',
408 'sanitize_callback' => 'loginpress_sanitize_image'
409 ) );
410
411 $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'loginpress_customization[setting_logo]', array(
412 'label' => __( 'Logo Image:', 'loginpress' ),
413 'section' => 'customize_logo_section',
414 'priority' => 5,
415 'settings' => 'loginpress_customization[setting_logo]'
416 ) ) );
417
418 /**
419 * [ Change CSS Properties Input fields with LoginPress_Range_Control ]
420 * @since 1.0.1
421 * @version 1.1.24
422 */
423
424 $this->loginpress_rangle_seting( $wp_customize, $logo_range_control, $logo_range_default, $logo_range_label, $logo_range_attrs, $logo_range_unit, 'customize_logo_section', 0, 10 );
425 $this->loginpress_rangle_seting( $wp_customize, $logo_range_control, $logo_range_default, $logo_range_label, $logo_range_attrs, $logo_range_unit, 'customize_logo_section', 1, 15 );
426 $this->loginpress_rangle_seting( $wp_customize, $logo_range_control, $logo_range_default, $logo_range_label, $logo_range_attrs, $logo_range_unit, 'customize_logo_section', 2, 20 );
427
428 if ( version_compare( $GLOBALS['wp_version'], '5.2', '<' ) ) {
429 $loginpress_logo_title = __( 'Logo Hover Title:', 'loginpress' );
430 } else {
431 $loginpress_logo_title = __( 'Logo Title:', 'loginpress' );
432 }
433 $logo_control = array( 'customize_logo_hover', 'customize_logo_hover_title', 'customize_login_page_title' );
434 $logo_default = array( '', '', '' );
435 $logo_label = array( __( 'Logo URL:', 'loginpress' ), $loginpress_logo_title, __( 'Login Page Title:', 'loginpress' ) );
436 $logo_sanitization = array( 'esc_url_raw', 'wp_strip_all_tags', 'wp_strip_all_tags' );
437 $logo_desc = array( '', '', __( 'Login page title that is shown on WordPress login page.', 'loginpress' ) );
438
439 $logo = 0;
440 while ( $logo < 3 ) :
441
442 $wp_customize->add_setting( "loginpress_customization[{$logo_control[$logo]}]", array(
443 'default' => $logo_default[$logo],
444 'type' => 'option',
445 'capability' => 'manage_options',
446 'transport' => 'postMessage',
447 'sanitize_callback' => $logo_sanitization[$logo]
448 ) );
449
450 $wp_customize->add_control( "loginpress_customization[{$logo_control[$logo]}]", array(
451 'label' => $logo_label[$logo],
452 'section' => 'customize_logo_section',
453 'priority' => 25,
454 'settings' => "loginpress_customization[{$logo_control[$logo]}]",
455 'description' => $logo_desc[$logo]
456 ) );
457
458 $logo++;
459 endwhile;
460
461 // =============================
462 // = Section for Background =
463 // =============================
464 $wp_customize->add_section( 'section_background', array(
465 'title' => __( 'Background', 'loginpress' ),
466 'description' => '',
467 'priority' => 10,
468 'panel' => 'loginpress_panel',
469 ) );
470
471 $wp_customize->add_setting( 'loginpress_customization[setting_background_color]', array(
472 // 'default' => '#ddd5c3',
473 'type' => 'option',
474 'capability' => 'manage_options',
475 'transport' => 'postMessage',
476 'sanitize_callback' => 'sanitize_hex_color' // validates 3 or 6 digit HTML hex color code.
477 ) );
478
479 $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'loginpress_customization[setting_background_color]', array(
480 'label' => __( 'Background Color:', 'loginpress' ),
481 'section' => 'section_background',
482 'priority' => 5,
483 'settings' => 'loginpress_customization[setting_background_color]'
484 ) ) );
485
486 $wp_customize->add_setting( 'loginpress_customization[loginpress_display_bg]', array(
487 'default' => true,
488 'type' => 'option',
489 'capability' => 'manage_options',
490 'transport' => 'postMessage',
491 'sanitize_callback' => 'loginpress_sanitize_checkbox'
492 ) );
493
494 $this->loginpress_group_setting( $wp_customize, $group_control, $group_label, $group_info, 'section_background', 6, 6 );
495
496 /**
497 * [Enable / Disabe Background Image with LoginPress_Radio_Control]
498 * @since 1.0.1
499 * @version 1.0.23
500 */
501 $wp_customize->add_control( new LoginPress_Radio_Control( $wp_customize, 'loginpress_customization[loginpress_display_bg]', array(
502 'settings' => 'loginpress_customization[loginpress_display_bg]',
503 'label' => __( 'Enable Background Image?', 'loginpress'),
504 'section' => 'section_background',
505 'priority' => 10,
506 'type' => 'ios',// light, ios, flat
507 ) ) );
508
509 $wp_customize->add_setting( 'loginpress_customization[setting_background]', array(
510 // 'default' => plugins_url( 'img/bg.jpg', LOGINPRESS_ROOT_FILE ) ,
511 'type' => 'option',
512 'capability' => 'manage_options',
513 'transport' => 'postMessage',
514 'sanitize_callback' => 'loginpress_sanitize_image'
515 ) );
516
517 $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'loginpress_customization[setting_background]', array(
518 'label' => __( 'Background Image:', 'loginpress' ),
519 'section' => 'section_background',
520 'priority' => 15,
521 'settings' => 'loginpress_customization[setting_background]',
522 'button_labels' => array(
523 'select' => __( 'Select Image', 'loginpress' ),
524 ) ) ) );
525
526 /**
527 * [ Add Background Gallery ]
528 * @since 1.1.0
529 */
530 $wp_customize->add_setting( 'loginpress_customization[gallery_background]', array(
531 'default' => plugins_url( "img/gallery/img-1.jpg", LOGINPRESS_ROOT_FILE ),
532 'type' => 'option',
533 'capability' => 'manage_options',
534 'transport' => 'postMessage'
535 ) );
536
537 $loginpress_free_background = array();
538 $loginpress_background_name = array( "",
539 __( 'Company', 'loginpress' ),
540 __( 'Persona', 'loginpress' ),
541 __( 'Corporate', 'loginpress' ),
542 __( 'Corporate', 'loginpress' ),
543 __( 'Startup', 'loginpress' ),
544 __( 'Wedding', 'loginpress' ),
545 __( 'Wedding #2', 'loginpress' ),
546 __( 'Company', 'loginpress' ),
547 __( 'Bikers', 'loginpress' ) );
548
549 // Loof through the backgrounds.
550 $bg_count = 1;
551 while ( $bg_count <= 9 ) :
552
553 $thumbname = plugins_url( "img/gallery/img-{$bg_count}.jpg", LOGINPRESS_ROOT_FILE );
554 $loginpress_free_background[$thumbname] = array(
555 'thumbnail' => plugins_url( "img/thumbnail/gallery-img-{$bg_count}.jpg", LOGINPRESS_ROOT_FILE ),
556 'id' => $thumbname,
557 'name' => $loginpress_background_name[$bg_count]
558 );
559 $bg_count++;
560 endwhile;
561
562 $loginpress_background = apply_filters( 'loginpress_pro_add_background', $loginpress_free_background );
563
564 $wp_customize->add_control( new LoginPress_Background_Gallery_Control( $wp_customize, 'loginpress_customization[gallery_background]',
565 array(
566 'section' => 'section_background',
567 'label' => __( 'Background Gallery:', 'loginpress' ),
568 'choices' => $loginpress_background
569 ) ) );
570
571 // @version 1.1.21
572 $wp_customize->add_setting( 'loginpress_customization[background_repeat_radio]', array(
573 'default' => 'no-repeat',
574 'type' => 'option',
575 'capability' => 'manage_options',
576 'transport' => 'postMessage',
577 // 'sanitize_callback' => 'loginpress_sanitize_checkbox'
578 ) );
579
580 $wp_customize->add_control( 'loginpress_customization[background_repeat_radio]', array(
581 'label' => __( 'Background Repeat:', 'loginpress' ),
582 'section' => 'section_background',
583 'priority' => 20,
584 'settings' => 'loginpress_customization[background_repeat_radio]',
585 'type' => 'select',
586 'choices' => array(
587 'repeat' => 'repeat',
588 'repeat-x' => 'repeat-x',
589 'repeat-y' => 'repeat-y',
590 'no-repeat' => 'no-repeat',
591 'initial' => 'initial',
592 'inherit' => 'inherit',
593 ),
594 ) );
595
596 // @version 1.1.21
597 $wp_customize->add_setting( 'loginpress_customization[background_position]', array(
598 'default' => 'center',
599 'type' => 'option',
600 'capability' => 'manage_options',
601 'transport' => 'postMessage',
602 'sanitize_callback' => 'loginpress_sanitize_select'
603 ) );
604 $wp_customize->add_control( 'loginpress_customization[background_position]', array(
605 'settings' => 'loginpress_customization[background_position]',
606 'label' => __( 'Select Position:', 'loginpress' ),
607 'section' => 'section_background',
608 'priority' => 25,
609 'type' => 'select',
610 'choices' => array(
611 'left-top' => 'left top',
612 'left-center' => 'left center',
613 'left-bottom' => 'left bottom',
614 'right-top' => 'right top',
615 'right-center' => 'right center',
616 'right-bottom' => 'right bottom',
617 'center-top' => 'center top',
618 'center' => 'center',
619 'center-bottom' => 'center bottom',
620 ),
621 ) );
622
623 $wp_customize->add_setting( 'loginpress_customization[background_image_size]', array(
624 'default' => 'cover',
625 'type' => 'option',
626 'capability' => 'manage_options',
627 'transport' => 'postMessage',
628 'sanitize_callback' => 'loginpress_sanitize_select'
629 ));
630
631 $wp_customize->add_control( 'loginpress_customization[background_image_size]', array(
632 'label' => __( 'Background Image Size: ', 'loginpress' ),
633 'section' => 'section_background',
634 'priority' => 30,
635 'settings' => 'loginpress_customization[background_image_size]',
636 'type' => 'select',
637 'choices' => array(
638 'auto' => 'auto',
639 'cover' => 'cover',
640 'contain' => 'contain',
641 'initial' => 'initial',
642 'inherit' => 'inherit',
643 ),
644 ) );
645
646
647 $this->loginpress_group_setting( $wp_customize, $group_control, $group_label, $group_info, 'section_background', 7, 35 );
648 /**
649 * [Enable / Disabe Background Video with LoginPress_Radio_Control]
650 * @since 1.1.22
651 */
652 $wp_customize->add_setting( 'loginpress_customization[loginpress_display_bg_video]', array(
653 'default' => false,
654 'type' => 'option',
655 'capability' => 'manage_options',
656 'transport' => 'postMessage',
657 'sanitize_callback' => 'loginpress_sanitize_checkbox'
658 ) );
659
660 $wp_customize->add_control( new LoginPress_Radio_Control( $wp_customize, 'loginpress_customization[loginpress_display_bg_video]', array(
661 'settings' => 'loginpress_customization[loginpress_display_bg_video]',
662 'label' => __( 'Enable Background Video?', 'loginpress'),
663 'section' => 'section_background',
664 'priority' => 40,
665 'type' => 'ios', // light, ios, flat
666 ) ) );
667
668 /**
669 * [Launch Background Video feature with WP_Customize_Media_Control]
670 * @since 1.1.22
671 */
672 $wp_customize->add_setting( 'loginpress_customization[background_video]', array(
673 'type' => 'option',
674 'capability' => 'manage_options',
675 'transport' => 'postMessage',
676 // 'sanitize_callback' => 'section_background'
677 ) );
678
679 $wp_customize->add_control( new WP_Customize_Media_Control( $wp_customize, 'loginpress_customization[background_video]', array(
680 'label' => __( 'Background Video:', 'loginpress' ),
681 'section' => 'section_background',
682 'mime_type' => 'video', // Required. Can be image, audio, video, application, text
683 'priority' => 45,
684 'button_labels' => array(
685 'select' => __( 'Select Video', 'loginpress' ),
686 'change' => __( 'Change Video', 'loginpress' ),
687 'default' => __( 'Default', 'loginpress' ),
688 'remove' => __( 'Remove', 'loginpress' ),
689 'frame_title' => __( 'Select File', 'loginpress' ),
690 'frame_button' => __( 'Choose File', 'loginpress' ),
691 ) ) ) );
692
693 // @version 1.1.21
694 $wp_customize->add_setting( 'loginpress_customization[background_video_object]', array(
695 'default' => 'cover',
696 'type' => 'option',
697 'capability' => 'manage_options',
698 'transport' => 'postMessage',
699 'sanitize_callback' => 'loginpress_sanitize_select'
700 ) );
701 $wp_customize->add_control( 'loginpress_customization[background_video_object]', array(
702 'settings' => 'loginpress_customization[background_video_object]',
703 'label' => __( 'Video Size:', 'loginpress' ),
704 'section' => 'section_background',
705 'priority' => 50,
706 'type' => 'select',
707 'choices' => array(
708 'fill' => 'fill',
709 'contain' => 'contain',
710 'cover' => 'cover',
711 'scale-down' => 'scale-down',
712 'none' => 'none',
713 ),
714 ) );
715
716 $wp_customize->add_setting( "loginpress_customization[video_obj_position]", array(
717 'type' => 'option',
718 'capability' => 'manage_options',
719 'transport' => 'postMessage',
720 'sanitize_callback' => 'wp_strip_all_tags'
721 ) );
722
723 $wp_customize->add_control( "loginpress_customization[video_obj_position]", array(
724 'label' => __( 'Object Postion:', 'loginpress' ),
725 'section' => 'section_background',
726 'priority' => 55,
727 'settings' => "loginpress_customization[video_obj_position]",
728 'input_attrs' => array(
729 'placeholder' => __( '50% 50%', 'directorist' ),
730 )
731 ) );
732
733 /**
734 * [Enable / Disabe Background Video with LoginPress_Radio_Control]
735 * @since 1.1.22
736 */
737 $wp_customize->add_setting( 'loginpress_customization[background_video_muted]', array(
738 'default' => true,
739 'type' => 'option',
740 'capability' => 'manage_options',
741 'transport' => 'postMessage',
742 'sanitize_callback' => 'loginpress_sanitize_checkbox'
743 ) );
744
745 $wp_customize->add_control( new LoginPress_Radio_Control( $wp_customize, 'loginpress_customization[background_video_muted]', array(
746 'settings' => 'loginpress_customization[background_video_muted]',
747 'label' => __( 'Muted Video?', 'loginpress'),
748 'section' => 'section_background',
749 'priority' => 60,
750 'type' => 'ios', // light, ios, flat
751 ) ) );
752
753 // =============================
754 // = Section for Form Beauty =
755 // =============================
756 $wp_customize->add_section( 'section_form', array(
757 'title' => __( 'Customize Login Form', 'loginpress' ),
758 'description' => '',
759 'priority' => 15,
760 'panel' => 'loginpress_panel',
761 ) );
762
763 $this->loginpress_group_setting( $wp_customize, $group_control, $group_label, $group_info, 'section_form', 2, 4 );
764
765 /**
766 * [ Enable / Disabe Form Background Image with LoginPress_Radio_Control ]
767 * @since 1.1.3
768 */
769
770 $wp_customize->add_setting( 'loginpress_customization[setting_form_display_bg]', array(
771 'default' => false,
772 'type' => 'option',
773 'capability' => 'manage_options',
774 'transport' => 'postMessage',
775 'sanitize_callback' => 'loginpress_sanitize_checkbox'
776 ) );
777
778 $wp_customize->add_control( new LoginPress_Radio_Control( $wp_customize, 'loginpress_customization[setting_form_display_bg]', array(
779 'settings' => 'loginpress_customization[setting_form_display_bg]',
780 'label' => __( 'Enable Form Transparency:', 'loginpress'),
781 'section' => 'section_form',
782 'priority' => 5,
783 'type' => 'ios',
784 ) ) );
785
786 $wp_customize->add_setting( 'loginpress_customization[setting_form_background]', array(
787 'type' => 'option',
788 'capability' => 'manage_options',
789 'transport' => 'postMessage',
790 'sanitize_callback' => 'loginpress_sanitize_image'
791 ) );
792
793 $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'loginpress_customization[setting_form_background]', array(
794 'label' => __( 'Form Background Image:', 'loginpress' ),
795 'section' => 'section_form',
796 'priority' => 6,
797 'settings' => 'loginpress_customization[setting_form_background]'
798 ) ) );
799
800 $this->loginpress_color_setting( $wp_customize, $form_color_control, $form_color_label, 'section_form', 0, 7 );
801
802 $this->loginpress_rangle_seting( $wp_customize, $form_range_control, $form_range_default, $form_range_label, $form_range_attrs, $form_range_unit, 'section_form', 0, 15 );
803 $this->loginpress_rangle_seting( $wp_customize, $form_range_control, $form_range_default, $form_range_label, $form_range_attrs, $form_range_unit, 'section_form', 1, 20 );
804 $this->loginpress_rangle_seting( $wp_customize, $form_range_control, $form_range_default, $form_range_label, $form_range_attrs, $form_range_unit, 'section_form', 2, 25 );
805 $this->loginpress_rangle_seting( $wp_customize, $form_range_control, $form_range_default, $form_range_label, $form_range_attrs, $form_range_unit, 'section_form', 3, 30 );
806 $this->loginpress_rangle_seting( $wp_customize, $form_range_control, $form_range_default, $form_range_label, $form_range_attrs, $form_range_unit, 'section_form', 4, 35 );
807
808 $form_padding = 0;
809 while ( $form_padding < 2 ) :
810
811 $wp_customize->add_setting( "loginpress_customization[{$form_control[$form_padding]}]", array(
812 'default' => $form_default[$form_padding],
813 'type' => 'option',
814 'capability' => 'manage_options',
815 'transport' => 'postMessage',
816 'sanitize_callback' => $form_sanitization[$form_padding]
817 ) );
818
819 $wp_customize->add_control( "loginpress_customization[{$form_control[$form_padding]}]", array(
820 'label' => $form_label[$form_padding],
821 'section' => 'section_form',
822 'priority' => 40,
823 'settings' => "loginpress_customization[{$form_control[$form_padding]}]"
824 ) );
825
826 $form_padding++;
827 endwhile;
828
829 $this->loginpress_hr_setting( $wp_customize, $close_control, 'section_form', 3, 41 );
830
831 $this->loginpress_group_setting( $wp_customize, $group_control, $group_label, $group_info, 'section_form', 0, 45 );
832
833 $this->loginpress_color_setting( $wp_customize, $form_color_control, $form_color_label, 'section_form', 1, 50 );
834 $this->loginpress_color_setting( $wp_customize, $form_color_control, $form_color_label, 'section_form', 2, 55 );
835
836 $this->loginpress_rangle_seting( $wp_customize, $form_range_control, $form_range_default, $form_range_label, $form_range_attrs, $form_range_unit, 'section_form', 5, 60 );
837 // textfield_radius.
838 // $this->loginpress_rangle_seting( $wp_customize, $form_range_control, $form_range_default, $form_range_label, $form_range_attrs, $form_range_unit, 'section_form', 6, 65 );
839 // textfield_shadow.
840 // $this->loginpress_rangle_seting( $wp_customize, $form_range_control, $form_range_default, $form_range_label, $form_range_attrs, $form_range_unit, 'section_form', 7, 70 );
841 // textfield_shadow_opacity.
842 // $this->loginpress_rangle_seting( $wp_customize, $form_range_control, $form_range_default, $form_range_label, $form_range_attrs, $form_range_unit, 'section_form', 8, 75 );
843
844 /**
845 * [ Enable / Disabe Form Background Image with LoginPress_Radio_Control ]
846 * @since 1.1.3
847 */
848
849 // $wp_customize->add_setting( 'loginpress_customization[textfield_inset_shadow]', array(
850 // 'default' => false,
851 // 'type' => 'option',
852 // 'capability' => 'manage_options',
853 // 'transport' => 'postMessage'
854 // ) );
855 //
856 // $wp_customize->add_control( new LoginPress_Radio_Control( $wp_customize, 'loginpress_customization[textfield_inset_shadow]', array(
857 // 'settings' => 'loginpress_customization[textfield_inset_shadow]',
858 // 'label' => __( 'Input Text Field Shadow Inset:', 'loginpress'),
859 // 'section' => 'section_form',
860 // 'priority' => 80,
861 // 'type' => 'ios',// light, ios, flat
862 // ) ) );
863
864 $input_padding = 2;
865 while ( $input_padding < 3 ) :
866
867 $wp_customize->add_setting( "loginpress_customization[{$form_control[$input_padding]}]", array(
868 'default' => $form_default[$input_padding],
869 'type' => 'option',
870 'capability' => 'manage_options',
871 'transport' => 'postMessage',
872 'sanitize_callback' => $form_sanitization[$input_padding]
873 ) );
874
875 $wp_customize->add_control( "loginpress_customization[{$form_control[$input_padding]}]", array(
876 'label' => $form_label[$input_padding],
877 'section' => 'section_form',
878 'priority' => 85,
879 'settings' => "loginpress_customization[{$form_control[$input_padding]}]"
880 ) );
881
882 $input_padding++;
883 endwhile;
884
885 $this->loginpress_hr_setting( $wp_customize, $close_control, 'section_form', 4, 86 );
886 $this->loginpress_group_setting( $wp_customize, $group_control, $group_label, $group_info, 'section_form', 1, 90 );
887
888 // $form_input_label = 3;
889 // while ( $form_input_label < 5 ) :
890 //
891 // $wp_customize->add_setting( "loginpress_customization[{$form_control[$form_input_label]}]", array(
892 // 'default' => $form_default[$form_input_label],
893 // 'type' => 'option',
894 // 'capability' => 'manage_options',
895 // 'transport' => 'postMessage'
896 // ) );
897 //
898 // $wp_customize->add_control( "loginpress_customization[{$form_control[$form_input_label]}]", array(
899 // 'label' => $form_label[$form_input_label],
900 // 'section' => 'section_form',
901 // 'priority' => 91,
902 // 'settings' => "loginpress_customization[{$form_control[$form_input_label]}]"
903 // ) );
904 //
905 // $form_input_label++;
906 // endwhile;
907
908 $this->loginpress_color_setting( $wp_customize, $form_color_control, $form_color_label, 'section_form', 3, 95 );
909 $this->loginpress_color_setting( $wp_customize, $form_color_control, $form_color_label, 'section_form', 4, 100 );
910
911 // customize_form_label.
912 $this->loginpress_rangle_seting( $wp_customize, $form_range_control, $form_range_default, $form_range_label, $form_range_attrs, $form_range_unit, 'section_form', 9, 105 );
913 // remember_me_font_size.
914 $this->loginpress_rangle_seting( $wp_customize, $form_range_control, $form_range_default, $form_range_label, $form_range_attrs, $form_range_unit, 'section_form', 10, 110 );
915 $this->loginpress_hr_setting( $wp_customize, $close_control, 'section_form', 5, 111 );
916
917 // =============================
918 // = Section for Forget Form =
919 // =============================
920 $wp_customize->add_section(
921 'section_forget_form',
922 array(
923 'title' => __( 'Customize Forget Form', 'loginpress' ),
924 'description' => '',
925 'priority' => 20,
926 'panel' => 'loginpress_panel',
927 ) );
928
929 $wp_customize->add_setting( 'loginpress_customization[forget_form_background]', array(
930 'type' => 'option',
931 'capability' => 'manage_options',
932 'transport' => 'postMessage',
933 'sanitize_callback' => 'loginpress_sanitize_image'
934 ) );
935
936 $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'loginpress_customization[forget_form_background]', array(
937 'label' => __( 'Forget Form Background Image:', 'loginpress' ),
938 'section' => 'section_forget_form',
939 'priority' => 5,
940 'settings' => 'loginpress_customization[forget_form_background]'
941 ) ) );
942
943 $wp_customize->add_setting( 'loginpress_customization[forget_form_background_color]', array(
944 // 'default' => '#FFF',
945 'type' => 'option',
946 'capability' => 'manage_options',
947 'transport' => 'postMessage',
948 'sanitize_callback' => 'sanitize_hex_color' // validates 3 or 6 digit HTML hex color code.
949 ) );
950
951 $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'loginpress_customization[forget_form_background_color]', array(
952 'label' => __( 'Forget Form Background Color:', 'loginpress' ),
953 'section' => 'section_forget_form',
954 'priority' => 10,
955 'settings' => 'loginpress_customization[forget_form_background_color]'
956 ) ) );
957
958 // =============================
959 // = Section for Button Style =
960 // =============================
961 $wp_customize->add_section( 'section_button', array(
962 'title' => __( 'Button Beauty', 'loginpress' ),
963 'description' => '',
964 'priority' => 25,
965 'panel' => 'loginpress_panel',
966 ) );
967
968 $this->loginpress_color_setting( $wp_customize, $button_control, $button_label, 'section_button', 0, 5 );
969 $this->loginpress_color_setting( $wp_customize, $button_control, $button_label, 'section_button', 1, 10 );
970 $this->loginpress_color_setting( $wp_customize, $button_control, $button_label, 'section_button', 2, 15 );
971 $this->loginpress_color_setting( $wp_customize, $button_control, $button_label, 'section_button', 3, 20 );
972 $this->loginpress_color_setting( $wp_customize, $button_control, $button_label, 'section_button', 4, 25 );
973 $this->loginpress_color_setting( $wp_customize, $button_control, $button_label, 'section_button', 5, 30 );
974 $this->loginpress_color_setting( $wp_customize, $button_control, $button_label, 'section_button', 6, 35 );
975
976 /**
977 * [ Change Button CSS Properties with LoginPress_Range_Control ]
978 * @since 1.0.1
979 * @version 1.1.3
980 */
981
982 $this->loginpress_rangle_seting( $wp_customize, $button_range_control, $button_range_default, $button_range_label, $button_range_attrs, $button_range_unit, 'section_button', 0, 35 );
983 $this->loginpress_rangle_seting( $wp_customize, $button_range_control, $button_range_default, $button_range_label, $button_range_attrs, $button_range_unit, 'section_button', 1, 40 );
984 $this->loginpress_rangle_seting( $wp_customize, $button_range_control, $button_range_default, $button_range_label, $button_range_attrs, $button_range_unit, 'section_button', 2, 45 );
985 $this->loginpress_rangle_seting( $wp_customize, $button_range_control, $button_range_default, $button_range_label, $button_range_attrs, $button_range_unit, 'section_button', 3, 50 );
986 $this->loginpress_rangle_seting( $wp_customize, $button_range_control, $button_range_default, $button_range_label, $button_range_attrs, $button_range_unit, 'section_button', 4, 55 );
987 $this->loginpress_rangle_seting( $wp_customize, $button_range_control, $button_range_default, $button_range_label, $button_range_attrs, $button_range_unit, 'section_button', 5, 60 );
988 $this->loginpress_rangle_seting( $wp_customize, $button_range_control, $button_range_default, $button_range_label, $button_range_attrs, $button_range_unit, 'section_button', 6, 65 );
989
990 // =============================
991 // = Section for Error message =
992 // =============================
993 $wp_customize->add_section( 'section_error', array(
994 'title' => __( 'Error Messages', 'loginpress' ),
995 'description' => '',
996 'priority' => 30,
997 'panel' => 'loginpress_panel',
998 ) );
999
1000 $error = 0;
1001 while ( $error < 10 ) :
1002
1003 $wp_customize->add_setting( "loginpress_customization[{$error_control[$error]}]", array(
1004 'default' => $error_default[$error],
1005 'type' => 'option',
1006 'capability' => 'manage_options',
1007 'transport' => 'postMessage',
1008 'sanitize_callback' => 'wp_kses_post'
1009 ) );
1010
1011 $wp_customize->add_control( "loginpress_customization[{$error_control[$error]}]", array(
1012 'label' => $error_label[$error],
1013 'section' => 'section_error',
1014 'priority' => 5,
1015 'settings' => "loginpress_customization[{$error_control[$error]}]",
1016 ) );
1017
1018 $error++;
1019 endwhile;
1020
1021 // =============================
1022 // = Section for Welcome message
1023 // =============================
1024 $wp_customize->add_section( 'section_welcome', array(
1025 'title' => __( 'Welcome Messages', 'loginpress' ),
1026 'description' => '',
1027 'priority' => 35,
1028 'panel' => 'loginpress_panel',
1029 ) );
1030
1031 $welcome = 0;
1032 while ( $welcome < 5 ) :
1033
1034 $wp_customize->add_setting( "loginpress_customization[{$welcome_control[$welcome]}]", array(
1035 'type' => 'option',
1036 'capability' => 'manage_options',
1037 'transport' => 'postMessage',
1038 'sanitize_callback' => $welcome_sanitization[$welcome]
1039 ));
1040
1041 $wp_customize->add_control( "loginpress_customization[{$welcome_control[$welcome]}]", array(
1042 'label' => $welcome_label[ $welcome ],
1043 'section' => 'section_welcome',
1044 'priority' => 5,
1045 'settings' => "loginpress_customization[{$welcome_control[$welcome]}]",
1046 'input_attrs' => array(
1047 'placeholder' => $welcome_default[ $welcome ],
1048 )
1049 ) );
1050
1051 $welcome++;
1052 endwhile;
1053
1054 $wp_customize->add_setting( 'loginpress_customization[message_background_color]', array(
1055 // 'default' => '#fff',
1056 'type' => 'option',
1057 'capability' => 'manage_options',
1058 'transport' => 'postMessage',
1059 'sanitize_callback' => 'sanitize_hex_color' // validates 3 or 6 digit HTML hex color code.
1060 ) );
1061
1062 $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'loginpress_customization[message_background_color]', array(
1063 'label' => __( 'Message Field Background Color:', 'loginpress' ),
1064 'section' => 'section_welcome',
1065 'priority' => 30,
1066 'settings' => 'loginpress_customization[message_background_color]'
1067 ) ) );
1068
1069 // =============================
1070 // = Section for Header message
1071 // =============================
1072 // $wp_customize->add_section(
1073 // 'section_head',
1074 // array(
1075 // 'title' => __( 'Header Message', 'loginpress' ),
1076 // 'description' => '',
1077 // 'priority' => 35,
1078 // 'panel' => 'loginpress_panel',
1079 // ));
1080 //
1081 // $wp_customize->add_setting( 'loginpress_customization[login_hearder_message]', array(
1082 // 'default' => 'Latest NEWS',
1083 // 'type' => 'option',
1084 // 'capability' => 'edit_theme_options',
1085 // ));
1086 //
1087 // $wp_customize->add_control( 'login_hearder_message', array(
1088 // 'label' => __( 'Header Message:', 'loginpress' ),
1089 // 'section' => 'section_head',
1090 // 'priority' => 5,
1091 // 'settings' => 'loginpress_customization[login_hearder_message]',
1092 // ));
1093 //
1094 // $wp_customize->add_setting( 'loginpress_customization[login_hearder_message_link]', array(
1095 // 'default' => '#',
1096 // 'type' => 'option',
1097 // 'capability' => 'edit_theme_options',
1098 // ));
1099 //
1100 // $wp_customize->add_control( 'login_hearder_message_link', array(
1101 // 'label' => __( 'Header Message Link:', 'loginpress' ),
1102 // 'section' => 'section_head',
1103 // 'priority' => 5,
1104 // 'settings' => 'loginpress_customization[login_hearder_message_link]',
1105 // ));
1106 //
1107 // $wp_customize->add_setting( 'loginpress_customization[login_head_color]', array(
1108 // 'default' => '#17a8e3',
1109 // 'type' => 'option',
1110 // 'capability' => 'edit_theme_options',
1111 // ));
1112 //
1113 // $wp_customize->add_control(
1114 // new WP_Customize_Color_Control(
1115 // $wp_customize,
1116 // 'login_head_color',
1117 // array(
1118 // 'label' => __( 'Header Text Color:', 'loginpress' ),
1119 // 'section' => 'section_head',
1120 // 'priority' => 10,
1121 // 'settings' => 'loginpress_customization[login_head_color]'
1122 // )));
1123 //
1124 // $wp_customize->add_setting( 'loginpress_customization[login_head_color_hover]', array(
1125 // // 'default' => '#17a8e3',
1126 // 'type' => 'option',
1127 // 'capability' => 'edit_theme_options',
1128 // ));
1129 //
1130 // $wp_customize->add_control(
1131 // new WP_Customize_Color_Control(
1132 // $wp_customize,
1133 // 'login_head_color_hover',
1134 // array(
1135 // 'label' => __( 'Header Text Hover Color:', 'loginpress' ),
1136 // 'section' => 'section_head',
1137 // 'priority' => 15,
1138 // 'settings' => 'loginpress_customization[login_head_color_hover]'
1139 // )));
1140 //
1141 // $wp_customize->add_setting( 'loginpress_customization[login_head_font_size]', array(
1142 // 'default' => '13px;',
1143 // 'type' => 'option',
1144 // 'capability' => 'edit_theme_options',
1145 // ));
1146 //
1147 // $wp_customize->add_control( 'login_head_font_size', array(
1148 // 'label' => __( 'Text Font Size:', 'loginpress' ),
1149 // 'section' => 'section_head',
1150 // 'priority' => 20,
1151 // 'settings' => 'loginpress_customization[login_head_font_size]',
1152 // ));
1153 //
1154 // $wp_customize->add_setting( 'loginpress_customization[login_head_bg_color]', array(
1155 // // 'default' => '#17a8e3',
1156 // 'type' => 'option',
1157 // 'capability' => 'edit_theme_options',
1158 // ));
1159 //
1160 // $wp_customize->add_control(
1161 // new WP_Customize_Color_Control(
1162 // $wp_customize,
1163 // 'login_head_bg_color',
1164 // array(
1165 // 'label' => __( 'Header Background Color:', 'loginpress' ),
1166 // 'section' => 'section_head',
1167 // 'priority' => 25,
1168 // 'settings' => 'loginpress_customization[login_head_bg_color]'
1169 // )));
1170
1171 // =============================
1172 // = Section for Form Footer =
1173 // =============================
1174 $wp_customize->add_section( 'section_fotter', array(
1175 'title' => __( 'Form Footer', 'loginpress' ),
1176 'description' => '',
1177 'priority' => 40,
1178 'panel' => 'loginpress_panel',
1179 ) );
1180
1181 $this->loginpress_group_setting( $wp_customize, $group_control, $group_label, $group_info, 'section_fotter', 3, 4 );
1182
1183 $wp_customize->add_setting( 'loginpress_customization[footer_display_text]', array(
1184 'default' => true,
1185 'type' => 'option',
1186 'capability' => 'manage_options',
1187 'transport' => 'postMessage',
1188 'sanitize_callback' => 'loginpress_sanitize_checkbox'
1189 ));
1190
1191 /**
1192 * [Enable / Disabe Footer Text with LoginPress_Radio_Control]
1193 * @since 1.0.1
1194 * @version 1.0.23
1195 */
1196 $wp_customize->add_control( new LoginPress_Radio_Control( $wp_customize, 'loginpress_customization[footer_display_text]', array(
1197 'settings' => 'loginpress_customization[footer_display_text]',
1198 'label' => __( 'Enable Footer Text:', 'loginpress' ),
1199 'section' => 'section_fotter',
1200 'priority' => 5,
1201 'type' => 'ios',// light, ios, flat
1202 ) ) );
1203
1204 $wp_customize->add_setting( 'loginpress_customization[login_footer_text]', array(
1205 'default' => __( 'Lost your password?', 'loginpress' ),
1206 'type' => 'option',
1207 'capability' => 'manage_options',
1208 'transport' => 'postMessage',
1209 'sanitize_callback' => 'wp_kses_post'
1210 ) );
1211
1212 $wp_customize->add_control( 'loginpress_customization[login_footer_text]', array(
1213 'label' => __( 'Lost Password Text:', 'loginpress' ),
1214 'section' => 'section_fotter',
1215 'priority' => 10,
1216 'settings' => 'loginpress_customization[login_footer_text]',
1217 ) );
1218
1219 $wp_customize->add_setting( 'loginpress_customization[login_footer_text_decoration]', array(
1220 'default' => 'none',
1221 'type' => 'option',
1222 'capability' => 'manage_options',
1223 'transport' => 'postMessage',
1224 'sanitize_callback' => 'loginpress_sanitize_select'
1225
1226 ) );
1227 $wp_customize->add_control( 'loginpress_customization[login_footer_text_decoration]', array(
1228 'settings' => 'loginpress_customization[login_footer_text_decoration]',
1229 'label' => __( 'Select Text Decoration:', 'loginpress' ),
1230 'section' => 'section_fotter',
1231 'priority' => 15,
1232 'type' => 'select',
1233 'choices' => array(
1234 'none' => 'none',
1235 'overline' => 'overline',
1236 'line-through' => 'line-through',
1237 'underline' => 'underline',
1238 ),
1239 ) );
1240
1241 $wp_customize->add_setting( 'loginpress_customization[login_footer_color]', array(
1242 // 'default' => '#17a8e3',
1243 'type' => 'option',
1244 'capability' => 'manage_options',
1245 'transport' => 'postMessage',
1246 'sanitize_callback' => 'sanitize_hex_color' // validates 3 or 6 digit HTML hex color code.
1247 ) );
1248
1249 $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'loginpress_customization[login_footer_color]', array(
1250 'label' => __( 'Footer Text Color:', 'loginpress' ),
1251 'section' => 'section_fotter',
1252 'priority' => 20,
1253 'settings' => 'loginpress_customization[login_footer_color]'
1254 ) ) );
1255
1256 $wp_customize->add_setting( 'loginpress_customization[login_footer_color_hover]', array(
1257 // 'default' => '#17a8e3',
1258 'type' => 'option',
1259 'capability' => 'manage_options',
1260 'transport' => 'postMessage',
1261 'sanitize_callback' => 'sanitize_hex_color' // validates 3 or 6 digit HTML hex color code.
1262 ) );
1263
1264 $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'loginpress_customization[login_footer_color_hover]', array(
1265 'label' => __( 'Footer Text Hover Color:', 'loginpress' ),
1266 'section' => 'section_fotter',
1267 'priority' => 25,
1268 'settings' => 'loginpress_customization[login_footer_color_hover]'
1269 ) ) );
1270
1271 $wp_customize->add_setting( "loginpress_customization[login_footer_font_size]", array(
1272 'default' => '13',
1273 'type' => 'option',
1274 'capability' => 'manage_options',
1275 'transport' => 'postMessage',
1276 'sanitize_callback' => 'absint',
1277 ) );
1278
1279 /**
1280 * [ Change login_footer_font_size Input fields with LoginPress_Range_Control ]
1281 * @since 1.0.1
1282 * @version 1.0.23
1283 */
1284 $wp_customize->add_control( new LoginPress_Range_Control( $wp_customize, "loginpress_customization[login_footer_font_size]", array(
1285 'type' => 'loginpress-range',
1286 'label' => __( 'Text Font Size:', 'loginpress' ),
1287 'section' => 'section_fotter',
1288 'settings' => "loginpress_customization[login_footer_font_size]",
1289 'default' => '13',
1290 'priority' => 30,
1291 'input_attrs' => array( 'min' => 0, 'max' => 100, 'step' => 1, 'suffix' => 'px' )
1292 ) ) );
1293
1294 $wp_customize->add_setting( 'loginpress_customization[login_footer_bg_color]', array(
1295 // 'default' => '#17a8e3',
1296 'type' => 'option',
1297 'capability' => 'manage_options',
1298 'transport' => 'postMessage',
1299 'sanitize_callback' => 'sanitize_hex_color' // validates 3 or 6 digit HTML hex color code.
1300 ) );
1301
1302 $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'loginpress_customization[login_footer_bg_color]', array(
1303 'label' => __( 'Footer Background Color:', 'loginpress' ),
1304 'section' => 'section_fotter',
1305 'priority' => 35,
1306 'settings' => 'loginpress_customization[login_footer_bg_color]'
1307 ) ) );
1308
1309 $this->loginpress_hr_setting( $wp_customize, $close_control, 'section_fotter', 0, 36 );
1310
1311 $this->loginpress_group_setting( $wp_customize, $group_control, $group_label, $group_info, 'section_fotter', 4, 40 );
1312
1313 $wp_customize->add_setting( 'loginpress_customization[back_display_text]', array(
1314 'default' => true,
1315 'type' => 'option',
1316 'capability' => 'manage_options',
1317 'transport' => 'postMessage',
1318 'sanitize_callback' => 'loginpress_sanitize_checkbox'
1319 ) );
1320
1321 /**
1322 * [Enable / Disabe Footer Text with LoginPress_Radio_Control]
1323 * @since 1.0.1
1324 * @version 1.0.23
1325 */
1326 $wp_customize->add_control( new LoginPress_Radio_Control( $wp_customize, 'loginpress_customization[back_display_text]', array(
1327 'settings' => 'loginpress_customization[back_display_text]',
1328 'label' => __( 'Enable "Back to" Text:', 'loginpress' ),
1329 'section' => 'section_fotter',
1330 'priority' => 45,
1331 'type' => 'ios', // light, ios, flat
1332 ) ) );
1333
1334 $wp_customize->add_setting( 'loginpress_customization[login_back_text_decoration]', array(
1335 'default' => 'none',
1336 'type' => 'option',
1337 'capability' => 'manage_options',
1338 'transport' => 'postMessage',
1339 'sanitize_callback' => 'loginpress_sanitize_select'
1340
1341 ) );
1342 $wp_customize->add_control( 'loginpress_customization[login_back_text_decoration]', array(
1343 'settings' => 'loginpress_customization[login_back_text_decoration]',
1344 'label' => __( '"Back to" Text Decoration:', 'loginpress' ),
1345 'section' => 'section_fotter',
1346 'priority' => 50,
1347 'type' => 'select',
1348 'choices' => array(
1349 'none' => 'none',
1350 'overline' => 'overline',
1351 'line-through' => 'line-through',
1352 'underline' => 'underline',
1353 ),
1354 ) );
1355
1356 $wp_customize->add_setting( 'loginpress_customization[login_back_color]', array(
1357 // 'default' => '#17a8e3',
1358 'type' => 'option',
1359 'capability' => 'manage_options',
1360 'transport' => 'postMessage',
1361 'sanitize_callback' => 'sanitize_hex_color' // validates 3 or 6 digit HTML hex color code.
1362 ) );
1363
1364 $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'loginpress_customization[login_back_color]', array(
1365 'label' => __( '"Back to" Text Color:', 'loginpress' ),
1366 'section' => 'section_fotter',
1367 'priority' => 55,
1368 'settings' => 'loginpress_customization[login_back_color]'
1369 ) ) );
1370
1371 $wp_customize->add_setting( 'loginpress_customization[login_back_color_hover]', array(
1372 // 'default' => '#17a8e3',
1373 'type' => 'option',
1374 'capability' => 'manage_options',
1375 'transport' => 'postMessage',
1376 'sanitize_callback' => 'sanitize_hex_color' // validates 3 or 6 digit HTML hex color code.
1377 ) );
1378
1379 $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'loginpress_customization[login_back_color_hover]', array(
1380 'label' => __( '"Back to" Text Hover Color:', 'loginpress' ),
1381 'section' => 'section_fotter',
1382 'priority' => 60,
1383 'settings' => 'loginpress_customization[login_back_color_hover]'
1384 ) ) );
1385
1386 $wp_customize->add_setting( "loginpress_customization[login_back_font_size]", array(
1387 'default' => '13',
1388 'type' => 'option',
1389 'capability' => 'manage_options',
1390 'transport' => 'postMessage',
1391 'sanitize_callback' => 'absint',
1392 ) );
1393 $wp_customize->add_setting( 'loginpress_customization[loginpress_show_love]', array(
1394 'default' => true,
1395 'type' => 'option',
1396 'capability' => 'manage_options',
1397 'transport' => 'postMessage',
1398 'sanitize_callback' => 'loginpress_sanitize_checkbox'
1399 ) );
1400
1401 /**
1402 * [ Change login_back_font_size Input fields with LoginPress_Range_Control ]
1403 * @since 1.0.1
1404 * @version 1.0.23
1405 */
1406 $wp_customize->add_control( new LoginPress_Range_Control( $wp_customize, "loginpress_customization[login_back_font_size]", array(
1407 'type' => 'loginpress-range',
1408 'label' => __( '"Back to" Text Font Size:', 'loginpress' ),
1409 'section' => 'section_fotter',
1410 'settings' => "loginpress_customization[login_back_font_size]",
1411 'default' => '13',
1412 'priority' => 65,
1413 'input_attrs' => array( 'min' => 0, 'max' => 100, 'step' => 1, 'suffix' => 'px' )
1414 ) ) );
1415
1416 $wp_customize->add_setting( 'loginpress_customization[login_back_bg_color]', array(
1417 // 'default' => '#17a8e3',
1418 'type' => 'option',
1419 'capability' => 'manage_options',
1420 'transport' => 'postMessage',
1421 'sanitize_callback' => 'sanitize_hex_color' // validates 3 or 6 digit HTML hex color code.
1422 ) );
1423
1424 $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'loginpress_customization[login_back_bg_color]', array(
1425 'label' => __( '"Back to" Background Color:', 'loginpress' ),
1426 'section' => 'section_fotter',
1427 'priority' => 70,
1428 'settings' => 'loginpress_customization[login_back_bg_color]'
1429 ) ) );
1430
1431 $this->loginpress_hr_setting( $wp_customize, $close_control, 'section_fotter', 1, 71 );
1432
1433 $this->loginpress_group_setting( $wp_customize, $group_control, $group_label, $group_info, 'section_fotter', 5, 72 );
1434
1435 /**
1436 * [Enable / Disabe Footer Text with LoginPress_Radio_Control]
1437 * @since 1.1.3
1438 */
1439 $wp_customize->add_setting( 'loginpress_customization[login_copy_right_display]', array(
1440 'default' => false,
1441 'type' => 'option',
1442 'capability' => 'manage_options',
1443 'transport' => 'postMessage',
1444 'sanitize_callback' => 'loginpress_sanitize_checkbox'
1445 ) );
1446 $wp_customize->add_control( new LoginPress_Radio_Control( $wp_customize, 'loginpress_customization[login_copy_right_display]', array(
1447 'settings' => 'loginpress_customization[login_copy_right_display]',
1448 'section' => 'section_fotter',
1449 'priority' => 73,
1450 'type' => 'ios',// light, ios, flat
1451 'label' => __( 'Enable Copyright Note:', 'loginpress' ),
1452 ) ) );
1453
1454 $wp_customize->add_setting( 'loginpress_customization[copyright_background_color]', array(
1455 'default' => '#efefef',
1456 'type' => 'option',
1457 'capability' => 'manage_options',
1458 'transport' => 'postMessage',
1459 'sanitize_callback' => 'sanitize_hex_color' // validates 3 or 6 digit HTML hex color code.
1460 ) );
1461
1462 $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'loginpress_customization[copyright_background_color]', array(
1463 'label' => __( '"Copyright" Background Color:', 'loginpress' ),
1464 'section' => 'section_fotter',
1465 'priority' => 74,
1466 'settings' => 'loginpress_customization[copyright_background_color]'
1467 ) ) );
1468
1469 //Form Footer Text Color
1470 $wp_customize->add_setting( 'loginpress_customization[copyright_text_color]', array(
1471 'default' => '#000000',
1472 'type' => 'option',
1473 'capability' => 'manage_options',
1474 'transport' => 'postMessage',
1475 'sanitize_callback' => 'sanitize_hex_color' // validates 3 or 6 digit HTML hex color code.
1476 ) );
1477
1478 $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'loginpress_customization[copyright_text_color]', array(
1479 'label' => __( '"Copyright" Text Color:', 'loginpress' ),
1480 'section' => 'section_fotter',
1481 'priority' => 75,
1482 'settings' => 'loginpress_customization[copyright_text_color]'
1483 ) ) );
1484
1485 $wp_customize->add_setting( 'loginpress_customization[login_footer_copy_right]', array(
1486 'default' => sprintf( __('© %1$s %2$s, All Rights Reserved.', 'loginpress'), date("Y"), get_bloginfo('name') ),
1487 'type' => 'option',
1488 'capability' => 'manage_options',
1489 'transport' => 'postMessage',
1490 'sanitize_callback' => 'wp_kses_post'
1491 ) );
1492
1493 //Show Some Love text Color
1494 // $wp_customize->add_setting( 'loginpress_customization[show_some_love_text_color]', array(
1495 // // 'default' => '#17a8e3',
1496 // 'type' => 'option',
1497 // 'capability' => 'manage_options',
1498 // 'transport' => 'postMessage',
1499 // 'sanitize_callback' => 'sanitize_hex_color' // validates 3 or 6 digit HTML hex color code.
1500 // ) );
1501
1502 // $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'loginpress_customization[show_some_love_text_color]', array(
1503 // 'label' => __( '"Show Some Love" Text Color:', 'loginpress' ),
1504 // 'section' => 'section_fotter',
1505 // 'priority' => 76,
1506 // 'settings' => 'loginpress_customization[show_some_love_text_color]'
1507 // ) ) );
1508 /**
1509 * [Add Copyright string in the footer along with year]
1510 *
1511 * @version 1.5.4
1512 */
1513 $wp_customize->add_setting( 'loginpress_customization[login_footer_copy_right]', array(
1514 'default' => sprintf( __('© %1$s %2$s, All Rights Reserved.', 'loginpress'), '$YEAR$' , get_bloginfo('name') ),
1515 'type' => 'option',
1516 'capability' => 'manage_options',
1517 'transport' => 'postMessage',
1518 'sanitize_callback' => 'wp_kses_post'
1519 ) );
1520 $wp_customize->add_control( 'loginpress_customization[login_footer_copy_right]', array(
1521 'label' => __( 'Copyright Note:', 'loginpress' ),
1522 'description' => sprintf( __( '%1$s will be replaced with the current year.', 'loginpress' ), '<code>$YEAR$</code>' ),
1523 'type' => 'textarea',
1524 'section' => 'section_fotter',
1525 'priority' => 77,
1526 'settings' => 'loginpress_customization[login_footer_copy_right]'
1527 ) );
1528
1529 /**
1530 * [Enable / Disabe Footer Text with LoginPress_Radio_Control]
1531 * @since 1.0.1
1532 * @version 1.0.23
1533 */
1534 $wp_customize->add_control( new LoginPress_Radio_Control( $wp_customize, 'loginpress_customization[loginpress_show_love]', array(
1535 'settings' => 'loginpress_customization[loginpress_show_love]',
1536 'section' => 'section_fotter',
1537 'priority' => 80,
1538 'type' => 'ios', // light, ios, flat
1539 'label' => __( 'Show some Love. Please help others learn about this free plugin by placing small link in footer. Thank you very much!', 'loginpress' ),
1540 ) ) );
1541
1542 /**
1543 * [Love position on footer.]
1544 * @since 1.1.3
1545 */
1546 $wp_customize->add_setting( 'loginpress_customization[show_love_position]', array(
1547 'default' => 'right',
1548 'type' => 'option',
1549 'capability' => 'manage_options',
1550 'transport' => 'postMessage',
1551 // 'sanitize_callback' => 'loginpress_sanitize_checkbox'
1552 ) );
1553
1554 $wp_customize->add_control( 'loginpress_customization[show_love_position]', array(
1555 'label' => __( 'Love Position:', 'loginpress' ),
1556 'section' => 'section_fotter',
1557 'priority' => 85,
1558 'settings' => 'loginpress_customization[show_love_position]',
1559 'type' => 'radio',
1560 'choices' => array(
1561 'left' => __( 'Left', 'loginpress' ),
1562 'right' => __( 'Right', 'loginpress' ),
1563 ),
1564 ) );
1565 $this->loginpress_hr_setting( $wp_customize, $close_control, 'section_fotter', 2, 90 );
1566 // $this->loginpress_group_setting( $wp_customize, $group_control, $group_label, $group_info, 'section_fotter', 2, 90 );
1567
1568 // =============================
1569 // = Section for Custom CSS/JS =
1570 // =============================
1571 $wp_customize->add_section(
1572 'loginpress_custom_css_js',
1573 array(
1574 'title' => __( 'Custom CSS/JS', 'loginpress' ),
1575 'description' => '',
1576 'priority' => 50,
1577 'panel' => 'loginpress_panel',
1578 ) );
1579
1580 $wp_customize->add_setting( 'loginpress_customization[loginpress_custom_css]', array(
1581 'type' => 'option',
1582 'capability' => 'manage_options',
1583 'transport' => 'postMessage'
1584 ) );
1585
1586 $wp_customize->add_control( 'loginpress_customization[loginpress_custom_css]', array(
1587 'label' => __( 'Customize CSS:', 'loginpress' ),
1588 'type' => 'textarea',
1589 'section' => 'loginpress_custom_css_js',
1590 'priority' => 5,
1591 'settings' => 'loginpress_customization[loginpress_custom_css]',
1592 'description' => sprintf( __( 'Custom CSS doen\'t make effect live. For preview please save the setting and visit %1$s login%2$s page or after save refresh the customizer.', "loginpress" ), '<a href="' . wp_login_url() .'"title="Login" target="_blank">', '</a>')
1593 ) );
1594
1595 $wp_customize->add_setting( 'loginpress_customization[loginpress_custom_js]', array(
1596 'type' => 'option',
1597 'capability' => 'manage_options',
1598 'transport' => 'postMessage'
1599 ) );
1600
1601 $wp_customize->add_control( 'loginpress_customization[loginpress_custom_js]', array(
1602 'label' => __( 'Customize JS:', 'loginpress' ),
1603 'type' => 'textarea',
1604 'section' => 'loginpress_custom_css_js',
1605 'priority' => 10,
1606 'settings' => 'loginpress_customization[loginpress_custom_js]',
1607 'description' => sprintf( __( 'Custom JS doen\'t make effect live. For preview please save the setting and visit %1$s login%2$s page or after save refresh the customizer.', "loginpress" ), '<a href="' . wp_login_url() .'"title="Login" target="_blank">', '</a>')
1608 ) );
1609 }
1610
1611 /**
1612 * Manage the Login Footer Links
1613 *
1614 * @since 1.0.0
1615 * @version 1.6.4
1616 * * * * * * * * * * * * * * * */
1617 public function login_page_custom_footer() {
1618
1619 /**
1620 * Add brand position class.
1621 * @since 1.1.3
1622 * @version 1.6.4
1623 */
1624 $position = ''; // Empty variable for storing position class.
1625 if ( $this->loginpress_key ) {
1626 if ( isset( $this->loginpress_key['show_love_position'] ) && $this->loginpress_key['show_love_position'] == 'left' ) {
1627 $position = ' love-position';
1628 }
1629 }
1630
1631 /**
1632 * Add functionality of disabling the templates of LoginPress.
1633 *
1634 * @since 1.6.4
1635 */
1636 $disable_default_style = (bool) apply_filters( 'loginpress_disable_default_style', false );
1637
1638 if ( $this->loginpress_preset === 'default1' && $disable_default_style ) {
1639 include( LOGINPRESS_DIR_PATH . 'include/login-footer.php' );
1640 }
1641
1642 if ( empty( $this->loginpress_key ) || ( isset( $this->loginpress_key['loginpress_show_love'] ) && $this->loginpress_key['loginpress_show_love'] != '' ) ) {
1643 echo '<div class="loginpress-show-love' . $position . '">' . __( 'Powered by:', 'loginpress' ) . ' <a href="https://wpbrigade.com" target="_blank">LoginPress</a></div>';
1644 } elseif ( empty( $this->loginpress_key ) || ( ! isset( $this->loginpress_key['loginpress_show_love'] ) ) ) {
1645 echo '<div class="loginpress-show-love' . $position . '">' . __( 'Powered by:', 'loginpress' ) . ' <a href="https://wpbrigade.com" target="_blank">LoginPress</a></div>';
1646 }
1647
1648 echo '<div class="footer-wrapper">';
1649 echo '<div class="footer-cont">';
1650
1651 if ( $this->loginpress_key ) {
1652 // do_action( 'loginpress_footer_wrapper' );
1653 do_action( 'loginpress_footer_menu' );
1654
1655 if ( array_key_exists( 'login_copy_right_display', $this->loginpress_key ) && true == $this->loginpress_key['login_copy_right_display'] ) {
1656
1657 /**
1658 * Replace the "$YEAR$" with current year if and where found.
1659 * @since 1.5.4
1660 * @version 1.5.6
1661 */
1662 if( isset( $this->loginpress_key['login_footer_copy_right'] ) && ! empty( $this->loginpress_key['login_footer_copy_right'] ) && strpos( $this->loginpress_key['login_footer_copy_right'], '$YEAR$' ) !== false ) {
1663
1664 $year = date( "Y" );
1665 //Setting the value with current year and saving in the 'login_footer_copy_right' key
1666 $this->loginpress_key['login_footer_copy_right'] = str_replace( '$YEAR$', $year, $this->loginpress_key['login_footer_copy_right'] );
1667 }
1668
1669 // Show a default value if not changed or show the changed text string for 'login_footer_copy_right'
1670 $footer_text = ( array_key_exists( 'login_footer_copy_right', $this->loginpress_key ) && ! empty( $this->loginpress_key['login_footer_copy_right'] ) ) ? $this->loginpress_key['login_footer_copy_right'] : sprintf( __('© %1$s %2$s, All Rights Reserved.', 'loginpress' ), date( "Y" ), get_bloginfo( 'name' ) );
1671
1672 echo '<div class="copyRight">'. apply_filters( 'loginpress_footer_copyright', $footer_text ) .'</div>';
1673 }
1674 }
1675 echo '</div></div>';
1676
1677 /**
1678 * Include LoginPress script in footer.
1679 * @since 1.2.2
1680 */
1681 include( LOGINPRESS_DIR_PATH . 'js/script-login.php' );
1682 }
1683
1684 /**
1685 * Manage the Login Head
1686 *
1687 * @since 1.0.0
1688 * @version 1.6.4
1689 * * * * * * * * * * * */
1690 public function login_page_custom_head() {
1691
1692 $loginpress_setting = get_option( 'loginpress_setting' );
1693 $lostpassword_url = isset( $loginpress_setting['lostpassword_url'] ) ? $loginpress_setting['lostpassword_url'] : 'off';
1694
1695 add_filter( 'gettext', array( $this, 'change_lostpassword_message' ), 20, 3 );
1696 add_filter( 'gettext', array( $this, 'change_username_label' ), 20, 3 );
1697 // add_filter( 'gettext', array( $this, 'change_password_label' ), 20, 3 );
1698 // Include CSS File in heared.
1699 if ( isset( $this->loginpress_key['loginpress_custom_js'] ) && ! empty( $this->loginpress_key['loginpress_custom_js'] ) ) { // 1.2.2
1700 wp_enqueue_script( 'jquery' );
1701 }
1702
1703 /**
1704 * Add functionality of disabling the templates of LoginPress.
1705 *
1706 * @since 1.6.4
1707 */
1708 $disable_default_style = (bool) apply_filters( 'loginpress_disable_default_style', false );
1709
1710 if ( ! $disable_default_style || 'default1' !== $this->loginpress_preset ) {
1711 include( LOGINPRESS_DIR_PATH . 'css/style-presets.php' );
1712 include( LOGINPRESS_DIR_PATH . 'css/style-login.php' );
1713 }
1714 do_action( 'loginpress_header_menu' );
1715 // do_action( 'loginpress_header_wrapper' );
1716
1717 if ( 'on' == $lostpassword_url ) {
1718 remove_filter( 'lostpassword_url', 'wc_lostpassword_url', 10 );
1719 }
1720
1721 /**
1722 * Filter for changing the lost password URL of lifter LMS plugin to default Lost Password URL of WordPress
1723 * By using this filter, you can prevent the redirection of lost password to Lifter LMS's lost password page over lost password link.
1724 *
1725 * @param bool
1726 *
1727 * @since 1.5.3
1728 */
1729 if( apply_filters( 'loginpress_llms_lostpassword_url', false ) ) {
1730 remove_filter( 'lostpassword_url', 'llms_lostpassword_url', 10 );
1731 }
1732 }
1733
1734 /**
1735 * Filters the Languages select input activation on the login screen.
1736 *
1737 * @param bool $arg Whether to display the Languages select input on the login screen.
1738 *
1739 * @since 1.5.11
1740 * @return bool
1741 */
1742 function loginpress_language_switch( $arg ) {
1743
1744 $loginpress_setting = get_option( 'loginpress_setting' );
1745 $language_switcher = isset( $loginpress_setting['enable_language_switcher'] ) ? $loginpress_setting['enable_language_switcher'] : 'off';
1746
1747 if ( 'off' === $language_switcher ) {
1748 return true;
1749 } else {
1750 return false;
1751 }
1752 }
1753 /**
1754 * Set Redirect Path of Logo
1755 *
1756 * @since 1.0.0
1757 * @version 1.5.3
1758 *
1759 * @return mixed
1760 * * * * * * * * * * * * * */
1761 public function login_page_logo_url() {
1762
1763 if ( $this->loginpress_key && array_key_exists( 'customize_logo_hover', $this->loginpress_key ) && ! empty( $this->loginpress_key['customize_logo_hover'] ) ) {
1764 return __( $this->loginpress_key["customize_logo_hover"], 'loginpress' );
1765 } else {
1766 return home_url();
1767 }
1768 }
1769
1770 /**
1771 * Remove the filter login_errors from woocommerce login form.
1772 *
1773 * @since 1.0.16
1774 *
1775 * @return errors
1776 * * * * * * * * * * * * */
1777 function loginpress_woo_login_errors( $validation_error, $arg1, $arg2 ) {
1778
1779 remove_filter( 'login_errors', array( $this, 'login_error_messages' ) );
1780 return $validation_error;
1781 }
1782
1783
1784 /**
1785 * Set hover Title of Logo
1786 *
1787 * @since 1.0.0
1788 * @version 1.5.3
1789 *
1790 * @return mixed
1791 * * * * * * * * * * * * */
1792 public function login_page_logo_title() {
1793
1794 if ( $this->loginpress_key && array_key_exists( 'customize_logo_hover_title', $this->loginpress_key ) && ! empty( $this->loginpress_key['customize_logo_hover_title'] ) ) {
1795 return __( $this->loginpress_key["customize_logo_hover_title"], 'loginpress' );
1796 } else {
1797 return home_url();
1798 }
1799 }
1800
1801 /**
1802 * Set Errors Messages to Show off
1803 *
1804 * @param $error
1805 * @since 1.0.0
1806 * @version 1.2.5
1807
1808 * @return string
1809 * * * * * * * * * * * * * * * * */
1810 public function login_error_messages($error) {
1811
1812 global $errors;
1813
1814 if ( isset( $errors ) && apply_filters( 'loginpress_display_custom_errors', true ) ) {
1815
1816 $error_codes = $errors->get_error_codes();
1817
1818 if ( $this->loginpress_key ) {
1819
1820 $invalid_usrname = array_key_exists( 'incorrect_username', $this->loginpress_key ) && ! empty( $this->loginpress_key['incorrect_username'] ) ? $this->loginpress_key['incorrect_username'] : sprintf( __( '%1$sError:%2$s Invalid Username.', 'loginpress' ), '<strong>', '</strong>' );
1821
1822 $invalid_pasword = array_key_exists( 'incorrect_password', $this->loginpress_key ) && ! empty( $this->loginpress_key['incorrect_password'] ) ? $this->loginpress_key['incorrect_password'] : sprintf( __( '%1$sError:%2$s Invalid Password.', 'loginpress' ), '<strong>', '</strong>' );
1823
1824 $empty_username = array_key_exists( 'empty_username', $this->loginpress_key ) && ! empty( $this->loginpress_key['empty_username'] ) ? $this->loginpress_key['empty_username'] : sprintf( __( '%1$sError:%2$s The username field is empty.', 'loginpress' ), '<strong>', '</strong>' );
1825
1826 $empty_password = array_key_exists( 'empty_password', $this->loginpress_key ) && ! empty( $this->loginpress_key['empty_password'] ) ? $this->loginpress_key['empty_password'] : sprintf( __( '%1$sError:%2$s The password field is empty.', 'loginpress' ), '<strong>', '</strong>' );
1827
1828 $invalid_email = array_key_exists( 'invalid_email', $this->loginpress_key ) && ! empty( $this->loginpress_key['invalid_email'] ) ? $this->loginpress_key['invalid_email'] : sprintf( __( '%1$sError:%2$s The email address isn\'t correct..', 'loginpress' ), '<strong>', '</strong>' );
1829
1830 $empty_email = array_key_exists( 'empty_email', $this->loginpress_key ) && ! empty( $this->loginpress_key['empty_email'] ) ? $this->loginpress_key['empty_email'] : sprintf( __( '%1$sError:%2$s Please type your email address.', 'loginpress' ), '<strong>', '</strong>' );
1831
1832 $username_exists = array_key_exists( 'username_exists', $this->loginpress_key ) && ! empty( $this->loginpress_key['username_exists'] ) ? $this->loginpress_key['username_exists'] : sprintf( __( '%1$sError:%2$s This username is already registered. Please choose another one.', 'loginpress' ), '<strong>', '</strong>' );
1833
1834 $email_exists = array_key_exists( 'email_exists', $this->loginpress_key ) && ! empty( $this->loginpress_key['email_exists'] ) ? $this->loginpress_key['email_exists'] : sprintf( __( '%1$sError:%2$s This email is already registered, please choose another one.', 'loginpress' ), '<strong>', '</strong>' );
1835
1836 $invalidcombo = array_key_exists( 'invalidcombo_message', $this->loginpress_key ) && ! empty( $this->loginpress_key['invalidcombo_message'] ) ? $this->loginpress_key['invalidcombo_message'] : sprintf( __( '%1$sError:%2$s Invalid username or email.', 'loginpress' ), '<strong>', '</strong>' );
1837
1838 if ( in_array( 'invalid_username', $error_codes ) ) return $invalid_usrname;
1839
1840 if ( in_array( 'incorrect_password', $error_codes ) ) return $invalid_pasword;
1841
1842 if ( in_array( 'empty_username', $error_codes ) ) return $empty_username;
1843
1844 if ( in_array( 'empty_password', $error_codes ) ) return $empty_password;
1845
1846 // registeration Form enteries.
1847 if ( in_array( 'invalid_email', $error_codes ) ) return $invalid_email;
1848
1849 if ( in_array( 'empty_email', $error_codes ) ) return "</br>" . $empty_email;
1850
1851 if ( in_array( 'username_exists', $error_codes ) ) return $username_exists;
1852
1853 if ( in_array( 'email_exists', $error_codes ) ) return $email_exists;
1854
1855 // forget password entery.
1856 if ( in_array( 'invalidcombo', $error_codes ) ) return $invalidcombo;
1857 }
1858 }
1859
1860 return $error;
1861 }
1862
1863 /**
1864 * Change Lost Password Text from Form
1865 *
1866 * @param $text
1867 * @since 1.0.0
1868 * @version 1.0.21
1869
1870 * @return mixed
1871 * * * * * * * * * * * * * * * * * * */
1872 public function change_lostpassword_message( $translated_text, $text, $domain ) {
1873
1874 if ( is_array( $this->loginpress_key ) && array_key_exists( 'login_footer_text', $this->loginpress_key ) && $text == 'Lost your password?' && 'default' == $domain && trim( $this->loginpress_key['login_footer_text'] ) ) {
1875
1876 return trim( __( $this->loginpress_key['login_footer_text'], 'logipress' ) );
1877 }
1878
1879 return $translated_text;
1880 }
1881 /**
1882 * Change Label of the Username from login Form.
1883 * @param [type] $translated_text [description]
1884 * @param [type] $text [description]
1885 * @param [type] $domain [description]
1886 * @since 1.1.3
1887 * @version 1.1.7
1888 *
1889 * @return string
1890 *
1891 */
1892 public function change_username_label( $translated_text, $text, $domain ){
1893
1894 $loginpress_setting = get_option( 'loginpress_setting' );
1895
1896 if ( $loginpress_setting ) {
1897
1898 $default = 'Username or Email Address';
1899 // $options = $this->loginpress_key;
1900 // $label = array_key_exists( 'form_username_label', $options ) ? $options['form_username_label'] : '';
1901 $login_order = isset( $loginpress_setting['login_order'] ) ? $loginpress_setting['login_order'] : '';
1902
1903 // If the option does not exist, return the text unchanged.
1904 if ( ! $loginpress_setting && $default === $text ) {
1905 return $translated_text;
1906 }
1907
1908 // If options exist, then translate away.
1909 if ( $loginpress_setting && $default === $text ) {
1910
1911 // Check if the option exists.
1912 if ( '' != $login_order && 'default' != $login_order ) {
1913 if ( 'username' == $login_order ) {
1914 $label = __( 'Username', 'loginpress' );
1915 } elseif ( 'email' == $login_order ) {
1916 $label = __( 'Email Address', 'loginpress' );
1917 } else {
1918 $label = __( 'Username or Email Address', 'loginpress' );
1919 }
1920 $translated_text = esc_html( $label );
1921 } else {
1922 return $translated_text;
1923 }
1924 }
1925 }
1926 return $translated_text;
1927 }
1928 /**
1929 * Change Password Label from Form.
1930 * @param [type] $translated_text [description]
1931 * @param [type] $text [description]
1932 * @param [type] $domain [description]
1933 * @since 1.1.3
1934 *
1935 * @return string
1936 *
1937 */
1938 public function change_password_label( $translated_text, $text, $domain ) {
1939
1940 if ( $this->loginpress_key ) {
1941 $default = 'Password';
1942 $options = $this->loginpress_key;
1943 $label = array_key_exists( 'form_password_label', $options ) ? $options['form_password_label'] : '';
1944
1945 // If the option does not exist, return the text unchanged.
1946 if ( ! $options && $default === $text ) {
1947 return $translated_text;
1948 }
1949
1950 // If options exsit, then translate away.
1951 if ( $options && $default === $text ) {
1952
1953 // Check if the option exists.
1954 if ( array_key_exists( 'form_password_label', $options ) ) {
1955 $translated_text = esc_html( $label );
1956 } else {
1957 return $translated_text;
1958 }
1959 }
1960 }
1961 return $translated_text;
1962 }
1963
1964 /**
1965 * Manage Welcome Messages
1966 *
1967 * @param $message
1968 * @since 1.0.0
1969 * @version 1.5.3
1970
1971 * @return string
1972 * * * * * * * * * * * * */
1973 public function change_welcome_message($message) {
1974
1975 if ( $this->loginpress_key ) {
1976
1977 //Check, User Logedout.
1978 if ( isset( $_GET['loggedout'] ) && TRUE == $_GET['loggedout'] ) {
1979
1980 if ( array_key_exists( 'logout_message', $this->loginpress_key ) && ! empty( $this->loginpress_key['logout_message'] ) ) {
1981
1982 $loginpress_message = __( $this->loginpress_key['logout_message'], 'loginpress' );
1983 }
1984 }
1985
1986 //Logged In messages.
1987 else if ( isset( $_GET['action'] ) && 'lostpassword' == $_GET['action'] ) {
1988
1989 if ( array_key_exists( 'lostpwd_welcome_message', $this->loginpress_key ) && ! empty( $this->loginpress_key['lostpwd_welcome_message'] ) ) {
1990
1991 $loginpress_message = __( $this->loginpress_key['lostpwd_welcome_message'], 'loginpress' );
1992 }
1993 }
1994
1995 else if( isset( $_GET['action'] ) && 'register' == $_GET['action'] ) {
1996
1997 if ( array_key_exists( 'register_welcome_message', $this->loginpress_key ) && ! empty( $this->loginpress_key['register_welcome_message'] ) ) {
1998
1999 $loginpress_message = __( $this->loginpress_key['register_welcome_message'], 'loginpress' );
2000 }
2001 }
2002
2003 // @since 1.0.18
2004 // else if ( strpos( $message, __( "Enter your new password below." ) ) == true ) {
2005 //
2006 // if ( array_key_exists( 'reset_hint_message', $this->loginpress_key ) && ! empty( $this->loginpress_key['reset_hint_message'] ) ) {
2007 //
2008 // $loginpress_message = $this->loginpress_key['reset_hint_message'];
2009 // }
2010 // }
2011
2012 // @since 1.0.18
2013 else if ( strpos( $message, __( "Your password has been reset." ) ) == true ) {
2014
2015 // if ( array_key_exists( 'after_reset_message', $this->loginpress_key ) && ! empty( $this->loginpress_key['after_reset_message'] ) ) {
2016
2017 $loginpress_message = __( 'Your password has been reset.' ) . ' <a href="' . esc_url( wp_login_url() ) . '">' . __( 'Log in' ) . '</a></p>';
2018 // }
2019 }
2020
2021 else {
2022 if ( array_key_exists( 'welcome_message', $this->loginpress_key ) && ! empty( $this->loginpress_key['welcome_message'] ) ) {
2023
2024 $loginpress_message = __( $this->loginpress_key['welcome_message'], 'loginpress' );
2025 }
2026 }
2027
2028 return ! empty( $loginpress_message ) ? "<p class='custom-message'>" . $loginpress_message. "</p>" : $message;
2029 }
2030 }
2031
2032 /**
2033 * Set WordPress login page title.
2034 *
2035 * @since 1.4.6
2036 * @version 1.5.3
2037
2038 * @return string
2039 * * * * * * * * * * * * * * * * */
2040 public function login_page_title( $title ) {
2041
2042 if ( $this->loginpress_key && array_key_exists( 'customize_login_page_title', $this->loginpress_key ) && ! empty( $this->loginpress_key['customize_login_page_title'] ) ) {
2043 return __( $this->loginpress_key["customize_login_page_title"], 'loginpress' );
2044 } else {
2045 return $title;
2046 }
2047 }
2048
2049 /**
2050 * Hook to Redirect Page for Customize
2051 *
2052 * @since 1.1.3
2053 * * * * * * * * * * * * * * * * * * */
2054 public function redirect_to_custom_page() {
2055 if ( ! empty($_GET['page'] ) ) {
2056
2057 if( ( $_GET['page'] == "abw" ) || ( $_GET['page'] == "loginpress" ) ) {
2058
2059 if ( is_multisite() ) { // if subdirectories are used in multisite.
2060
2061 $loginpress_obj = new LoginPress();
2062 $loginpress_page = $loginpress_obj->get_loginpress_page();
2063
2064 $page = get_permalink( $loginpress_page );
2065
2066 // Generate the redirect url.
2067 $url = add_query_arg(
2068 array(
2069 'autofocus[panel]' => 'loginpress_panel',
2070 'url' => rawurlencode( $page ),
2071 ),
2072 admin_url( 'customize.php' )
2073 );
2074
2075 wp_safe_redirect( $url );
2076
2077 } else {
2078
2079 wp_redirect( get_admin_url() . "customize.php?url=" . wp_login_url() . '&autofocus=loginpress_panel' );
2080 }
2081 }
2082 }
2083 }
2084
2085 /**
2086 * Redirect to the Admin Panel After Closing LoginPress Customizer
2087 *
2088 * @since 1.0.0
2089 * @return null
2090 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2091 public function menu_url() {
2092
2093 global $submenu;
2094
2095 $parent = 'index.php';
2096 $page = 'abw';
2097
2098 // Create specific url for login view
2099 $login_url = wp_login_url();
2100 $url = add_query_arg(
2101 array(
2102 'url' => urlencode( $login_url ),
2103 'return' => admin_url( 'themes.php' ),
2104 ),
2105 admin_url( 'customize.php' )
2106 );
2107
2108 // If is Not Design Menu, return
2109 if ( ! isset( $submenu[ $parent ] ) ) {
2110 return NULL;
2111 }
2112
2113 foreach ( $submenu[ $parent ] as $key => $value ) {
2114 // Set new URL for menu item
2115 if ( $page === $value[ 2 ] ) {
2116 $submenu[ $parent ][ $key ][ 2 ] = $url;
2117 break;
2118 }
2119 }
2120 }
2121
2122 /**
2123 * This function is removed the error messages in the customizer.
2124 * @param array $errors [description]
2125 * @param string $redirect_to [description]
2126 * @since 1.2.0
2127 */
2128 function remove_error_messages_in_wp_customizer( $errors, $redirect_to ) {
2129
2130 if ( is_customize_preview() && version_compare( $GLOBALS['wp_version'], '5.2', '>=' ) ) {
2131 return new WP_Error( '', '' );
2132 }
2133 return $errors;
2134 }
2135 }
2136
2137 ?>
2138