Version Description
- Fixed a major bug dealing with saving options that broke the plugin
- Fixed a CSS bug causing interference with other interfaces that use jQuery UI Tabs
Download this release
Release Info
Developer | jfarthing84 |
Plugin | Theme My Login |
Version | 4.1.1 |
Comparing to | |
See all releases |
Code changes from version 4.1 to 4.1.1
- classes/class.widget-new.php +1 -3
- classes/class.wp-login.php +3 -3
- css/theme-my-login.css +3 -6
- readme.txt +4 -0
- theme-my-login.php +63 -51
classes/class.widget-new.php
CHANGED
@@ -13,9 +13,7 @@ class ThemeMyLoginWidget extends WP_Widget {
|
|
13 |
|
14 |
$new_args['widget'] = array_merge($args, $instance);
|
15 |
|
16 |
-
|
17 |
-
echo $ThemeMyLogin->ThemeMyLoginShortcode($new_args);
|
18 |
-
}
|
19 |
}
|
20 |
|
21 |
function update($new_instance, $old_instance){
|
13 |
|
14 |
$new_args['widget'] = array_merge($args, $instance);
|
15 |
|
16 |
+
echo $ThemeMyLogin->ThemeMyLoginShortcode($new_args);
|
|
|
|
|
17 |
}
|
18 |
|
19 |
function update($new_instance, $old_instance){
|
classes/class.wp-login.php
CHANGED
@@ -216,13 +216,13 @@ if ( !class_exists('WPLogin') ) {
|
|
216 |
}
|
217 |
if (get_option('users_can_register')) {
|
218 |
if ( 'register' != $action ) {
|
219 |
-
$url = ($this->options['widget']['registration']) ? $this->GuessURL(array('instance' => $instance, 'action' => 'register')) : site_url('wp-login.php?
|
220 |
$url = apply_filters('login_footer_registration_link', $url);
|
221 |
echo '<li><a href="' . $url . '">' . $this->options['titles']['register'] . '</a></li>' . "\n";
|
222 |
}
|
223 |
}
|
224 |
if ( 'lostpassword' != $action ) {
|
225 |
-
$url = ($this->options['widget']['lostpassword']) ? $this->GuessURL(array('instance' => $instance, 'action' => 'lostpassword')) : site_url('wp-login.php?
|
226 |
$url = apply_filters('login_footer_forgotpassword_link', $url);
|
227 |
echo '<li><a href="' . $url . '">' . $this->options['titles']['lostpassword'] . '</a></li>' . "\n";
|
228 |
}
|
@@ -349,7 +349,7 @@ if ( !class_exists('WPLogin') ) {
|
|
349 |
function LogoutAction() {
|
350 |
global $wp_version;
|
351 |
|
352 |
-
if ($wp_version
|
353 |
check_admin_referer('log-out');
|
354 |
wp_logout();
|
355 |
|
216 |
}
|
217 |
if (get_option('users_can_register')) {
|
218 |
if ( 'register' != $action ) {
|
219 |
+
$url = ($this->options['widget']['registration']) ? $this->GuessURL(array('instance' => $instance, 'action' => 'register')) : site_url('wp-login.php?action=register', 'login');
|
220 |
$url = apply_filters('login_footer_registration_link', $url);
|
221 |
echo '<li><a href="' . $url . '">' . $this->options['titles']['register'] . '</a></li>' . "\n";
|
222 |
}
|
223 |
}
|
224 |
if ( 'lostpassword' != $action ) {
|
225 |
+
$url = ($this->options['widget']['lostpassword']) ? $this->GuessURL(array('instance' => $instance, 'action' => 'lostpassword')) : site_url('wp-login.php?action=lostpassword', 'login');
|
226 |
$url = apply_filters('login_footer_forgotpassword_link', $url);
|
227 |
echo '<li><a href="' . $url . '">' . $this->options['titles']['lostpassword'] . '</a></li>' . "\n";
|
228 |
}
|
349 |
function LogoutAction() {
|
350 |
global $wp_version;
|
351 |
|
352 |
+
if ( version_compare($wp_version, '2.7', '>=') )
|
353 |
check_admin_referer('log-out');
|
354 |
wp_logout();
|
355 |
|
css/theme-my-login.css
CHANGED
@@ -4,15 +4,12 @@
|
|
4 |
|
5 |
.login p.error {
|
6 |
padding: 5px;
|
7 |
-
border: 1px solid #
|
8 |
-
background-color: #
|
9 |
-
}
|
10 |
-
.login p.error a:link {
|
11 |
-
color: #333333;
|
12 |
}
|
13 |
|
14 |
.login p.message {
|
15 |
padding: 5px;
|
16 |
-
border: 1px solid #
|
17 |
background-color: #ffffe0;
|
18 |
}
|
4 |
|
5 |
.login p.error {
|
6 |
padding: 5px;
|
7 |
+
border: 1px solid #c00;
|
8 |
+
background-color: #ffebe8;
|
|
|
|
|
|
|
9 |
}
|
10 |
|
11 |
.login p.message {
|
12 |
padding: 5px;
|
13 |
+
border: 1px solid #e6db55;
|
14 |
background-color: #ffffe0;
|
15 |
}
|
readme.txt
CHANGED
@@ -37,6 +37,10 @@ None yet. Please visit http://www.jfarthing.com/forum for any support!
|
|
37 |
|
38 |
== Changelog ==
|
39 |
|
|
|
|
|
|
|
|
|
40 |
= 4.1 =
|
41 |
* Implemented custom user passwords
|
42 |
* Implemented custom e-mail from name & address
|
37 |
|
38 |
== Changelog ==
|
39 |
|
40 |
+
= 4.1.1 =
|
41 |
+
* Fixed a major bug dealing with saving options that broke the plugin
|
42 |
+
* Fixed a CSS bug causing interference with other interfaces that use jQuery UI Tabs
|
43 |
+
|
44 |
= 4.1 =
|
45 |
* Implemented custom user passwords
|
46 |
* Implemented custom e-mail from name & address
|
theme-my-login.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Theme My Login
|
4 |
Plugin URI: http://www.jfarthing.com/wordpress-plugins/theme-my-login-plugin
|
5 |
Description: Themes the WordPress login, registration and forgot password pages according to your theme.
|
6 |
-
Version: 4.1
|
7 |
Author: Jeff Farthing
|
8 |
Author URI: http://www.jfarthing.com
|
9 |
Text Domain: theme-my-login
|
@@ -21,7 +21,7 @@ if ($wp_version < '2.6') {
|
|
21 |
if (!class_exists('ThemeMyLogin')) {
|
22 |
class ThemeMyLogin extends WPPluginShell {
|
23 |
|
24 |
-
var $version = '4.1';
|
25 |
var $options = array();
|
26 |
var $permalink = '';
|
27 |
var $instances = 0;
|
@@ -35,6 +35,8 @@ if (!class_exists('ThemeMyLogin')) {
|
|
35 |
|
36 |
register_activation_hook ( __FILE__, array( &$this, 'Activate' ) );
|
37 |
register_deactivation_hook ( __FILE__, array( &$this, 'Deactivate' ) );
|
|
|
|
|
38 |
|
39 |
$this->AddAction('init');
|
40 |
$this->AddAction('admin_init');
|
@@ -58,38 +60,14 @@ if (!class_exists('ThemeMyLogin')) {
|
|
58 |
$this->AddShortcode('theme-my-login-page');
|
59 |
$this->AddShortcode('theme-my-login');
|
60 |
|
61 |
-
|
62 |
-
$this->AddStyle('theme-my-login', WP_PLUGIN_URL . '/theme-my-login/theme-my-login.css');
|
63 |
-
else
|
64 |
-
$this->AddStyle('theme-my-login', WP_PLUGIN_URL . '/theme-my-login/css/theme-my-login.css');
|
65 |
|
66 |
-
$this->
|
67 |
-
|
68 |
-
|
69 |
-
$this->
|
70 |
-
} else {
|
71 |
-
global $wp_scripts;
|
72 |
-
|
73 |
-
if ( empty($wp_scripts) )
|
74 |
-
$wp_scripts = new WP_Scripts();
|
75 |
-
|
76 |
-
$wp_scripts->dequeue('jquery');
|
77 |
-
$wp_scripts->dequeue('jquery-ui-core');
|
78 |
-
$wp_scripts->dequeue('jquery-ui-tabs');
|
79 |
-
$wp_scripts->remove('jquery');
|
80 |
-
$wp_scripts->remove('jquery-ui-core');
|
81 |
-
$wp_scripts->remove('jquery-ui-tabs');
|
82 |
-
$this->AddAdminScript('jquery', WP_PLUGIN_URL . '/theme-my-login/js/jquery/jquery.js', false, '1.7.2');
|
83 |
-
$this->AddAdminScript('jquery-ui-core', WP_PLUGIN_URL . '/theme-my-login/js/jquery/ui.core.js', array('jquery'), '1.7.2');
|
84 |
-
$this->AddAdminScript('jquery-ui-tabs', WP_PLUGIN_URL . '/theme-my-login/js/jquery/ui.tabs.js', array('jquery', 'jquery-ui-core'), '1.7.2');
|
85 |
}
|
86 |
|
87 |
-
$this->AddAdminScript('theme-my-login-admin', WP_PLUGIN_URL . '/theme-my-login/js/theme-my-login-admin.js.php');
|
88 |
-
|
89 |
-
$this->AddAdminPage('options', 'Theme My Login', 'Theme My Login', 8, '/theme-my-login/includes/admin-page.php');
|
90 |
-
|
91 |
-
$this->LoadOptions();
|
92 |
-
|
93 |
$this->SetMailFrom($this->options['general']['from_email'], $this->options['general']['from_name']);
|
94 |
|
95 |
$this->WPPluginShell();
|
@@ -113,14 +91,17 @@ if (!class_exists('ThemeMyLogin')) {
|
|
113 |
} else {
|
114 |
$page_id = $theme_my_login->ID;
|
115 |
$insert['ID'] = $page_id;
|
|
|
116 |
wp_update_post($insert);
|
117 |
}
|
118 |
|
119 |
$opts = get_option('theme_my_login');
|
120 |
if ( $opts ) {
|
121 |
-
if (
|
122 |
-
|
123 |
-
|
|
|
|
|
124 |
}
|
125 |
}
|
126 |
|
@@ -132,15 +113,14 @@ if (!class_exists('ThemeMyLogin')) {
|
|
132 |
function Deactivate() {
|
133 |
if ( $this->options['general']['uninstall'] ) {
|
134 |
delete_option('theme_my_login');
|
|
|
135 |
wp_delete_post($this->options['general']['page_id']);
|
136 |
}
|
137 |
}
|
138 |
|
139 |
function InitOptions($save = false) {
|
140 |
-
|
141 |
-
$login_page = get_page_by_title('login');
|
142 |
-
$this->options['general']['page_id'] = ( $login_page ) ? $login_page->ID : 0;
|
143 |
|
|
|
144 |
$this->options['general']['uninstall'] = 0;
|
145 |
$this->options['general']['defaults'] = 0;
|
146 |
$this->options['general']['show_page'] = 0;
|
@@ -209,26 +189,58 @@ if (!class_exists('ThemeMyLogin')) {
|
|
209 |
exit();
|
210 |
break;
|
211 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
212 |
}
|
213 |
|
214 |
function AdminInit() {
|
215 |
global $user_ID, $wp_version, $pagenow;
|
216 |
|
217 |
-
if (
|
218 |
-
|
219 |
-
if ( '
|
220 |
-
$this->
|
221 |
} else {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
222 |
$this->AddAdminStyle('jquery-colors-fresh', WP_PLUGIN_URL . '/theme-my-login/css/wp-colors-fresh/wp-colors-fresh.css');
|
|
|
|
|
223 |
}
|
224 |
-
} elseif ( version_compare($wp_version, '2.7', '>=') ) {
|
225 |
-
$this->AddAdminStyle('jquery-colors-fresh', WP_PLUGIN_URL . '/theme-my-login/css/wp-colors-fresh/wp-colors-fresh.css');
|
226 |
-
} elseif ( version_compare($wp_version, '2.5', '>=') ) {
|
227 |
-
$this->AddAdminStyle('jquery-colors-classic', WP_PLUGIN_URL . '/theme-my-login/css/wp-colors-classic/wp-colors-classic.css');
|
228 |
-
}
|
229 |
|
230 |
-
|
231 |
-
|
|
|
232 |
}
|
233 |
|
234 |
function PageEditNotice() {
|
@@ -439,9 +451,9 @@ if (!class_exists('ThemeMyLogin')) {
|
|
439 |
|
440 |
function ThemeMyLoginShortcode($args = array()) {
|
441 |
global $WPLogin;
|
442 |
-
|
443 |
$args = wp_parse_args($args);
|
444 |
-
|
445 |
$options = $this->options;
|
446 |
foreach ( $args as $key => $value ) {
|
447 |
if ( !is_array($value) ) {
|
@@ -456,7 +468,7 @@ if (!class_exists('ThemeMyLogin')) {
|
|
456 |
$options[$key][$k] = $v;
|
457 |
}
|
458 |
}
|
459 |
-
|
460 |
$instance = ( isset($options['widget']['instance']) ) ? $options['widget']['instance'] : $this->NewInstance();
|
461 |
|
462 |
return $WPLogin->Display($instance, $options);
|
3 |
Plugin Name: Theme My Login
|
4 |
Plugin URI: http://www.jfarthing.com/wordpress-plugins/theme-my-login-plugin
|
5 |
Description: Themes the WordPress login, registration and forgot password pages according to your theme.
|
6 |
+
Version: 4.1.1
|
7 |
Author: Jeff Farthing
|
8 |
Author URI: http://www.jfarthing.com
|
9 |
Text Domain: theme-my-login
|
21 |
if (!class_exists('ThemeMyLogin')) {
|
22 |
class ThemeMyLogin extends WPPluginShell {
|
23 |
|
24 |
+
var $version = '4.1.1';
|
25 |
var $options = array();
|
26 |
var $permalink = '';
|
27 |
var $instances = 0;
|
35 |
|
36 |
register_activation_hook ( __FILE__, array( &$this, 'Activate' ) );
|
37 |
register_deactivation_hook ( __FILE__, array( &$this, 'Deactivate' ) );
|
38 |
+
|
39 |
+
$this->AddAdminPage('options', __('Theme My Login', 'theme-my-login'), __('Theme My Login', 'theme-my-login'), 8, '/theme-my-login/includes/admin-page.php');
|
40 |
|
41 |
$this->AddAction('init');
|
42 |
$this->AddAction('admin_init');
|
60 |
$this->AddShortcode('theme-my-login-page');
|
61 |
$this->AddShortcode('theme-my-login');
|
62 |
|
63 |
+
$this->LoadOptions();
|
|
|
|
|
|
|
64 |
|
65 |
+
if ( !isset($this->options['page_id']) || empty($this->options['page_id']) ) {
|
66 |
+
$login_page = get_page_by_title('Login');
|
67 |
+
$this->options['general']['page_id'] = ( $login_page ) ? $login_page->ID : 0;
|
68 |
+
$this->SaveOptions();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
69 |
}
|
70 |
|
|
|
|
|
|
|
|
|
|
|
|
|
71 |
$this->SetMailFrom($this->options['general']['from_email'], $this->options['general']['from_name']);
|
72 |
|
73 |
$this->WPPluginShell();
|
91 |
} else {
|
92 |
$page_id = $theme_my_login->ID;
|
93 |
$insert['ID'] = $page_id;
|
94 |
+
$insert['post_content'] = str_replace('[theme-my-login]', '[theme-my-login-page]', $theme_my_login->post_content);
|
95 |
wp_update_post($insert);
|
96 |
}
|
97 |
|
98 |
$opts = get_option('theme_my_login');
|
99 |
if ( $opts ) {
|
100 |
+
if ( is_array($opts) ) {
|
101 |
+
if ( isset($opts['version']) && version_compare($opts['version'], '4.0', '<') ) {
|
102 |
+
delete_option('theme_my_login');
|
103 |
+
delete_option('widget_theme-my-login');
|
104 |
+
}
|
105 |
}
|
106 |
}
|
107 |
|
113 |
function Deactivate() {
|
114 |
if ( $this->options['general']['uninstall'] ) {
|
115 |
delete_option('theme_my_login');
|
116 |
+
delete_option('widget_theme-my-login');
|
117 |
wp_delete_post($this->options['general']['page_id']);
|
118 |
}
|
119 |
}
|
120 |
|
121 |
function InitOptions($save = false) {
|
|
|
|
|
|
|
122 |
|
123 |
+
$this->options['general']['page_id'] = 0;
|
124 |
$this->options['general']['uninstall'] = 0;
|
125 |
$this->options['general']['defaults'] = 0;
|
126 |
$this->options['general']['show_page'] = 0;
|
189 |
exit();
|
190 |
break;
|
191 |
}
|
192 |
+
|
193 |
+
if ( file_exists(WP_PLUGIN_DIR . '/theme-my-login/theme-my-login.css') )
|
194 |
+
$this->AddStyle('theme-my-login', WP_PLUGIN_URL . '/theme-my-login/theme-my-login.css');
|
195 |
+
else
|
196 |
+
$this->AddStyle('theme-my-login', WP_PLUGIN_URL . '/theme-my-login/css/theme-my-login.css');
|
197 |
+
|
198 |
}
|
199 |
|
200 |
function AdminInit() {
|
201 |
global $user_ID, $wp_version, $pagenow;
|
202 |
|
203 |
+
if ( 'options-general.php' == $pagenow && (isset($_GET['page']) && 'theme-my-login/includes/admin-page.php' == $_GET['page']) ) {
|
204 |
+
|
205 |
+
if ( version_compare($wp_version, '2.8', '>=') ) {
|
206 |
+
$this->AddAdminScript('jquery-ui-tabs');
|
207 |
} else {
|
208 |
+
global $wp_scripts;
|
209 |
+
|
210 |
+
if ( empty($wp_scripts) )
|
211 |
+
$wp_scripts = new WP_Scripts();
|
212 |
+
|
213 |
+
$wp_scripts->dequeue('jquery');
|
214 |
+
$wp_scripts->dequeue('jquery-ui-core');
|
215 |
+
$wp_scripts->dequeue('jquery-ui-tabs');
|
216 |
+
$wp_scripts->remove('jquery');
|
217 |
+
$wp_scripts->remove('jquery-ui-core');
|
218 |
+
$wp_scripts->remove('jquery-ui-tabs');
|
219 |
+
$this->AddAdminScript('jquery', WP_PLUGIN_URL . '/theme-my-login/js/jquery/jquery.js', false, '1.7.2');
|
220 |
+
$this->AddAdminScript('jquery-ui-core', WP_PLUGIN_URL . '/theme-my-login/js/jquery/ui.core.js', array('jquery'), '1.7.2');
|
221 |
+
$this->AddAdminScript('jquery-ui-tabs', WP_PLUGIN_URL . '/theme-my-login/js/jquery/ui.tabs.js', array('jquery', 'jquery-ui-core'), '1.7.2');
|
222 |
+
}
|
223 |
+
|
224 |
+
$this->AddAdminScript('theme-my-login-admin', WP_PLUGIN_URL . '/theme-my-login/js/theme-my-login-admin.js.php');
|
225 |
+
|
226 |
+
$this->AddAdminStyle('theme-my-login-admin', WP_PLUGIN_URL . '/theme-my-login/css/theme-my-login-admin.css.php');
|
227 |
+
|
228 |
+
if ( version_compare($wp_version, '2.8', '>=') ) {
|
229 |
+
$admin_color = get_usermeta($user_ID, 'admin_color');
|
230 |
+
if ( 'classic' == $admin_color ) {
|
231 |
+
$this->AddAdminStyle('jquery-colors-classic', WP_PLUGIN_URL . '/theme-my-login/css/wp-colors-classic/wp-colors-classic.css');
|
232 |
+
} else {
|
233 |
+
$this->AddAdminStyle('jquery-colors-fresh', WP_PLUGIN_URL . '/theme-my-login/css/wp-colors-fresh/wp-colors-fresh.css');
|
234 |
+
}
|
235 |
+
} elseif ( version_compare($wp_version, '2.7', '>=') ) {
|
236 |
$this->AddAdminStyle('jquery-colors-fresh', WP_PLUGIN_URL . '/theme-my-login/css/wp-colors-fresh/wp-colors-fresh.css');
|
237 |
+
} elseif ( version_compare($wp_version, '2.5', '>=') ) {
|
238 |
+
$this->AddAdminStyle('jquery-colors-classic', WP_PLUGIN_URL . '/theme-my-login/css/wp-colors-classic/wp-colors-classic.css');
|
239 |
}
|
|
|
|
|
|
|
|
|
|
|
240 |
|
241 |
+
if ( 'page.php' == $pagenow && (isset($_REQUEST['post']) && $this->options['general']['page_id'] == $_REQUEST['post']) )
|
242 |
+
add_action('admin_notices', array(&$this, 'PageEditNotice'));
|
243 |
+
}
|
244 |
}
|
245 |
|
246 |
function PageEditNotice() {
|
451 |
|
452 |
function ThemeMyLoginShortcode($args = array()) {
|
453 |
global $WPLogin;
|
454 |
+
|
455 |
$args = wp_parse_args($args);
|
456 |
+
|
457 |
$options = $this->options;
|
458 |
foreach ( $args as $key => $value ) {
|
459 |
if ( !is_array($value) ) {
|
468 |
$options[$key][$k] = $v;
|
469 |
}
|
470 |
}
|
471 |
+
|
472 |
$instance = ( isset($options['widget']['instance']) ) ? $options['widget']['instance'] : $this->NewInstance();
|
473 |
|
474 |
return $WPLogin->Display($instance, $options);
|