PluginProbe
LoginPress | wp-login Custom Login Page Customizer / 1.0.7
LoginPress | wp-login Custom Login Page Customizer v1.0.7
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.0.7, at custom.php

1,422 lines 47.1 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 */
11 public $loginpress_key;
12
13 /**
14 * Class constructor
15 */
16 public function __construct() {
17
18 $this->loginpress_key = get_option( 'loginpress_customization' );
19 $this->_hooks();
20 }
21
22
23 /**
24 * Hook into actions and filters
25 *
26 * @since 1.0.0
27 */
28 private function _hooks() {
29
30 add_filter( 'login_headerurl', array( $this, 'login_page_logo_url' ) );
31 add_filter( 'login_headertitle', array( $this, 'login_page_logo_title' ) );
32 add_filter( 'login_errors', array( $this, 'login_error_messages' ) );
33 add_filter( 'gettext', array( $this, 'change_lostpassword_message' ) );
34 add_filter( 'login_message', array( $this, 'change_welcome_message' ) );
35 add_action( 'customize_register', array( $this, 'customize_login_panel' ) );
36 add_action( 'login_footer', array( $this, 'login_page_custom_footer' ) );
37 add_action( 'login_head', array( $this, 'login_page_custom_head' ) );
38 add_action( 'init', array( $this, 'redirect_to_custom_page' ) );
39 add_action( 'admin_menu', array( $this, 'menu_url' ), 99 );
40
41 add_action( 'customize_controls_enqueue_scripts', array( $this, 'loginpress_customizer_js' ) );
42 // add_action( 'customize_preview_init', array( $this, 'loginpress_customizer_js' ) );
43
44
45 }
46
47 function loginpress_customizer_js() {
48 wp_enqueue_script('jquery');
49 wp_enqueue_script( 'loginpress-customize-control', plugins_url( 'js/customize-controls.js' , __FILE__ ), array( 'jquery', 'customize-preview' ), LOGINPRESS_VERSION, true );
50
51 $admin_url = array( 'template_url' => admin_url() );
52 wp_localize_script( 'loginpress-customize-control', 'admin_url', $admin_url );
53
54 $plugin_url = array( 'plugin_url' => plugins_url() );
55 wp_localize_script( 'loginpress-customize-control', 'plugin_url', $plugin_url );
56
57
58 $login_theme = array( get_option( 'customize_presets_settings', true ) );
59 wp_localize_script( 'loginpress-customize-control', 'login_theme', $login_theme );
60
61 }
62
63
64
65 /**
66 * Register plugin settings Panel in WP Customizer
67 *
68 * @param $wp_customize
69 * @since 1.0.0
70 */
71 public function customize_login_panel( $wp_customize ){
72
73 include LOGINPRESS_ROOT_PATH .'classes/control-presets' . EXE;
74
75 // =============================
76 // = Panel for the LoginPress =
77 // =============================
78 $wp_customize->add_panel( 'loginpress_panel', array(
79 'title' => __( 'LoginPress', 'loginpress' ),
80 'description' => __( 'Customize Your WordPress Login Page with LoginPress :)', 'loginpress' ),
81 'priority' => 30,
82 ) );
83
84
85 // Start of Presets.
86 // $wp_customize->add_section( 'customize_presets', array(
87 // 'title' => __( 'Themes', 'loginpress' ),
88 // 'description' => __( 'Choose Theme', 'loginpress' ),
89 // 'priority' => 1,
90 // 'panel' => 'loginpress_panel',
91 // ) );
92 //
93 // $wp_customize->add_setting( 'customize_presets_settings', array(
94 // 'default' => 'default1',
95 // 'type' => 'option',
96 // 'capability' => 'manage_options',
97 // ) );
98 //
99 // $loginpress_free_templates = array(
100 // 'default1' => array(
101 // 'img' => plugins_url( 'img/bg.jpg', __FILE__ ),
102 // 'thumbnail' => plugins_url( 'img/thumbnail/default-1.png', __FILE__ ),
103 // 'id' => 'default1',
104 // 'name' => 'Default 1'
105 // ),
106 // 'default2' => array(
107 // 'img' => plugins_url( 'img/bg2.jpg', __FILE__ ),
108 // 'thumbnail' => plugins_url( 'img/thumbnail/default-2.png', __FILE__ ),
109 // 'id' => 'default2',
110 // 'name' => 'Default 2'
111 // ),
112 // 'default3' => array(
113 // 'thumbnail' => plugins_url( 'img/thumbnail/default-3.png', __FILE__ ),
114 // 'id' => 'default3',
115 // 'name' => 'Default 3',
116 // 'pro' => 'yes'
117 // )
118 //
119 // );
120 // $loginpress_templates = apply_filters( 'loginpress_pro_add_template', $loginpress_free_templates );
121 //
122 // $wp_customize->add_control( new LoginPress_Presets( $wp_customize, 'customize_presets_settings',
123 // array(
124 // 'section' => 'customize_presets',
125 // // 'label' => __( 'Themes', 'loginpress' ),
126 // 'choices' => $loginpress_templates
127 // )
128 // )
129 // );
130 //End of Presets.
131
132
133 // =============================
134 // = Section for Login Logo =
135 // =============================
136 $wp_customize->add_section(
137 'customize_logo_section',
138 array(
139 'title' => __( 'Logo', 'loginpress' ),
140 'description' => __( 'Customize Your Logo Section', 'loginpress' ),
141 'priority' => 5,
142 'panel' => 'loginpress_panel',
143 ));
144
145 $wp_customize->add_setting(
146 'loginpress_customization[setting_logo]',
147 array(
148 'type' => 'option',
149 'capability' => 'manage_options',
150 'transport' => 'postMessage'
151 ));
152
153 $wp_customize->add_control(
154 new WP_Customize_Image_Control(
155 $wp_customize,
156 'setting_logo',
157 array(
158 'label' => __( 'Logo Image:', 'loginpress' ),
159 'section' => 'customize_logo_section',
160 'priority' => 5,
161 'settings' => 'loginpress_customization[setting_logo]'
162 )));
163
164 $logo_control = array( 'customize_logo_width', 'customize_logo_height', 'customize_logo_padding', 'customize_logo_hover', 'customize_logo_hover_title' );
165 $logo_default = array( '84px', '84px', '5px', '', '' );
166 $logo_label = array(
167 __( 'Logo Width:', 'loginpress' ),
168 __( 'Logo Height:', 'loginpress' ),
169 __( 'Padding Bottom:', 'loginpress' ),
170 __( 'Logo URL:', 'loginpress' ),
171 __( 'Logo Hover Title:', 'loginpress' )
172 );
173
174 $logo = 0;
175 while ( $logo < 5 ) :
176
177 $wp_customize->add_setting( "loginpress_customization[{$logo_control[$logo]}]", array(
178 'default' => $logo_default[$logo],
179 'type' => 'option',
180 'capability' => 'manage_options',
181 'transport' => 'postMessage'
182 ));
183
184 $wp_customize->add_control( $logo_control[$logo], array(
185 'label' => $logo_label[$logo],
186 'section' => 'customize_logo_section',
187 'priority' => 10,
188 'settings' => "loginpress_customization[{$logo_control[$logo]}]"
189 ));
190
191 $logo++;
192 endwhile;
193
194 // =============================
195 // = Section for Background =
196 // =============================
197 $wp_customize->add_section(
198 'section_background',
199 array(
200 'title' => __( 'Background', 'loginpress' ),
201 'description' => '',
202 'priority' => 10,
203 'panel' => 'loginpress_panel',
204 ));
205
206 $wp_customize->add_setting('loginpress_customization[loginpress_display_bg]', array(
207 'default' => true,
208 'type' => 'option',
209 'capability' => 'manage_options',
210 'transport' => 'postMessage'
211 ));
212
213 $wp_customize->add_control('loginpress_display_bg', array(
214 'settings' => 'loginpress_customization[loginpress_display_bg]',
215 'label' => __( 'Display Background Image?', 'loginpress'),
216 'section' => 'section_background',
217 'priority' => 5,
218 'type' => 'checkbox',
219 ));
220
221 $wp_customize->add_setting( 'loginpress_customization[setting_background_color]', array(
222 // 'default' => '#ddd5c3',
223 'type' => 'option',
224 'capability' => 'manage_options',
225 'transport' => 'postMessage'
226
227 ));
228
229 $wp_customize->add_control(
230 new WP_Customize_Color_Control(
231 $wp_customize,
232 'setting_background_color',
233 array(
234 'label' => __( 'Background Color:', 'loginpress' ),
235 'section' => 'section_background',
236 'priority' => 10,
237 'settings' => 'loginpress_customization[setting_background_color]'
238 )));
239
240 $wp_customize->add_setting(
241 'loginpress_customization[setting_background]',
242 array(
243 // 'default' => plugins_url( 'img/bg.jpg', __FILE__ ) ,
244 'type' => 'option',
245 'capability' => 'manage_options',
246 'transport' => 'postMessage'
247 ));
248
249 $wp_customize->add_control(
250 new WP_Customize_Image_Control(
251 $wp_customize,
252 'setting_background',
253 array(
254 'label' => __( 'Background Image:', 'loginpress' ),
255 'section' => 'section_background',
256 'priority' => 15,
257 'settings' => 'loginpress_customization[setting_background]',
258 )));
259
260
261 $wp_customize->add_setting( 'loginpress_customization[background_repeat_radio]', array(
262 'default' => 'no-repeat',
263 'type' => 'option',
264 'capability' => 'manage_options',
265 'transport' => 'postMessage'
266 ));
267
268 $wp_customize->add_control( 'background_repeat_radio', array(
269 'label' => __( 'Background Repeat:', 'loginpress' ),
270 'section' => 'section_background',
271 'priority' => 20,
272 'settings' => 'loginpress_customization[background_repeat_radio]',
273 'type' => 'radio',
274 'choices' => array(
275 'repeat' => 'repeat',
276 'repeat-x' => 'repeat-x',
277 'repeat-y' => 'repeat-y',
278 'no-repeat' => 'no-repeat',
279 'initial' => 'initial',
280 'inherit' => 'inherit',
281 ),
282 ));
283
284 $wp_customize->add_setting( 'loginpress_customization[background_position]', array(
285 'default' => 'center',
286 'type' => 'option',
287 'capability' => 'manage_options',
288 'transport' => 'postMessage'
289
290 ));
291 $wp_customize->add_control( 'background_position', array(
292 'settings' => 'loginpress_customization[background_position]',
293 'label' => __( 'Select Position:', 'loginpress' ),
294 'section' => 'section_background',
295 'priority' => 25,
296 'type' => 'select',
297 'choices' => array(
298 'left top' => 'left top',
299 'left center' => 'left center',
300 'left bottom' => 'left bottom',
301 'right top' => 'right top',
302 'right center' => 'right center',
303 'right bottom' => 'right bottom',
304 'center top' => 'center top',
305 'center' => 'center',
306 'center bottom' => 'center bottom',
307 ),
308 ));
309
310 $wp_customize->add_setting( 'loginpress_customization[background_image_size]', array(
311 'default' => 'cover',
312 'type' => 'option',
313 'capability' => 'manage_options',
314 'transport' => 'postMessage'
315 ));
316
317 $wp_customize->add_control( 'background_image_size', array(
318 'label' => __( 'Background Image Size: ', 'loginpress' ),
319 'section' => 'section_background',
320 'priority' => 30,
321 'settings' => 'loginpress_customization[background_image_size]',
322 'type' => 'select',
323 'choices' => array(
324 'auto' => 'auto',
325 'cover' => 'cover',
326 'contain' => 'contain',
327 'initial' => 'initial',
328 'inherit' => 'inherit',
329 ),
330 ));
331
332 // =============================
333 // = Section for Form Beauty =
334 // =============================
335 $wp_customize->add_section(
336 'section_form',
337 array(
338 'title' => __( 'Customize Login Form', 'loginpress' ),
339 'description' => '',
340 'priority' => 15,
341 'panel' => 'loginpress_panel',
342 ));
343
344 $wp_customize->add_setting( 'loginpress_customization[setting_form_background]', array(
345 'type' => 'option',
346 'capability' => 'manage_options',
347 'transport' => 'postMessage'
348 ));
349
350 $wp_customize->add_control(
351 new WP_Customize_Image_Control(
352 $wp_customize,
353 'setting_form_background',
354 array(
355 'label' => __( 'Form Background Image', 'loginpress' ),
356 'section' => 'section_form',
357 'priority' => 5,
358 'settings' => 'loginpress_customization[setting_form_background]'
359 )));
360
361 $form_control = array( 'customize_form_width', 'customize_form_height', 'customize_form_padding', 'customize_form_border', 'textfield_width', 'textfield_margin' );
362 $form_default = array( '350px', '200px', '26px 24px 46px', '', '100%', '2px 6px 16px 0px' );
363 $form_label = array(
364 __( 'Form Width:', 'loginpress' ),
365 __( 'Form Minimum Height:', 'loginpress' ),
366 __( 'Form Padding:', 'loginpress' ),
367 __( 'Border (Example: 2px dotted black):', 'loginpress' ),
368 __( 'Input Text Field Width:', 'loginpress' ),
369 __( 'Input Text Field Margin:', 'loginpress' )
370 );
371
372 $form = 0;
373 while ( $form < 6 ) :
374
375 $wp_customize->add_setting( "loginpress_customization[{$form_control[$form]}]", array(
376 'default' => $form_default[$form],
377 'type' => 'option',
378 'capability' => 'manage_options',
379 'transport' => 'postMessage'
380 ));
381
382 $wp_customize->add_control( $form_control[$form], array(
383 'label' => $form_label[$form],
384 'section' => 'section_form',
385 // 'priority' => 15,
386 'settings' => "loginpress_customization[{$form_control[$form]}]"
387 ));
388
389 $form++;
390 endwhile;
391
392 $form_color_control = array( 'form_background_color', 'textfield_background_color', 'textfield_color', 'textfield_label_color' );
393 $form_color_default = array( '#FFF', '#FFF', '#333', '#777' );
394 $form_color_label = array(
395 __( 'Form Background Color:', 'loginpress' ),
396 __( 'Input Field Background Color:', 'loginpress' ),
397 __( 'Input Field Text Color:', 'loginpress' ),
398 __( 'Label Color:', 'loginpress' ),
399 );
400
401 $form_color = 0;
402 while ( $form_color < 4 ) :
403
404 $wp_customize->add_setting( "loginpress_customization[{$form_color_control[$form_color]}]", array(
405 // 'default' => $form_color_default[$form_color],
406 'type' => 'option',
407 'capability' => 'manage_options',
408 'transport' => 'postMessage'
409 ));
410
411 $wp_customize->add_control(
412 new WP_Customize_Color_Control(
413 $wp_customize,
414 $form_color_control[$form_color],
415 array(
416 'label' => $form_color_label[$form_color],
417 'section' => 'section_form',
418 // 'priority' => 50,
419 'settings' => "loginpress_customization[{$form_color_control[$form_color]}]"
420 ) ) );
421
422 $form_color++;
423 endwhile;
424
425 // =============================
426 // = Section for Forget Form =
427 // =============================
428 $wp_customize->add_section(
429 'section_forget_form',
430 array(
431 'title' => __( 'Customize Forget Form', 'loginpress' ),
432 'description' => '',
433 'priority' => 20,
434 'panel' => 'loginpress_panel',
435 ));
436
437 $wp_customize->add_setting( 'loginpress_customization[forget_form_background]', array(
438 'type' => 'option',
439 'capability' => 'manage_options',
440 'transport' => 'postMessage'
441 ));
442
443 $wp_customize->add_control(
444 new WP_Customize_Image_Control(
445 $wp_customize,
446 'forget_form_background',
447 array(
448 'label' => __( 'Forget Form Background Image', 'loginpress' ),
449 'section' => 'section_forget_form',
450 'priority' => 5,
451 'settings' => 'loginpress_customization[forget_form_background]'
452 )));
453
454 $wp_customize->add_setting( 'loginpress_customization[forget_form_background_color]', array(
455 // 'default' => '#FFF',
456 'type' => 'option',
457 'capability' => 'manage_options',
458 'transport' => 'postMessage'
459 ));
460
461 $wp_customize->add_control(
462 new WP_Customize_Color_Control(
463 $wp_customize,
464 'forget_form_background_color',
465 array(
466 'label' => __( 'Forget Form Background Color', 'loginpress' ),
467 'section' => 'section_forget_form',
468 'priority' => 10,
469 'settings' => 'loginpress_customization[forget_form_background_color]'
470 )));
471
472 // =============================
473 // = Section for Button Style =
474 // =============================
475 $wp_customize->add_section(
476 'section_button',
477 array(
478 'title' => __( 'Button Beauty', 'loginpress' ),
479 'description' => '',
480 'priority' => 25,
481 'panel' => 'loginpress_panel',
482 ));
483
484 $button_control = array( 'custom_button_color', 'button_border_color', 'button_hover_color', 'button_hover_border', 'custom_button_shadow', 'button_text_color' );
485 $button_default = array( '#2EA2CC', '#0074A2', '#1E8CBE', '#0074A2', '#78C8E6', '#FFF' );
486 $button_label = array(
487 __( 'Button Color:', 'loginpress' ),
488 __( 'Button Border Color:', 'loginpress' ),
489 __( 'Button Color (Hover):', 'loginpress' ),
490 __( 'Button Border (Hover):', 'loginpress' ),
491 __( 'Button Box Shadow:', 'loginpress' ),
492 __( 'Button Text Color:', 'loginpress' )
493 );
494
495 $button = 0;
496 while ( $button < 6 ) :
497
498 $wp_customize->add_setting( "loginpress_customization[{$button_control[$button]}]", array(
499 // 'default' => $button_default[$button],
500 'type' => 'option',
501 'capability' => 'manage_options',
502 'transport' => 'postMessage'
503 ));
504
505 $wp_customize->add_control(
506 new WP_Customize_Color_Control(
507 $wp_customize,
508 $button_control[$button],
509 array(
510 'label' => $button_label[$button],
511 'section' => 'section_button',
512 'priority' => 5,
513 'settings' => "loginpress_customization[{$button_control[$button]}]"
514 ) ) );
515
516 $button++;
517 endwhile;
518
519 // =============================
520 // = Section for Error message =
521 // =============================
522 $wp_customize->add_section(
523 'section_error',
524 array(
525 'title' => __( 'Error Messages', 'loginpress' ),
526 'description' => '',
527 'priority' => 30,
528 'panel' => 'loginpress_panel',
529 ));
530
531 $error_control = array( 'incorrect_username', 'incorrect_password', 'empty_username', 'empty_password', 'invalid_email', 'empty_email', 'invalidcombo_message' );
532 $error_default = array( 'Incorrect Username', 'Incorrect Password', 'Empty Username', 'Empty Password', 'The email address is incorrect.', 'The email address is empty.', 'Invalid Username or Email.' );
533 $error_label = array(
534 __( 'Incorrect Username Message:', 'loginpress' ),
535 __( 'Incorrect Password Message:', 'loginpress' ),
536 __( 'Empty Username Message:', 'loginpress' ),
537 __( 'Empty Password Message:', 'loginpress' ),
538 __( 'Invalid Email Message:', 'loginpress' ),
539 __( 'Empty Email Message:', 'loginpress' ),
540 __( 'Forget Password Message:', 'loginpress' ),
541 );
542
543 $error = 0;
544 while ( $error < 7 ) :
545
546 $wp_customize->add_setting( "loginpress_customization[{$error_control[$error]}]", array(
547 'default' => $error_default[$error],
548 'type' => 'option',
549 'capability' => 'manage_options',
550 'transport' => 'postMessage'
551 ));
552
553 $wp_customize->add_control( $error_control[$error], array(
554 'label' => $error_label[$error],
555 'section' => 'section_error',
556 'priority' => 5,
557 'settings' => "loginpress_customization[{$error_control[$error]}]",
558 ));
559
560 $error++;
561 endwhile;
562
563 // =============================
564 // = Section for Welcome message
565 // =============================
566 $wp_customize->add_section(
567 'section_welcome',
568 array(
569 'title' => __( 'Welcome Messages', 'loginpress' ),
570 'description' => '',
571 'priority' => 35,
572 'panel' => 'loginpress_panel',
573 ));
574
575 $welcome_control = array( 'lostpwd_welcome_message', 'welcome_message', 'register_welcome_message', 'logout_message', 'message_background_border' );
576 $welcome_default = array( 'Forget ?', 'Welcome', 'Register yourself', 'Logout', '' );
577 $welcome_label = array(
578 __( 'Welcome Message on Lost Password:', 'loginpress' ),
579 __( 'Welcome Message on Front Page:', 'loginpress' ),
580 __( 'Welcome Message on Registration:', 'loginpress' ),
581 __( 'Logout Message:', 'loginpress' ),
582 __( 'Message Field Border: ( Example: 1px solid #00a0d2; )', 'loginpress' ),
583 );
584
585 $welcome = 0;
586 while ( $welcome < 5 ) :
587
588 $wp_customize->add_setting( "loginpress_customization[{$welcome_control[ $welcome ]}]", array(
589 'default' => $welcome_default[ $welcome ],
590 'type' => 'option',
591 'capability' => 'manage_options',
592 'transport' => 'postMessage'
593 ));
594
595 $wp_customize->add_control( $welcome_control[ $welcome ], array(
596 'label' => $welcome_label[ $welcome ],
597 'section' => 'section_welcome',
598 'priority' => 5,
599 'settings' => "loginpress_customization[{$welcome_control[ $welcome ]}]",
600 ));
601
602 $welcome++;
603 endwhile;
604
605 $wp_customize->add_setting( 'loginpress_customization[message_background_color]', array(
606 // 'default' => '#fff',
607 'type' => 'option',
608 'capability' => 'manage_options',
609 'transport' => 'postMessage'
610 ));
611
612 $wp_customize->add_control(
613 new WP_Customize_Color_Control(
614 $wp_customize,
615 'message_background_color',
616 array(
617 'label' => __( 'Message Field Background Color:', 'loginpress' ),
618 'section' => 'section_welcome',
619 'priority' => 30,
620 'settings' => 'loginpress_customization[message_background_color]'
621 )));
622
623 // =============================
624 // = Section for Header message
625 // =============================
626 // $wp_customize->add_section(
627 // 'section_head',
628 // array(
629 // 'title' => __( 'Header Message', 'loginpress' ),
630 // 'description' => '',
631 // 'priority' => 35,
632 // 'panel' => 'loginpress_panel',
633 // ));
634 //
635 // $wp_customize->add_setting( 'loginpress_customization[login_hearder_message]', array(
636 // 'default' => 'Latest NEWS',
637 // 'type' => 'option',
638 // 'capability' => 'edit_theme_options',
639 // ));
640 //
641 // $wp_customize->add_control( 'login_hearder_message', array(
642 // 'label' => __( 'Header Message:', 'loginpress' ),
643 // 'section' => 'section_head',
644 // 'priority' => 5,
645 // 'settings' => 'loginpress_customization[login_hearder_message]',
646 // ));
647 //
648 // $wp_customize->add_setting( 'loginpress_customization[login_hearder_message_link]', array(
649 // 'default' => '#',
650 // 'type' => 'option',
651 // 'capability' => 'edit_theme_options',
652 // ));
653 //
654 // $wp_customize->add_control( 'login_hearder_message_link', array(
655 // 'label' => __( 'Header Message Link:', 'loginpress' ),
656 // 'section' => 'section_head',
657 // 'priority' => 5,
658 // 'settings' => 'loginpress_customization[login_hearder_message_link]',
659 // ));
660 //
661 // $wp_customize->add_setting( 'loginpress_customization[login_head_color]', array(
662 // 'default' => '#17a8e3',
663 // 'type' => 'option',
664 // 'capability' => 'edit_theme_options',
665 // ));
666 //
667 // $wp_customize->add_control(
668 // new WP_Customize_Color_Control(
669 // $wp_customize,
670 // 'login_head_color',
671 // array(
672 // 'label' => __( 'Header Text Color:', 'loginpress' ),
673 // 'section' => 'section_head',
674 // 'priority' => 10,
675 // 'settings' => 'loginpress_customization[login_head_color]'
676 // )));
677 //
678 // $wp_customize->add_setting( 'loginpress_customization[login_head_color_hover]', array(
679 // // 'default' => '#17a8e3',
680 // 'type' => 'option',
681 // 'capability' => 'edit_theme_options',
682 // ));
683 //
684 // $wp_customize->add_control(
685 // new WP_Customize_Color_Control(
686 // $wp_customize,
687 // 'login_head_color_hover',
688 // array(
689 // 'label' => __( 'Header Text Hover Color:', 'loginpress' ),
690 // 'section' => 'section_head',
691 // 'priority' => 15,
692 // 'settings' => 'loginpress_customization[login_head_color_hover]'
693 // )));
694 //
695 // $wp_customize->add_setting( 'loginpress_customization[login_head_font_size]', array(
696 // 'default' => '13px;',
697 // 'type' => 'option',
698 // 'capability' => 'edit_theme_options',
699 // ));
700 //
701 // $wp_customize->add_control( 'login_head_font_size', array(
702 // 'label' => __( 'Text Font Size:', 'loginpress' ),
703 // 'section' => 'section_head',
704 // 'priority' => 20,
705 // 'settings' => 'loginpress_customization[login_head_font_size]',
706 // ));
707 //
708 // $wp_customize->add_setting( 'loginpress_customization[login_head_bg_color]', array(
709 // // 'default' => '#17a8e3',
710 // 'type' => 'option',
711 // 'capability' => 'edit_theme_options',
712 // ));
713 //
714 // $wp_customize->add_control(
715 // new WP_Customize_Color_Control(
716 // $wp_customize,
717 // 'login_head_bg_color',
718 // array(
719 // 'label' => __( 'Header Background Color:', 'loginpress' ),
720 // 'section' => 'section_head',
721 // 'priority' => 25,
722 // 'settings' => 'loginpress_customization[login_head_bg_color]'
723 // )));
724
725 // =============================
726 // = Custom Header Login menu =
727 // =============================
728 // $menuVals = array();
729 // $menus = get_registered_nav_menus();
730 //
731 // foreach ( $menus as $location => $name ) {
732 // $menuVals[$location] = $name ;
733 // }
734 // $wp_customize->add_section(
735 // 'customize_menu_section',
736 // array(
737 // 'title' => __( 'Login Page Menus', 'loginpress' ),
738 // 'description' => '',
739 // 'priority' => 32,
740 // 'panel' => 'loginpress_panel',
741 // ));
742 //
743 // $wp_customize->add_setting('loginpress_customization[header_login_menu]', array(
744 // 'capability' => 'edit_theme_options',
745 // 'type' => 'option',
746 // ));
747 //
748 // $wp_customize->add_control('header_login_menu', array(
749 // 'settings' => 'loginpress_customization[header_login_menu]',
750 // 'label' => __( 'Display Header Menu?', 'loginpress'),
751 // 'section' => 'customize_menu_section',
752 // 'priority' => 5,
753 // 'type' => 'checkbox',
754 // ));
755 //
756 // $wp_customize->add_setting('loginpress_customization[customize_login_menu]', array(
757 // 'capability' => 'edit_theme_options',
758 // 'type' => 'option',
759 //
760 // ));
761 // $wp_customize->add_control( 'customize_login_menu', array(
762 // 'settings' => 'loginpress_customization[customize_login_menu]',
763 // 'label' => __( 'Select Menu for Header:', 'loginpress' ),
764 // 'section' => 'customize_menu_section',
765 // 'type' => 'select',
766 // 'priority' => 10,
767 // 'choices' => $menuVals,
768 // ));
769 //
770 // $wp_customize->add_setting('loginpress_customization[footer_login_menu]', array(
771 // 'capability' => 'edit_theme_options',
772 // 'type' => 'option',
773 // ));
774 //
775 // $wp_customize->add_control('footer_login_menu', array(
776 // 'settings' => 'loginpress_customization[footer_login_menu]',
777 // 'label' => __( 'Display Footer Menu?', 'loginpress' ),
778 // 'section' => 'customize_menu_section',
779 // 'priority' => 15,
780 // 'type' => 'checkbox',
781 // ));
782 //
783 // $wp_customize->add_setting('loginpress_customization[customize_login_footer_menu]', array(
784 // 'capability' => 'edit_theme_options',
785 // 'type' => 'option',
786 //
787 // ));
788 // $wp_customize->add_control( 'customize_login_footer_menu', array(
789 // 'settings' => 'loginpress_customization[customize_login_footer_menu]',
790 // 'label' => __( 'Select Menu:', 'loginpress' ),
791 // 'section' => 'customize_menu_section',
792 // 'priority' => 20,
793 // 'type' => 'select',
794 // 'choices' => $menuVals,
795 // ));
796
797 // =============================
798 // = Section for Form Footer =
799 // =============================
800 $wp_customize->add_section(
801 'section_fotter',
802 array(
803 'title' => __( 'Form Footer', 'loginpress' ),
804 'description' => '',
805 'priority' => 40,
806 'panel' => 'loginpress_panel',
807 ));
808
809 $wp_customize->add_setting( 'loginpress_customization[login_footer_text]', array(
810 'default' => 'Lost your password?',
811 'type' => 'option',
812 'capability' => 'manage_options',
813 'transport' => 'postMessage'
814 ));
815
816 $wp_customize->add_control( 'login_footer_text', array(
817 'label' => __( 'Lost Password Text', 'loginpress' ),
818 'section' => 'section_fotter',
819 'priority' => 5,
820 'settings' => 'loginpress_customization[login_footer_text]',
821 ));
822
823 $wp_customize->add_setting( 'loginpress_customization[footer_display_text]', array(
824 'default' => 'block',
825 'type' => 'option',
826 'capability' => 'manage_options',
827 'transport' => 'postMessage'
828 ));
829
830 $wp_customize->add_control( 'footer_display_text', array(
831 'label' => __( 'Footer Text Display:', 'loginpress' ),
832 'section' => 'section_fotter',
833 'priority' => 10,
834 'settings' => 'loginpress_customization[footer_display_text]',
835 'type' => 'radio',
836 'choices' => array(
837 'block' => 'show',
838 'none' => 'hide',
839 ),
840 ));
841
842 $wp_customize->add_setting( 'loginpress_customization[login_footer_text_decoration]', array(
843 'default' => 'none',
844 'type' => 'option',
845 'capability' => 'manage_options',
846 'transport' => 'postMessage'
847
848 ));
849 $wp_customize->add_control( 'login_footer_text_decoration', array(
850 'settings' => 'loginpress_customization[login_footer_text_decoration]',
851 'label' => 'Select Text Decoration:',
852 'section' => 'section_fotter',
853 'priority' => 15,
854 'type' => 'select',
855 'choices' => array(
856 'none' => 'none',
857 'overline' => 'overline',
858 'line-through' => 'line-through',
859 'underline' => 'underline',
860 ),
861 ));
862
863 $wp_customize->add_setting( 'loginpress_customization[login_footer_color]', array(
864 // 'default' => '#17a8e3',
865 'type' => 'option',
866 'capability' => 'manage_options',
867 'transport' => 'postMessage'
868 ));
869
870 $wp_customize->add_control(
871 new WP_Customize_Color_Control(
872 $wp_customize,
873 'login_footer_color',
874 array(
875 'label' => __( 'Footer Text Color:', 'loginpress' ),
876 'section' => 'section_fotter',
877 'priority' => 20,
878 'settings' => 'loginpress_customization[login_footer_color]'
879 )));
880
881 $wp_customize->add_setting( 'loginpress_customization[login_footer_color_hover]', array(
882 // 'default' => '#17a8e3',
883 'type' => 'option',
884 'capability' => 'manage_options',
885 'transport' => 'postMessage'
886 ));
887
888 $wp_customize->add_control(
889 new WP_Customize_Color_Control(
890 $wp_customize,
891 'login_footer_color_hover',
892 array(
893 'label' => __( 'Footer Text Hover Color:', 'loginpress' ),
894 'section' => 'section_fotter',
895 'priority' => 25,
896 'settings' => 'loginpress_customization[login_footer_color_hover]'
897 )));
898
899 $wp_customize->add_setting( 'loginpress_customization[login_footer_font_size]', array(
900 'default' => '13px',
901 'type' => 'option',
902 'capability' => 'manage_options',
903 'transport' => 'postMessage'
904 ));
905
906 $wp_customize->add_control( 'login_footer_font_size', array(
907 'label' => __( 'Text Font Size:', 'loginpress' ),
908 'section' => 'section_fotter',
909 'priority' => 30,
910 'settings' => 'loginpress_customization[login_footer_font_size]',
911 ));
912
913 $wp_customize->add_setting( 'loginpress_customization[login_footer_bg_color]', array(
914 // 'default' => '#17a8e3',
915 'type' => 'option',
916 'capability' => 'manage_options',
917 'transport' => 'postMessage'
918 ));
919
920 $wp_customize->add_control(
921 new WP_Customize_Color_Control(
922 $wp_customize,
923 'login_footer_bg_color',
924 array(
925 'label' => __( 'Footer Background Color:', 'loginpress' ),
926 'section' => 'section_fotter',
927 'priority' => 35,
928 'settings' => 'loginpress_customization[login_footer_bg_color]'
929 )));
930 // Fields for Back Link
931 // $wp_customize->add_setting( 'login_back_text', array(
932 // 'default' => 'Lost your password?',
933 // 'type' => 'option',
934 // 'capability' => 'edit_theme_options',
935 // ));
936
937 // $wp_customize->add_control( 'login_back_text', array(
938 // 'label' => __( 'Lost Password Text', 'loginpress' ),
939 // 'section' => 'section_fotter',
940 // 'priority' => 40,
941 // 'settings' => 'login_back_text',
942 // ));
943
944 $wp_customize->add_setting( 'loginpress_customization[back_display_text]', array(
945 'default' => 'block',
946 'type' => 'option',
947 'capability' => 'manage_options',
948 'transport' => 'postMessage'
949 ));
950
951 $wp_customize->add_control( 'back_display_text', array(
952 'label' => __( '"Back to" Text Display:', 'loginpress' ),
953 'section' => 'section_fotter',
954 'priority' => 45,
955 'settings' => 'loginpress_customization[back_display_text]',
956 'type' => 'radio',
957 'choices' => array(
958 'block' => 'show',
959 'none' => 'hide',
960 ),
961 ));
962
963 $wp_customize->add_setting( 'loginpress_customization[login_back_text_decoration]', array(
964 'default' => 'none',
965 'type' => 'option',
966 'capability' => 'manage_options',
967 'transport' => 'postMessage'
968
969 ));
970 $wp_customize->add_control( 'login_back_text_decoration', array(
971 'settings' => 'loginpress_customization[login_back_text_decoration]',
972 'label' => __( '"Back to" Text Decoration:', 'loginpress' ),
973 'section' => 'section_fotter',
974 'priority' => 50,
975 'type' => 'select',
976 'choices' => array(
977 'none' => 'none',
978 'overline' => 'overline',
979 'line-through' => 'line-through',
980 'underline' => 'underline',
981 ),
982 ));
983
984 $wp_customize->add_setting( 'loginpress_customization[login_back_color]', array(
985 // 'default' => '#17a8e3',
986 'type' => 'option',
987 'capability' => 'manage_options',
988 'transport' => 'postMessage'
989 ));
990
991 $wp_customize->add_control(
992 new WP_Customize_Color_Control(
993 $wp_customize,
994 'login_back_color',
995 array(
996 'label' => __( '"Back to" Text Color:', 'loginpress' ),
997 'section' => 'section_fotter',
998 'priority' => 55,
999 'settings' => 'loginpress_customization[login_back_color]'
1000 )));
1001
1002 $wp_customize->add_setting( 'loginpress_customization[login_back_color_hover]', array(
1003 // 'default' => '#17a8e3',
1004 'type' => 'option',
1005 'capability' => 'manage_options',
1006 'transport' => 'postMessage'
1007 ));
1008
1009 $wp_customize->add_control(
1010 new WP_Customize_Color_Control(
1011 $wp_customize,
1012 'login_back_color_hover',
1013 array(
1014 'label' => __( '"Back to" Text Hover Color:', 'loginpress' ),
1015 'section' => 'section_fotter',
1016 'priority' => 60,
1017 'settings' => 'loginpress_customization[login_back_color_hover]'
1018 )));
1019
1020 $wp_customize->add_setting( 'loginpress_customization[login_back_font_size]', array(
1021 'default' => '13px;',
1022 'type' => 'option',
1023 'capability' => 'manage_options',
1024 'transport' => 'postMessage'
1025 ));
1026
1027 $wp_customize->add_control( 'login_back_font_size', array(
1028 'label' => __( '"Back to" Text Font Size:', 'loginpress' ),
1029 'section' => 'section_fotter',
1030 'priority' => 65,
1031 'settings' => 'loginpress_customization[login_back_font_size]',
1032 ));
1033
1034 $wp_customize->add_setting( 'loginpress_customization[login_back_bg_color]', array(
1035 // 'default' => '#17a8e3',
1036 'type' => 'option',
1037 'capability' => 'manage_options',
1038 'transport' => 'postMessage'
1039 ));
1040
1041 $wp_customize->add_control(
1042 new WP_Customize_Color_Control(
1043 $wp_customize,
1044 'login_back_bg_color',
1045 array(
1046 'label' => __( 'Footer Background Color:', 'loginpress' ),
1047 'section' => 'section_fotter',
1048 'priority' => 70,
1049 'settings' => 'loginpress_customization[login_back_bg_color]'
1050 )));
1051
1052 $wp_customize->add_setting( 'loginpress_customization[login_footer_copy_right]', array(
1053 'default' => '© 2017 WPBrigade, All Rights Reserved.',
1054 'type' => 'option',
1055 'capability' => 'manage_options',
1056 'transport' => 'postMessage'
1057 ));
1058
1059 $wp_customize->add_control( 'login_footer_copy_right', array(
1060 'label' => __( 'Copyright Note:', 'loginpress' ),
1061 'type' => 'textarea',
1062 'section' => 'section_fotter',
1063 'priority' => 75,
1064 'settings' => 'loginpress_customization[login_footer_copy_right]'
1065 ));
1066
1067 // =============================
1068 // = Section for Custom CSS =
1069 // =============================
1070 $wp_customize->add_section(
1071 'section_css',
1072 array(
1073 'title' => __( 'Custom CSS', 'loginpress' ),
1074 'description' => '',
1075 'priority' => 50,
1076 'panel' => 'loginpress_panel',
1077 ));
1078
1079 $wp_customize->add_setting( 'loginpress_customization[loginpress_custom_css]', array(
1080 'type' => 'option',
1081 'capability' => 'manage_options',
1082 'transport' => 'postMessage'
1083 ));
1084
1085 $wp_customize->add_control( 'loginpress_custom_css', array(
1086 'label' => __( 'Customize CSS', 'loginpress' ),
1087 'type' => 'textarea',
1088 'section' => 'section_css',
1089 'priority' => 5,
1090 'settings' => 'loginpress_customization[loginpress_custom_css]'
1091 ));
1092
1093 // =============================
1094 // = Section for Custom JS =
1095 // =============================
1096 $wp_customize->add_section(
1097 'section_js',
1098 array(
1099 'title' => __( 'Custom JS', 'loginpress' ),
1100 'description' => '',
1101 'priority' => 55,
1102 'panel' => 'loginpress_panel',
1103 ));
1104
1105 $wp_customize->add_setting( 'loginpress_customization[loginpress_custom_js]', array(
1106 'type' => 'option',
1107 'capability' => 'manage_options',
1108 'transport' => 'postMessage'
1109 ));
1110
1111 $wp_customize->add_control( 'loginpress_custom_js', array(
1112 'label' => __( 'Customize JS', 'loginpress' ),
1113 'type' => 'textarea',
1114 'section' => 'section_js',
1115 'priority' => 5,
1116 'settings' => 'loginpress_customization[loginpress_custom_js]'
1117 ));
1118
1119
1120 // Resets Panel
1121 // $wp_customize->add_section( 'reset_loginpress', array(
1122 // 'title' => __( 'Reset All Settings', 'loginpress' ),
1123 // 'description' => '',
1124 // 'priority' => 60,
1125 // 'panel' => 'loginpress_panel',
1126 // ) );
1127 //
1128 // $wp_customize->add_setting( 'reset_loginpress', array(
1129 // 'type' => 'option',
1130 // 'capability' => 'manage_options',
1131 // ) );
1132 //
1133 // $wp_customize->add_control( 'reset_loginpress', array(
1134 // 'label' => __( 'Reset All Settings', 'loginpress' ),
1135 // 'type' => 'checkbox',
1136 // 'section' => 'reset_loginpress',
1137 // 'priority' => 5,
1138 // 'settings' => 'reset_loginpress'
1139 // ) );
1140 }
1141
1142 /**
1143 * Manage the Login Footer Links
1144 *
1145 * @since 1.0.0
1146 * * * * * * * * * * * * * * * */
1147 public function login_page_custom_footer() {
1148
1149 if ( $this->loginpress_key ) {
1150
1151 // echo '</div></div>';
1152 echo '<div class="footer-wrapper">';
1153 echo '<div class="footer-cont">';
1154
1155 // if ( array_key_exists( 'footer_login_menu', $this->loginpress_key ) && checked( $this->loginpress_key['footer_login_menu'], true, false ) ) {
1156 //
1157 // wp_nav_menu( array(
1158 // 'theme_location' => $this->loginpress_key['customize_login_footer_menu'],
1159 // 'container' => false,
1160 // 'menu_class' => 'loginFooterMenu',
1161 // 'echo' => true,
1162 // )
1163 // );
1164 //
1165 // }
1166
1167 if ( array_key_exists( 'login_footer_copy_right', $this->loginpress_key ) && !empty( $this->loginpress_key['login_footer_copy_right'] ) ) {
1168
1169 echo '<div class="copyRight">'.$this->loginpress_key['login_footer_copy_right'].'</div>';
1170 }
1171
1172 echo '</div></div>';
1173 }
1174 }
1175
1176 /**
1177 * Manage the Login Head
1178 *
1179 * @since 1.0.0
1180 * * * * * * * * * * * */
1181 public function login_page_custom_head() {
1182
1183 // Include CSS File in heared.
1184
1185 include( LOGINPRESS_DIR_PATH . 'css/style-presets' . EXE );
1186 include( LOGINPRESS_DIR_PATH . 'css/style-login' . EXE );
1187
1188
1189 if ( $this->loginpress_key && array_key_exists( 'header_login_menu', $this->loginpress_key ) ) {
1190
1191 // echo '<div class="header-wrapper">';
1192 // echo '<div class="header-cell">';
1193 // if ( array_key_exists( 'header_login_menu', $this->loginpress_key ) && checked( $this->loginpress_key['header_login_menu'], true, false ) ) {
1194 //
1195 // wp_nav_menu( array(
1196 // 'theme_location' => $this->loginpress_key['customize_login_menu'],
1197 // 'container' => false,
1198 // 'menu_class' => 'loginHeaderMenu',
1199 // 'echo' => true,
1200 // )
1201 // );
1202 // }
1203 // echo '</div></div><div class="login-wrapper"><div class="login-cell">';
1204 }
1205 }
1206 /**
1207 * Set Redirect Path of Logo
1208 *
1209 * @since 1.0.0
1210 * @return mixed
1211 * * * * * * * * * * * * * */
1212 public function login_page_logo_url() {
1213
1214 if ( $this->loginpress_key && array_key_exists( 'customize_logo_hover', $this->loginpress_key ) ) {
1215 return $this->loginpress_key["customize_logo_hover"];
1216 } else {
1217 return home_url();
1218 }
1219 }
1220
1221 /**
1222 * Set hover Title of Logo
1223 *
1224 * @since 1.0.0
1225 * @return mixed
1226 * * * * * * * * * * * * */
1227 public function login_page_logo_title() {
1228 if ( $this->loginpress_key && array_key_exists( 'customize_logo_hover_title', $this->loginpress_key ) ) {
1229 return $this->loginpress_key["customize_logo_hover_title"];
1230 } else {
1231 return home_url();
1232 }
1233 }
1234
1235 /**
1236 * Set Errors Messages to Show off
1237 *
1238 * @param $error
1239 * @since 1.0.0
1240 * @return string
1241 * * * * * * * * * * * * * * * * */
1242 public function login_error_messages($error) {
1243
1244 global $errors;
1245 $error_codes = $errors->get_error_codes();
1246 if ( $this->loginpress_key ) {
1247
1248 $invalid_usrname = array_key_exists( 'incorrect_username', $this->loginpress_key ) ? $this->loginpress_key['incorrect_username']: esc_html__( 'Invalid Username', 'loginpress' );
1249
1250 $invalid_pasword = array_key_exists( 'incorrect_password', $this->loginpress_key ) ? $this->loginpress_key['incorrect_password']: esc_html__( 'Invalid Password', 'loginpress' );
1251
1252 $empty_username = array_key_exists( 'empty_username', $this->loginpress_key ) ? $this->loginpress_key['empty_username']: esc_html__( 'Empty Username', 'loginpress' );
1253
1254 $empty_password = array_key_exists( 'empty_password', $this->loginpress_key ) ? $this->loginpress_key['empty_password']: esc_html__( 'Empty Password', 'loginpress' );
1255
1256 $invalid_email = array_key_exists( 'invalid_email', $this->loginpress_key ) ? $this->loginpress_key['invalid_email']: esc_html__( 'The email address is incorrect.', 'loginpress' );
1257
1258 $empty_email = array_key_exists( 'empty_email', $this->loginpress_key ) ? $this->loginpress_key['empty_email']: esc_html__( 'The email address is empty.', 'loginpress' );
1259
1260 $invalidcombo = array_key_exists( 'invalidcombo_message', $this->loginpress_key ) ? $this->loginpress_key['invalidcombo_message']: esc_html__( 'Invalid Username or Email.', 'loginpress' );
1261
1262 if ( in_array( 'invalid_username', $error_codes ) ) {
1263 return $invalid_usrname;
1264 }
1265
1266 if ( in_array( 'incorrect_password', $error_codes ) ) {
1267 return $invalid_pasword;
1268 }
1269
1270 if ( in_array( 'empty_username', $error_codes ) ) {
1271 return $empty_username;
1272 }
1273
1274 if ( in_array( 'empty_password', $error_codes ) ) {
1275 return $empty_password;
1276 }
1277
1278 // registeration Form enteries
1279 if ( in_array( 'invalid_email', $error_codes ) ) {
1280 return $invalid_email;
1281 }
1282
1283 if ( in_array( 'empty_email', $error_codes ) ) {
1284 return "</br>" . $empty_email;
1285 }
1286
1287 //forget password entery
1288 if ( in_array( 'invalidcombo', $error_codes ) ) {
1289 return $invalidcombo;
1290 }
1291 }
1292
1293 return $error;
1294 }
1295
1296 /**
1297 * Change Lost Password Text from Form
1298 *
1299 * @param $text
1300 * @since 1.0.0
1301 * @return mixed
1302 * * * * * * * * * * * * * * * * * * */
1303 public function change_lostpassword_message ( $text ) {
1304 $savedText = '';
1305 if ( $this->loginpress_key && array_key_exists( 'login_footer_text', $this->loginpress_key ) ) {
1306
1307 $savedText = $this->loginpress_key['login_footer_text'];
1308 }
1309
1310 if ( $text == 'Lost your password?' || $text == $savedText ) {
1311
1312 if ( $this->loginpress_key && array_key_exists( 'login_footer_text', $this->loginpress_key ) ) {
1313
1314 $text = $savedText; //$this->loginpress_key['login_footer_text'];
1315 }
1316
1317 }
1318
1319 return $text;
1320
1321 }
1322
1323 /**
1324 * Manage Welcome Messages
1325 *
1326 * @param $message
1327 * @since 1.0.0
1328 * @return string
1329 * * * * * * * * * * * * */
1330 public function change_welcome_message ($message) {
1331 if ( $this->loginpress_key ) {
1332
1333 //Check, User Logedout.
1334 if ( isset($_GET['loggedout']) && TRUE == $_GET['loggedout'] ) {
1335
1336 if ( array_key_exists( 'logout_message', $this->loginpress_key ) ) {
1337
1338 $message = $this->loginpress_key['logout_message'];
1339 }
1340 }
1341
1342 //Logged In messages.
1343 else if ( strpos( $message,"Please enter your username or email address. You will receive a link to create a new password via email." ) == true ) {
1344
1345 if ( array_key_exists( 'lostpwd_welcome_message', $this->loginpress_key ) ) {
1346
1347 $message = $this->loginpress_key['lostpwd_welcome_message'];
1348 }
1349 }
1350
1351 else if( strpos( $message,"Register For This Site" ) == true ) {
1352
1353 if ( array_key_exists( 'register_welcome_message', $this->loginpress_key ) ) {
1354
1355 $message = $this->loginpress_key['register_welcome_message'];
1356 }
1357 }
1358
1359 else {
1360 if ( array_key_exists( 'welcome_message', $this->loginpress_key ) ) {
1361
1362 $message = $this->loginpress_key['welcome_message'];
1363 }
1364 }
1365
1366 return !empty($message) ? "<p class='custom-message'>" . $message. "</p>" : '';
1367 }
1368 }
1369
1370 /**
1371 * Hook to Redirect Page for Customize
1372 *
1373 * @since 1.0.0
1374 * * * * * * * * * * * * * * * * * * */
1375 public function redirect_to_custom_page() {
1376 if (!empty($_GET['page'])) {
1377 if(($_GET['page']== "abw")){
1378 wp_redirect(get_admin_url()."customize.php?url=".wp_login_url());
1379 }
1380 }
1381 }
1382
1383 /**
1384 * Redirect to the Admin Panel After Closing LoginPress Customizer
1385 *
1386 * @since 1.0.0
1387 * @return null
1388 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1389 public function menu_url() {
1390
1391 global $submenu;
1392
1393 $parent = 'index.php';
1394 $page = 'abw';
1395
1396 // Create specific url for login view
1397 $login_url = wp_login_url();
1398 $url = add_query_arg(
1399 array(
1400 'url' => urlencode( $login_url ),
1401 'return' => admin_url( 'themes.php' ),
1402 ),
1403 admin_url( 'customize.php' )
1404 );
1405
1406 // If is Not Design Menu, return
1407 if ( ! isset( $submenu[ $parent ] ) ) {
1408 return NULL;
1409 }
1410
1411 foreach ( $submenu[ $parent ] as $key => $value ) {
1412 // Set new URL for menu item
1413 if ( $page === $value[ 2 ] ) {
1414 $submenu[ $parent ][ $key ][ 2 ] = $url;
1415 break;
1416 }
1417 }
1418 }
1419 }
1420
1421 ?>
1422