Version Description
- Update immediately - compatible with 5.9
=
Download this release
Release Info
Developer | hiddenpearls |
Plugin | Custom Login Page Customizer |
Version | 2.1.7 |
Comparing to | |
See all releases |
Code changes from version 2.1.6 to 2.1.7
- login-customizer.php +1 -1
- readme.txt +8 -4
- src/Customizer/template-login-customizer.php +73 -1
- src/Essentials.php +1 -1
- src/Includes/Ajax.php +2 -2
- src/Includes/Help.php +26 -9
- src/Includes/Plugin_Meta.php +4 -2
- src/Plugin.php +29 -9
- src/Settings/Setup.php +80 -33
login-customizer.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: Custom Login Page Customizer
|
4 |
* Plugin URI: https://loginpress.pro/?utm_source=login-customizer-lite&utm_medium=plugin-url-link
|
5 |
* Description: Custom Login Customizer plugin allows you to easily customize your login page straight from your WordPress Customizer! Awesome, right?
|
6 |
-
* Version: 2.1.
|
7 |
* Requires at least: 5.0
|
8 |
* Requires PHP: 5.6
|
9 |
* Author: Hardeep Asrani
|
3 |
* Plugin Name: Custom Login Page Customizer
|
4 |
* Plugin URI: https://loginpress.pro/?utm_source=login-customizer-lite&utm_medium=plugin-url-link
|
5 |
* Description: Custom Login Customizer plugin allows you to easily customize your login page straight from your WordPress Customizer! Awesome, right?
|
6 |
+
* Version: 2.1.7
|
7 |
* Requires at least: 5.0
|
8 |
* Requires PHP: 5.6
|
9 |
* Author: Hardeep Asrani
|
readme.txt
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
=== Custom Login Page Customizer ===
|
2 |
Requires at least: 4.0
|
3 |
-
Tested up to: 5.
|
4 |
Contributors: hardeepasrani, hiddenpearls
|
5 |
Author URI: https://loginpress.pro/?utm_source=login-customizer-lite&utm_medium=author-url-link
|
6 |
Tags: login, customizer, logo, login logo, login customizer, login page,admin, branding, customization, custom login, error, login error, custom login pro
|
7 |
-
Stable tag: 2.1.
|
8 |
License: GPLv2 or later
|
9 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -46,11 +46,15 @@ Please visit <a target="_blank" rel="nofollow" href="https://loginpress.pro/?utm
|
|
46 |
|
47 |
== Upgrade Notice ==
|
48 |
|
49 |
-
= 2.1.
|
50 |
-
* Update immediately - compatible with 5.
|
51 |
|
52 |
== Changelog ==
|
53 |
|
|
|
|
|
|
|
|
|
54 |
= 2.1.6 - 2021-09-07 =
|
55 |
* Bugfix: Fiexed PHP error for default Logo Height.
|
56 |
* Bugfix: Login Customizer Page delation issue.
|
1 |
=== Custom Login Page Customizer ===
|
2 |
Requires at least: 4.0
|
3 |
+
Tested up to: 5.9
|
4 |
Contributors: hardeepasrani, hiddenpearls
|
5 |
Author URI: https://loginpress.pro/?utm_source=login-customizer-lite&utm_medium=author-url-link
|
6 |
Tags: login, customizer, logo, login logo, login customizer, login page,admin, branding, customization, custom login, error, login error, custom login pro
|
7 |
+
Stable tag: 2.1.7
|
8 |
License: GPLv2 or later
|
9 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
46 |
|
47 |
== Upgrade Notice ==
|
48 |
|
49 |
+
= 2.1.7 =
|
50 |
+
* Update immediately - compatible with 5.9
|
51 |
|
52 |
== Changelog ==
|
53 |
|
54 |
+
= 2.1.7 – 2022-02-18 =
|
55 |
+
* New Feature: Introducing Language Switcher (On / Off) setting.
|
56 |
+
* Compatibility: Compatible with WordPress 5.9.
|
57 |
+
|
58 |
= 2.1.6 - 2021-09-07 =
|
59 |
* Bugfix: Fiexed PHP error for default Logo Height.
|
60 |
* Bugfix: Login Customizer Page delation issue.
|
src/Customizer/template-login-customizer.php
CHANGED
@@ -117,9 +117,81 @@
|
|
117 |
</a>
|
118 |
</p>
|
119 |
<div class="privacy-policy-page-link">
|
120 |
-
<a class="privacy-policy-link" href="<?php get_privacy_policy_url()?>"
|
121 |
</div>
|
122 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
123 |
<?php
|
124 |
do_action( 'login_footer' );
|
125 |
$options = get_option( 'login_customizer_options' );
|
117 |
</a>
|
118 |
</p>
|
119 |
<div class="privacy-policy-page-link">
|
120 |
+
<a class="privacy-policy-link" href="<?php get_privacy_policy_url()?>"><?php _e( 'Privacy Policy', 'login-customizer' ); ?></a>
|
121 |
</div>
|
122 |
</div>
|
123 |
+
<?php
|
124 |
+
/**
|
125 |
+
* Filters the Languages select input activation on the login screen.
|
126 |
+
*
|
127 |
+
* @since 2.1.7
|
128 |
+
*/
|
129 |
+
if ( version_compare( $GLOBALS['wp_version'], '5.9', '>=' ) ) {
|
130 |
+
|
131 |
+
$interim_login = isset( $_REQUEST['interim-login'] );
|
132 |
+
|
133 |
+
if (
|
134 |
+
! $interim_login &&
|
135 |
+
/**
|
136 |
+
* Filters the Languages select input activation on the login screen.
|
137 |
+
*
|
138 |
+
* @since 2.1.7
|
139 |
+
*
|
140 |
+
* @param bool Whether to display the Languages select input on the login screen.
|
141 |
+
*/
|
142 |
+
apply_filters( 'login_display_language_dropdown', false )
|
143 |
+
) {
|
144 |
+
$languages = get_available_languages();
|
145 |
+
|
146 |
+
if ( ! empty( $languages ) ) {
|
147 |
+
?>
|
148 |
+
<div class="language-switcher">
|
149 |
+
<form id="language-switcher" action="" method="get">
|
150 |
+
|
151 |
+
<label for="language-switcher-locales">
|
152 |
+
<span class="dashicons dashicons-translation" aria-hidden="true"></span>
|
153 |
+
<span class="screen-reader-text"><?php _e( 'Language' ); ?></span>
|
154 |
+
</label>
|
155 |
+
|
156 |
+
<?php
|
157 |
+
$args = array(
|
158 |
+
'id' => 'language-switcher-locales',
|
159 |
+
'name' => 'wp_lang',
|
160 |
+
'selected' => determine_locale(),
|
161 |
+
'show_available_translations' => false,
|
162 |
+
'explicit_option_en_us' => true,
|
163 |
+
'languages' => $languages,
|
164 |
+
);
|
165 |
+
|
166 |
+
/**
|
167 |
+
* Filters default arguments for the Languages select input on the login screen.
|
168 |
+
*
|
169 |
+
* @since 5.9.0
|
170 |
+
*
|
171 |
+
* @param array $args Arguments for the Languages select input on the login screen.
|
172 |
+
*/
|
173 |
+
wp_dropdown_languages( apply_filters( 'login_language_dropdown_args', $args ) );
|
174 |
+
?>
|
175 |
+
|
176 |
+
<?php if ( $interim_login ) { ?>
|
177 |
+
<input type="hidden" name="interim-login" value="1" />
|
178 |
+
<?php } ?>
|
179 |
+
|
180 |
+
<?php if ( isset( $_GET['redirect_to'] ) && '' !== $_GET['redirect_to'] ) { ?>
|
181 |
+
<input type="hidden" name="redirect_to" value="<?php echo esc_url_raw( $_GET['redirect_to'] ); ?>" />
|
182 |
+
<?php } ?>
|
183 |
+
|
184 |
+
<?php if ( isset( $_GET['action'] ) && '' !== $_GET['action'] ) { ?>
|
185 |
+
<input type="hidden" name="action" value="<?php echo esc_attr( $_GET['action'] ); ?>" />
|
186 |
+
<?php } ?>
|
187 |
+
|
188 |
+
<input type="submit" class="button" value="<?php esc_attr_e( 'Change' ); ?>">
|
189 |
+
|
190 |
+
</form>
|
191 |
+
</div>
|
192 |
+
<?php } ?>
|
193 |
+
<?php } ?>
|
194 |
+
<?php } ?>
|
195 |
<?php
|
196 |
do_action( 'login_footer' );
|
197 |
$options = get_option( 'login_customizer_options' );
|
src/Essentials.php
CHANGED
@@ -45,7 +45,7 @@ class Essentials {
|
|
45 |
* @return void
|
46 |
*/
|
47 |
public function define_constants() {
|
48 |
-
|
49 |
$this->define( 'LOGINCUST_FREE_URL', plugin_dir_url( __FILE__ ) );
|
50 |
$this->define( 'LOGINCUST_DIR_PATH', plugin_dir_path( __FILE__ ) );
|
51 |
$this->define( 'LOGINCUST_FREE_VERSION', $this->version );
|
45 |
* @return void
|
46 |
*/
|
47 |
public function define_constants() {
|
48 |
+
|
49 |
$this->define( 'LOGINCUST_FREE_URL', plugin_dir_url( __FILE__ ) );
|
50 |
$this->define( 'LOGINCUST_DIR_PATH', plugin_dir_path( __FILE__ ) );
|
51 |
$this->define( 'LOGINCUST_FREE_VERSION', $this->version );
|
src/Includes/Ajax.php
CHANGED
@@ -8,7 +8,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
8 |
* Handling all the AJAX calls in Login Customizer.
|
9 |
*
|
10 |
* @since 2.2.0
|
11 |
-
* @version 2.
|
12 |
|
13 |
* @class Deactivate_Login_Customizer
|
14 |
*/
|
@@ -34,7 +34,7 @@ if ( ! class_exists( 'Deactivate_Login_Customizer' ) ) :
|
|
34 |
public static function init() {
|
35 |
|
36 |
$ajax_calls = array(
|
37 |
-
'deactivate' => false,
|
38 |
);
|
39 |
|
40 |
foreach ( $ajax_calls as $ajax_call => $no_priv ) {
|
8 |
* Handling all the AJAX calls in Login Customizer.
|
9 |
*
|
10 |
* @since 2.2.0
|
11 |
+
* @version 2.1.5
|
12 |
|
13 |
* @class Deactivate_Login_Customizer
|
14 |
*/
|
34 |
public static function init() {
|
35 |
|
36 |
$ajax_calls = array(
|
37 |
+
// 'deactivate' => false,
|
38 |
);
|
39 |
|
40 |
foreach ( $ajax_calls as $ajax_call => $no_priv ) {
|
src/Includes/Help.php
CHANGED
@@ -23,11 +23,14 @@ class Help {
|
|
23 |
global $wpdb;
|
24 |
new Essentials;
|
25 |
|
26 |
-
$settings
|
27 |
-
$login_customizer
|
28 |
-
$login_order
|
29 |
-
$
|
30 |
-
|
|
|
|
|
|
|
31 |
|
32 |
$html = '### Begin System Info ###' . "\n\n";
|
33 |
|
@@ -46,8 +49,19 @@ class Help {
|
|
46 |
$html .= "\n" . '-- Login Customizer Configuration --' . "\n\n";
|
47 |
$html .= 'Plugin Version: ' . LOGINCUST_FREE_VERSION . "\n";
|
48 |
$html .= 'Login Order: ' . ucfirst( $login_order ) . "\n";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49 |
|
50 |
-
|
|
|
51 |
$html .= "\n" . '-- Server Configuration --' . "\n\n";
|
52 |
$html .= 'Operating System: ' . php_uname( 's' ) . "\n";
|
53 |
$html .= 'PHP Version: ' . PHP_VERSION . "\n";
|
@@ -77,10 +91,13 @@ class Help {
|
|
77 |
$html .= "\n" . '-- WordPress Active Plugins --' . "\n\n";
|
78 |
$plugins = get_plugins();
|
79 |
$active_plugins = get_option( 'active_plugins', array() );
|
80 |
-
|
81 |
-
|
|
|
|
|
82 |
continue;
|
83 |
-
|
|
|
84 |
}
|
85 |
|
86 |
// WordPress inactive plugins
|
23 |
global $wpdb;
|
24 |
new Essentials;
|
25 |
|
26 |
+
$settings = get_option( 'logincust_setting' );
|
27 |
+
$login_customizer = get_option( 'login_customizer_options' );
|
28 |
+
$login_order = isset( $settings['login_order'] ) ? $settings['login_order'] : 'Default';
|
29 |
+
$auto_remember_me = isset( $settings['auto_remember_me'] ) ? $settings['auto_remember_me'] : 'off';
|
30 |
+
$auto_remember_me = ( 'off' === $auto_remember_me ) ? 'Disabled' : 'Enabled';
|
31 |
+
$customization = isset( $login_customizer ) ? print_r( $login_customizer, true ) : 'No customization yet';
|
32 |
+
$enable_switcher = isset( $settings['enable_language_switcher'] ) ? $settings['enable_language_switcher'] : 'off';
|
33 |
+
$enable_switcher = ( 'off' === $enable_switcher ) ? 'Disabled' : 'Enabled';
|
34 |
|
35 |
$html = '### Begin System Info ###' . "\n\n";
|
36 |
|
49 |
$html .= "\n" . '-- Login Customizer Configuration --' . "\n\n";
|
50 |
$html .= 'Plugin Version: ' . LOGINCUST_FREE_VERSION . "\n";
|
51 |
$html .= 'Login Order: ' . ucfirst( $login_order ) . "\n";
|
52 |
+
$html .= 'Auto Remember Me: ' . ucfirst( $auto_remember_me ) . "\n";
|
53 |
+
|
54 |
+
/**
|
55 |
+
* Add option to remove language switcher option
|
56 |
+
*
|
57 |
+
* @since 2.1.7
|
58 |
+
*/
|
59 |
+
if ( version_compare( $GLOBALS['wp_version'], '5.9', '>=' ) && ! empty( get_available_languages() ) ) {
|
60 |
+
|
61 |
+
$html .= 'Language Switcher: ' . ucfirst( $enable_switcher ) . "\n";
|
62 |
|
63 |
+
}
|
64 |
+
// Server Configuration.
|
65 |
$html .= "\n" . '-- Server Configuration --' . "\n\n";
|
66 |
$html .= 'Operating System: ' . php_uname( 's' ) . "\n";
|
67 |
$html .= 'PHP Version: ' . PHP_VERSION . "\n";
|
91 |
$html .= "\n" . '-- WordPress Active Plugins --' . "\n\n";
|
92 |
$plugins = get_plugins();
|
93 |
$active_plugins = get_option( 'active_plugins', array() );
|
94 |
+
|
95 |
+
|
96 |
+
foreach ( $plugins as $plugin_path => $plugin ) {
|
97 |
+
if ( ! in_array( $plugin_path, $active_plugins, true ) ) {
|
98 |
continue;
|
99 |
+
$html .= $plugin['Name'] . ': v(' . $plugin['Version'] . ")\n";
|
100 |
+
}
|
101 |
}
|
102 |
|
103 |
// WordPress inactive plugins
|
src/Includes/Plugin_Meta.php
CHANGED
@@ -18,6 +18,7 @@ use LoginCustomizer\Includes\Disband;
|
|
18 |
* Plugin Meta class.
|
19 |
*
|
20 |
* @since 2.2.0
|
|
|
21 |
* @access public
|
22 |
*/
|
23 |
class Plugin_Meta {
|
@@ -35,12 +36,13 @@ class Plugin_Meta {
|
|
35 |
/**
|
36 |
* Hook into actions and filters
|
37 |
* @since 2.2.0
|
|
|
38 |
*/
|
39 |
function hooks( ) {
|
40 |
|
41 |
-
include_once( LOGINCUST_DIR_PATH . 'Includes/Ajax.php' );
|
42 |
|
43 |
-
add_action( 'admin_footer', array( $this, 'disband_model' ) );
|
44 |
add_filter( 'plugin_row_meta', array( $this, '_row_meta'), 10, 2 );
|
45 |
add_action( 'plugin_action_links', array( $this, 'login_customizer_action_links' ), 10, 2 );
|
46 |
|
18 |
* Plugin Meta class.
|
19 |
*
|
20 |
* @since 2.2.0
|
21 |
+
* @version 2.1.5
|
22 |
* @access public
|
23 |
*/
|
24 |
class Plugin_Meta {
|
36 |
/**
|
37 |
* Hook into actions and filters
|
38 |
* @since 2.2.0
|
39 |
+
* @version 2.1.5
|
40 |
*/
|
41 |
function hooks( ) {
|
42 |
|
43 |
+
// include_once( LOGINCUST_DIR_PATH . 'Includes/Ajax.php' );
|
44 |
|
45 |
+
// add_action( 'admin_footer', array( $this, 'disband_model' ) );
|
46 |
add_filter( 'plugin_row_meta', array( $this, '_row_meta'), 10, 2 );
|
47 |
add_action( 'plugin_action_links', array( $this, 'login_customizer_action_links' ), 10, 2 );
|
48 |
|
src/Plugin.php
CHANGED
@@ -35,9 +35,8 @@ class Plugin {
|
|
35 |
* Instance of Essentials Class for Defining Variables
|
36 |
*/
|
37 |
add_action( 'init', function() {
|
38 |
-
new Essentials;
|
39 |
}, 1 );
|
40 |
-
|
41 |
|
42 |
// Customizer Settings Creation
|
43 |
$customizer_settings = new Create_Customizer;
|
@@ -52,25 +51,46 @@ class Plugin {
|
|
52 |
$plugin_meta = new Plugin_Meta;
|
53 |
$plugin_meta->hooks();
|
54 |
|
55 |
-
|
56 |
/**
|
57 |
* Settings
|
58 |
*/
|
59 |
new Notification();
|
60 |
-
$logincust_setting
|
61 |
-
$login_order
|
62 |
-
$enable_reg_pass_field
|
63 |
-
|
64 |
|
65 |
-
|
|
|
|
|
66 |
if ( 'off' != $enable_reg_pass_field && get_option( 'users_can_register' ) !== '0' ) {
|
67 |
new Custom_Register_Password;
|
68 |
}
|
69 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
70 |
//Login Order
|
71 |
if ( 'default' != $login_order ) {
|
72 |
new Login_Order();
|
73 |
}
|
74 |
-
|
75 |
}
|
76 |
}
|
35 |
* Instance of Essentials Class for Defining Variables
|
36 |
*/
|
37 |
add_action( 'init', function() {
|
38 |
+
new Essentials;
|
39 |
}, 1 );
|
|
|
40 |
|
41 |
// Customizer Settings Creation
|
42 |
$customizer_settings = new Create_Customizer;
|
51 |
$plugin_meta = new Plugin_Meta;
|
52 |
$plugin_meta->hooks();
|
53 |
|
|
|
54 |
/**
|
55 |
* Settings
|
56 |
*/
|
57 |
new Notification();
|
58 |
+
$logincust_setting = get_option( 'logincust_setting' );
|
59 |
+
$login_order = isset( $logincust_setting['login_order'] ) ? $logincust_setting['login_order'] : '';
|
60 |
+
$enable_reg_pass_field = isset( $logincust_setting['enable_reg_pass_field'] ) ? $logincust_setting['enable_reg_pass_field'] : 'off';
|
|
|
61 |
|
62 |
+
/**
|
63 |
+
* Custom Register Fields if option is enbled from Login Customizer and WordPress Settings.
|
64 |
+
*/
|
65 |
if ( 'off' != $enable_reg_pass_field && get_option( 'users_can_register' ) !== '0' ) {
|
66 |
new Custom_Register_Password;
|
67 |
}
|
68 |
|
69 |
+
/**
|
70 |
+
* Check if the language is downloaded and WordPress has 5.9 or higher version.
|
71 |
+
*
|
72 |
+
* @since 2.1.7
|
73 |
+
*/
|
74 |
+
if ( version_compare( $GLOBALS['wp_version'], '5.9', '>=' ) && ! empty( get_available_languages() ) ) {
|
75 |
+
$enable_lang_switcher = isset( $logincust_setting['enable_language_switcher'] ) ? $logincust_setting['enable_language_switcher'] : 'off';
|
76 |
+
|
77 |
+
/**
|
78 |
+
* Filters the Languages select input activation on the login screen.
|
79 |
+
*
|
80 |
+
* @since 2.1.7
|
81 |
+
* @param bool Whether to display the Languages select input on the login screen.
|
82 |
+
*/
|
83 |
+
if ( 'off' !== $enable_lang_switcher ) {
|
84 |
+
add_filter( 'login_display_language_dropdown', '__return_false' );
|
85 |
+
} else {
|
86 |
+
add_filter( 'login_display_language_dropdown', '__return_true' );
|
87 |
+
}
|
88 |
+
}
|
89 |
+
|
90 |
//Login Order
|
91 |
if ( 'default' != $login_order ) {
|
92 |
new Login_Order();
|
93 |
}
|
94 |
+
|
95 |
}
|
96 |
}
|
src/Settings/Setup.php
CHANGED
@@ -166,43 +166,46 @@ class Setup {
|
|
166 |
* [$free_fields array of free fields]
|
167 |
* @var array
|
168 |
*/
|
169 |
-
$
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
175 |
);
|
176 |
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
'desc' => __( 'Keep remember me option always checked on login page', 'login-customizer' ),
|
181 |
-
'type' => 'checkbox'
|
182 |
-
);
|
183 |
-
|
184 |
-
$login_order = array(
|
185 |
-
'name' => 'login_order',
|
186 |
-
'label' => __( 'Login Order', 'login-customizer' ),
|
187 |
-
'desc' => __( 'Enable users to login using their username or email address.', 'login-customizer' ),
|
188 |
-
'type' => 'radio',
|
189 |
-
'default' => 'default',
|
190 |
-
'options' => array(
|
191 |
-
'default' => __( 'Both Username Or Email Address', 'login-customizer' ),
|
192 |
-
'username' => __( 'Only Username', 'login-customizer' ),
|
193 |
-
'email' => __( 'Only Email Address', 'login-customizer' )
|
194 |
-
)
|
195 |
-
);
|
196 |
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
)
|
|
|
|
|
203 |
|
204 |
-
$free_fields = get_option( 'users_can_register' ) == '0' ? array( $remember_field, $login_order, $delete_all ) : array( $remember_field, $register_pass_field, $login_order, $delete_all );
|
205 |
-
|
206 |
$_settings_fields = apply_filters( 'login_customizer_pro_settings', $free_fields );
|
207 |
$settings_fields = array( 'logincust_setting' => $_settings_fields );
|
208 |
$tab = apply_filters( 'login_customizer_settings_fields', $settings_fields );
|
@@ -210,6 +213,50 @@ class Setup {
|
|
210 |
return $tab;
|
211 |
}
|
212 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
213 |
/**
|
214 |
* Create the plugin's settings page.
|
215 |
* @since 2.2.0
|
166 |
* [$free_fields array of free fields]
|
167 |
* @var array
|
168 |
*/
|
169 |
+
$free_fields = array(
|
170 |
+
array(
|
171 |
+
'name' => 'auto_remember_me',
|
172 |
+
'label' => __( 'Auto Remember Me', 'login-customizer' ),
|
173 |
+
'desc' => __( 'Keep remember me option always checked on login page', 'login-customizer' ),
|
174 |
+
'type' => 'checkbox',
|
175 |
+
),
|
176 |
+
array(
|
177 |
+
'name' => 'login_order',
|
178 |
+
'label' => __( 'Login Order', 'login-customizer' ),
|
179 |
+
'desc' => __( 'Enable users to login using their username or email address.', 'login-customizer' ),
|
180 |
+
'type' => 'radio',
|
181 |
+
'default' => 'default',
|
182 |
+
'options' => array(
|
183 |
+
'default' => __( 'Both Username Or Email Address', 'login-customizer' ),
|
184 |
+
'username' => __( 'Only Username', 'login-customizer' ),
|
185 |
+
'email' => __( 'Only Email Address', 'login-customizer' ),
|
186 |
+
),
|
187 |
+
),
|
188 |
+
array(
|
189 |
+
'name' => 'logincust_delete_all',
|
190 |
+
'label' => __( 'Delete All Settings', 'login-customizer' ),
|
191 |
+
'desc' => __( 'Enable this option to delete every settings of this plugin on uninstall', 'login-customizer' ),
|
192 |
+
'type' => 'checkbox',
|
193 |
+
),
|
194 |
);
|
195 |
|
196 |
+
if ( '0' !== get_option( 'users_can_register' ) ) {
|
197 |
+
$free_fields = $this->logincust_custom_register_field( $free_fields );
|
198 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
199 |
|
200 |
+
/**
|
201 |
+
* Add option to remove language switcher option
|
202 |
+
*
|
203 |
+
* @since 2.1.7
|
204 |
+
*/
|
205 |
+
if ( version_compare( $GLOBALS['wp_version'], '5.9', '>=' ) && ! empty( get_available_languages() ) ) {
|
206 |
+
$free_fields = $this->logincust_language_switcher( $free_fields );
|
207 |
+
}
|
208 |
|
|
|
|
|
209 |
$_settings_fields = apply_filters( 'login_customizer_pro_settings', $free_fields );
|
210 |
$settings_fields = array( 'logincust_setting' => $_settings_fields );
|
211 |
$tab = apply_filters( 'login_customizer_settings_fields', $settings_fields );
|
213 |
return $tab;
|
214 |
}
|
215 |
|
216 |
+
/**
|
217 |
+
* logincust_language_switcher [merge a language switcher in the settings element of array.]
|
218 |
+
*
|
219 |
+
* @param array $fields_list The free fields of Login customizer.
|
220 |
+
* @since 2.1.7
|
221 |
+
* @return array the total fields including the added field of language switcher
|
222 |
+
*/
|
223 |
+
public function logincust_language_switcher( $fields_list ) {
|
224 |
+
|
225 |
+
$array_elements = array_slice( $fields_list, 0, -1 ); //slice a last element of array.
|
226 |
+
$last_element = end( $fields_list ); // last element of array.
|
227 |
+
$switcher_option = array(
|
228 |
+
'name' => 'enable_language_switcher',
|
229 |
+
'label' => __( 'Language Switcher', 'login-customizer' ),
|
230 |
+
'desc' => __( 'Remove Language Switcher Dropdown On Login Page. ', 'login-customizer' ),
|
231 |
+
'type' => 'checkbox',
|
232 |
+
);
|
233 |
+
|
234 |
+
$lang_switch_element = array_merge( array( $switcher_option, $last_element ) );
|
235 |
+
return array_merge( $array_elements, $lang_switch_element );
|
236 |
+
}
|
237 |
+
|
238 |
+
/**
|
239 |
+
* logincust_custom_register_field [merge a custom password field in the settings element of array.]
|
240 |
+
*
|
241 |
+
* @param array $fields_list The free fields of Login customizer.
|
242 |
+
* @since 2.1.7
|
243 |
+
* @return array the total fields including the added field of custom password field
|
244 |
+
*/
|
245 |
+
public function logincust_custom_register_field( $fields_list ) {
|
246 |
+
|
247 |
+
$array_elements = array_slice( $fields_list, 0, -1 ); //slice a last element of array.
|
248 |
+
$last_element = end( $fields_list ); // last element of array.
|
249 |
+
$register_field_option = array(
|
250 |
+
'name' => 'enable_reg_pass_field',
|
251 |
+
'label' => __( 'Custom Password Fields', 'login-customizer' ),
|
252 |
+
'desc' => __( 'Enable custom password fields on registration form.', 'login-customizer' ),
|
253 |
+
'type' => 'checkbox',
|
254 |
+
);
|
255 |
+
$lang_switch_element = array_merge( array( $register_field_option, $last_element ) );
|
256 |
+
return array_merge( $array_elements, $lang_switch_element );
|
257 |
+
}
|
258 |
+
|
259 |
+
|
260 |
/**
|
261 |
* Create the plugin's settings page.
|
262 |
* @since 2.2.0
|