Version Description
This package contains several fixes, some new filters, new field types and other functional improvements.
- Some general code cleanup, reviewing inline documentation and comments.
- Fixed issue for sidebar with redirect_to parameter set in widget settings.
- Fixed issue for custom error messages and email comparison error for profile update (so that errors show in form update state and not on links page).
- Fixed main options tab where checkbox may not display correct setting if unchecked.
- Fixed translation issue for required field error where all of the message except the field name was translated.
- Fixed issue for register shortcode page where if a user has registered, and is logging in but the login fails, display the login error message.
- Fixed register shortcode redirect parameter.
- Fixed confirm_password to bypass sanitize_text_field (which breaks password comparison if certain characters are used).
- Added logic so that user_pages are not blocked (login, register, user_profile).
- Added after_wrapper array value for wpmem_{$page}_links_args filters
- Added a new admin api class, utilities object class, and forms object class.
- Added user facing strings as an array in the main $wpmem object class.
- Added wpmem_default_text_strings filter for user facing text strings.
- Added new wpmem_sidebar_status_args filter hook.
- Added new container in main object for email from and from name settings.
- Added file upload functions.
- Added new field types: multiple checkbox, multiple select, radio, file, image, email, url.
- Added "values" key to the register form rows array to hold possible values (i.e. select, multiple select, multiple checkbox, and radio group) and the actual value to be in the "value" key.
- Added the ability for dropdown/select fields to have a default value other than the first value.
- Added filter wpmem_user_upload_dir for filtering the location of user uploaded files.
- Added wpmem_register_form_rows_admin and wpmem_register_form_rows_profile filter hooks.
- Deprecated use of wpmem_chk_qstr() function, use add_query_arg() instead.
- Deprecated use of get_currentuserinfo() (deprecated in WP 4.5), use wp_get_current_user() instead.
- Email function updates, added 'footer' as an array value in the main wpmem_email_filter filter.
- Changed install to set email/confirm_email and user_url as HTML5 field types "email" and "url" (now supported).
- Changed get_action call from init action to template_redirect action.
- Changed username in register form from log to user_login to match wp native registration form.
- Changed [wp-members page="user-profile"] shortcode to wpmem_profile.
- Removed redirect parameter from register shortcode in shortcode menu.
- Removed kubrick stylesheet from selector (still packaged with download, shows as custom url if used).
Download this release
Release Info
Developer | cbutlerjr |
Plugin | WP-Members Membership Plugin |
Version | 3.1.0 |
Comparing to | |
See all releases |
Code changes from version 3.0.9 to 3.1.0
- admin/admin.php +7 -65
- admin/includes/class-wp-members-admin-api.php +283 -0
- admin/includes/class-wp-members-sortable-user-columns.php +0 -1
- admin/js/admin.js +6 -2
- admin/js/shortcodes_tinymce_4.js +5 -5
- admin/post.php +13 -12
- admin/tab-captcha.php +5 -0
- admin/tab-dialogs.php +4 -4
- admin/tab-emails.php +28 -57
- admin/tab-fields.php +28 -13
- admin/tab-options.php +17 -7
- admin/user-profile.php +86 -22
- admin/users.php +2 -2
- changelog.txt +745 -0
- css/generic-no-float.css +38 -14
- css/generic-rigid.css +87 -41
- css/wp-members-2011.css +4 -1
- css/wp-members-2014-no-float.css +253 -234
- css/wp-members-2015-no-float.css +249 -230
- css/wp-members-2016-no-float.css +288 -0
- inc/class-wp-members-forms.php +220 -0
- inc/class-wp-members-utilities.php +62 -0
- inc/class-wp-members.php +201 -14
- inc/core.php +2 -2
- inc/dialogs.php +95 -57
- inc/email.php +150 -97
- inc/forms.php +132 -62
- inc/register.php +120 -44
- inc/shortcodes.php +19 -40
- inc/sidebar.php +56 -34
- inc/users.php +95 -34
- inc/utilities.php +14 -52
- inc/wp-registration.php +1 -1
- readme.txt +55 -12
- wp-members-install.php +42 -26
- wp-members.php +25 -63
admin/admin.php
CHANGED
@@ -28,12 +28,6 @@
|
|
28 |
*/
|
29 |
|
30 |
|
31 |
-
/**
|
32 |
-
* Load dialog functions.
|
33 |
-
*/
|
34 |
-
include_once( WPMEM_PATH . 'admin/dialogs.php' );
|
35 |
-
|
36 |
-
|
37 |
/**
|
38 |
* Actions and Filters
|
39 |
*/
|
@@ -105,11 +99,6 @@ function wpmem_load_admin_js() {
|
|
105 |
*/
|
106 |
function wpmem_a_captcha_tab( $tab ) {
|
107 |
if ( $tab == 'captcha' ) {
|
108 |
-
/**
|
109 |
-
* Load the captcha tab functions.
|
110 |
-
*/
|
111 |
-
include_once( WPMEM_PATH . 'admin/tab-captcha.php' );
|
112 |
-
// Render the captcha tab.
|
113 |
return wpmem_a_build_captcha_options();
|
114 |
} else {
|
115 |
return false;
|
@@ -134,6 +123,7 @@ function wpmem_add_captcha_tab( $tabs ) {
|
|
134 |
* Primary admin function.
|
135 |
*
|
136 |
* @since 2.1.0
|
|
|
137 |
*
|
138 |
* @global object $wpmem The WP_Members object.
|
139 |
*/
|
@@ -155,7 +145,7 @@ function wpmem_admin() {
|
|
155 |
$tab = ( isset( $_GET['tab'] ) ) ? $_GET['tab'] : 'options';
|
156 |
|
157 |
// Render the tab being displayed.
|
158 |
-
|
159 |
|
160 |
// Render any warning messages.
|
161 |
wpmem_a_do_warnings( $did_update );
|
@@ -195,19 +185,15 @@ function wpmem_admin_do_tab( $tab ) {
|
|
195 |
switch ( $tab ) {
|
196 |
|
197 |
case 'options' :
|
198 |
-
include_once( WPMEM_PATH . 'admin/tab-options.php' );
|
199 |
wpmem_a_build_options();
|
200 |
break;
|
201 |
case 'fields' :
|
202 |
-
include_once( WPMEM_PATH . 'admin/tab-fields.php' );
|
203 |
wpmem_a_build_fields();
|
204 |
break;
|
205 |
case 'dialogs' :
|
206 |
-
include_once( WPMEM_PATH . 'admin/tab-dialogs.php' );
|
207 |
wpmem_a_build_dialogs();
|
208 |
break;
|
209 |
case 'emails' :
|
210 |
-
include_once( WPMEM_PATH . 'admin/tab-emails.php' );
|
211 |
wpmem_a_build_emails();
|
212 |
break;
|
213 |
}
|
@@ -221,38 +207,14 @@ function wpmem_admin_do_tab( $tab ) {
|
|
221 |
* can be extended for custom admin tabs with the wpmem_admin_tabs filter.
|
222 |
*
|
223 |
* @since 2.8.0
|
|
|
224 |
*
|
225 |
-
* @
|
|
|
226 |
*/
|
227 |
function wpmem_admin_tabs( $current = 'options' ) {
|
228 |
-
|
229 |
-
$
|
230 |
-
'options' => 'WP-Members ' . __( 'Options', 'wp-members' ),
|
231 |
-
'fields' => __( 'Fields', 'wp-members' ),
|
232 |
-
'dialogs' => __( 'Dialogs', 'wp-members' ),
|
233 |
-
'emails' => __( 'Emails', 'wp-members' ),
|
234 |
-
);
|
235 |
-
|
236 |
-
/**
|
237 |
-
* Filter the admin tabs for the plugin settings page.
|
238 |
-
*
|
239 |
-
* @since 2.8.0
|
240 |
-
*
|
241 |
-
* @param array $tabs An array of the tabs to be displayed on the plugin settings page.
|
242 |
-
*/
|
243 |
-
$tabs = apply_filters( 'wpmem_admin_tabs', $tabs );
|
244 |
-
|
245 |
-
$links = array();
|
246 |
-
foreach ( $tabs as $tab => $name ) {
|
247 |
-
$class = ( $tab == $current ) ? 'nav-tab nav-tab-active' : 'nav-tab';
|
248 |
-
$links[] = '<a class="' . $class . '" href="?page=wpmem-settings&tab=' . $tab . '">' . $name . '</a>';
|
249 |
-
}
|
250 |
-
|
251 |
-
echo '<h2 class="nav-tab-wrapper">';
|
252 |
-
foreach ( $links as $link ) {
|
253 |
-
echo $link;
|
254 |
-
}
|
255 |
-
echo '</h2>';
|
256 |
}
|
257 |
|
258 |
|
@@ -271,44 +233,24 @@ function wpmem_admin_action( $action ) {
|
|
271 |
|
272 |
case 'update_settings':
|
273 |
case 'update_cpts':
|
274 |
-
/**
|
275 |
-
* Load Options tab functions.
|
276 |
-
*/
|
277 |
-
include_once( WPMEM_PATH . 'admin/tab-options.php' );
|
278 |
$did_update = ( 'update_cpts' == $action ) ? wpmem_update_cpts() : wpmem_update_options();
|
279 |
break;
|
280 |
|
281 |
case 'update_fields':
|
282 |
case 'add_field':
|
283 |
case 'edit_field':
|
284 |
-
/**
|
285 |
-
* Load Fields tab functions.
|
286 |
-
*/
|
287 |
-
include_once( WPMEM_PATH . 'admin/tab-fields.php' );
|
288 |
$did_update = wpmem_update_fields( $action );
|
289 |
break;
|
290 |
|
291 |
case 'update_dialogs':
|
292 |
-
/**
|
293 |
-
* Load Dialogs tab functions.
|
294 |
-
*/
|
295 |
-
include_once( WPMEM_PATH . 'admin/tab-dialogs.php' );
|
296 |
$did_update = wpmem_update_dialogs();
|
297 |
break;
|
298 |
|
299 |
case 'update_emails':
|
300 |
-
/**
|
301 |
-
* Load Emails tab functions.
|
302 |
-
*/
|
303 |
-
include_once( WPMEM_PATH . 'admin/tab-emails.php' );
|
304 |
$did_update = wpmem_update_emails();
|
305 |
break;
|
306 |
|
307 |
case 'update_captcha':
|
308 |
-
/**
|
309 |
-
* Load Captcha tab functions.
|
310 |
-
*/
|
311 |
-
include_once( WPMEM_PATH . 'admin/tab-captcha.php' );
|
312 |
$did_update = wpmem_update_captcha();
|
313 |
break;
|
314 |
}
|
28 |
*/
|
29 |
|
30 |
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
/**
|
32 |
* Actions and Filters
|
33 |
*/
|
99 |
*/
|
100 |
function wpmem_a_captcha_tab( $tab ) {
|
101 |
if ( $tab == 'captcha' ) {
|
|
|
|
|
|
|
|
|
|
|
102 |
return wpmem_a_build_captcha_options();
|
103 |
} else {
|
104 |
return false;
|
123 |
* Primary admin function.
|
124 |
*
|
125 |
* @since 2.1.0
|
126 |
+
* @since 3.1.0 Added WP_Members_Admin_API.
|
127 |
*
|
128 |
* @global object $wpmem The WP_Members object.
|
129 |
*/
|
145 |
$tab = ( isset( $_GET['tab'] ) ) ? $_GET['tab'] : 'options';
|
146 |
|
147 |
// Render the tab being displayed.
|
148 |
+
$wpmem->admin->do_tabs( $tab );
|
149 |
|
150 |
// Render any warning messages.
|
151 |
wpmem_a_do_warnings( $did_update );
|
185 |
switch ( $tab ) {
|
186 |
|
187 |
case 'options' :
|
|
|
188 |
wpmem_a_build_options();
|
189 |
break;
|
190 |
case 'fields' :
|
|
|
191 |
wpmem_a_build_fields();
|
192 |
break;
|
193 |
case 'dialogs' :
|
|
|
194 |
wpmem_a_build_dialogs();
|
195 |
break;
|
196 |
case 'emails' :
|
|
|
197 |
wpmem_a_build_emails();
|
198 |
break;
|
199 |
}
|
207 |
* can be extended for custom admin tabs with the wpmem_admin_tabs filter.
|
208 |
*
|
209 |
* @since 2.8.0
|
210 |
+
* @since 3.1.0 Wrapper for API admin_tabs().
|
211 |
*
|
212 |
+
* @global object $wpmem The WP_Members object class.
|
213 |
+
* @param string $current he tab that we are on.
|
214 |
*/
|
215 |
function wpmem_admin_tabs( $current = 'options' ) {
|
216 |
+
global $wpmem;
|
217 |
+
$wpmem->admin->do_tabs( $current );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
218 |
}
|
219 |
|
220 |
|
233 |
|
234 |
case 'update_settings':
|
235 |
case 'update_cpts':
|
|
|
|
|
|
|
|
|
236 |
$did_update = ( 'update_cpts' == $action ) ? wpmem_update_cpts() : wpmem_update_options();
|
237 |
break;
|
238 |
|
239 |
case 'update_fields':
|
240 |
case 'add_field':
|
241 |
case 'edit_field':
|
|
|
|
|
|
|
|
|
242 |
$did_update = wpmem_update_fields( $action );
|
243 |
break;
|
244 |
|
245 |
case 'update_dialogs':
|
|
|
|
|
|
|
|
|
246 |
$did_update = wpmem_update_dialogs();
|
247 |
break;
|
248 |
|
249 |
case 'update_emails':
|
|
|
|
|
|
|
|
|
250 |
$did_update = wpmem_update_emails();
|
251 |
break;
|
252 |
|
253 |
case 'update_captcha':
|
|
|
|
|
|
|
|
|
254 |
$did_update = wpmem_update_captcha();
|
255 |
break;
|
256 |
}
|
admin/includes/class-wp-members-admin-api.php
ADDED
@@ -0,0 +1,283 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* The WP_Members Admin API Class.
|
4 |
+
*
|
5 |
+
* @package WP-Members
|
6 |
+
* @subpackage WP_Members Admin API Object Class
|
7 |
+
* @since 3.1.0
|
8 |
+
*/
|
9 |
+
|
10 |
+
class WP_Members_Admin_API {
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Container for tabs.
|
14 |
+
*
|
15 |
+
* @since 3.1.0
|
16 |
+
* @access public
|
17 |
+
* @var array
|
18 |
+
*/
|
19 |
+
public $tabs = array();
|
20 |
+
|
21 |
+
/**
|
22 |
+
* Container for emails.
|
23 |
+
*
|
24 |
+
* @since 3.1.0
|
25 |
+
* @access public
|
26 |
+
* @var array
|
27 |
+
*/
|
28 |
+
public $emails = array();
|
29 |
+
|
30 |
+
/**
|
31 |
+
* Plugin initialization function.
|
32 |
+
*
|
33 |
+
* @since 3.1.0
|
34 |
+
*/
|
35 |
+
function __construct() {
|
36 |
+
|
37 |
+
// Load dependencies.
|
38 |
+
$this->load_dependencies();
|
39 |
+
|
40 |
+
// Load admin hooks.
|
41 |
+
$this->load_hooks();
|
42 |
+
|
43 |
+
// Load default tabs.
|
44 |
+
$tabs = $this->default_tabs();
|
45 |
+
|
46 |
+
// Load default emails.
|
47 |
+
$emails = $this->default_emails();
|
48 |
+
}
|
49 |
+
|
50 |
+
/**
|
51 |
+
* Load dependencies.
|
52 |
+
*
|
53 |
+
* @since 3.1.0
|
54 |
+
*/
|
55 |
+
function load_dependencies() {
|
56 |
+
if ( is_multisite() && current_user_can( 'edit_theme_options' ) ) {
|
57 |
+
require_once( WPMEM_PATH . 'admin/admin.php' );
|
58 |
+
}
|
59 |
+
if ( current_user_can( 'edit_users' ) ) {
|
60 |
+
require_once( WPMEM_PATH . 'admin/admin.php' );
|
61 |
+
require_once( WPMEM_PATH . 'admin/user-profile.php' );
|
62 |
+
}
|
63 |
+
if ( current_user_can( 'manage_options' ) ) {
|
64 |
+
require_once( WPMEM_PATH . 'admin/tab-options.php' );
|
65 |
+
require_once( WPMEM_PATH . 'admin/tab-fields.php' );
|
66 |
+
require_once( WPMEM_PATH . 'admin/tab-dialogs.php' );
|
67 |
+
require_once( WPMEM_PATH . 'admin/tab-emails.php' );
|
68 |
+
require_once( WPMEM_PATH . 'admin/tab-captcha.php' );
|
69 |
+
require_once( WPMEM_PATH . 'admin/dialogs.php' );
|
70 |
+
//require_once( WPMEM_PATH . 'admin/tab-about.php' );
|
71 |
+
}
|
72 |
+
if ( current_user_can( 'edit_posts' ) ) {
|
73 |
+
require_once( WPMEM_PATH . 'admin/post.php' );
|
74 |
+
}
|
75 |
+
require_once( WPMEM_PATH . 'inc/users.php' );
|
76 |
+
require_once( WPMEM_PATH . 'admin/users.php' );
|
77 |
+
}
|
78 |
+
|
79 |
+
/**
|
80 |
+
* Load admin.
|
81 |
+
*
|
82 |
+
* @since 3.1.0
|
83 |
+
*/
|
84 |
+
function load_hooks() {
|
85 |
+
|
86 |
+
// If user has a role that cannot edit users, set profile actions for non-admins.
|
87 |
+
if ( ! current_user_can( 'edit_users' ) ) {
|
88 |
+
// User actions and filters.
|
89 |
+
add_action( 'show_user_profile', 'wpmem_user_profile' );
|
90 |
+
add_action( 'edit_user_profile', 'wpmem_user_profile' );
|
91 |
+
add_action( 'profile_update', 'wpmem_profile_update' );
|
92 |
+
}
|
93 |
+
|
94 |
+
// If user has a role that can edit posts, add the block/unblock meta boxes and custom post/page columns.
|
95 |
+
if ( current_user_can( 'edit_posts' ) ) {
|
96 |
+
// Post actions and filters.
|
97 |
+
add_action( 'add_meta_boxes', 'wpmem_block_meta_add' );
|
98 |
+
add_action( 'save_post', 'wpmem_block_meta_save' );
|
99 |
+
add_filter( 'manage_posts_columns', 'wpmem_post_columns' );
|
100 |
+
add_action( 'manage_posts_custom_column', 'wpmem_post_columns_content', 10, 2 );
|
101 |
+
add_filter( 'manage_pages_columns', 'wpmem_post_columns' );
|
102 |
+
add_action( 'manage_pages_custom_column', 'wpmem_post_columns_content', 10, 2 );
|
103 |
+
}
|
104 |
+
} // End of load_hooks()
|
105 |
+
|
106 |
+
/**
|
107 |
+
* Display admin tabs.
|
108 |
+
*
|
109 |
+
* @since 3.1.0
|
110 |
+
*
|
111 |
+
* @param string $current The current tab being displayed (default: options).
|
112 |
+
*/
|
113 |
+
function do_tabs( $current = 'options' ) {
|
114 |
+
|
115 |
+
/**
|
116 |
+
* Filter the admin tabs for the plugin settings page.
|
117 |
+
*
|
118 |
+
* @since 2.8.0
|
119 |
+
*
|
120 |
+
* @param array $tabs An array of the tabs to be displayed on the plugin settings page.
|
121 |
+
*/
|
122 |
+
$this->tabs = apply_filters( 'wpmem_admin_tabs', $this->tabs );
|
123 |
+
|
124 |
+
$links = array();
|
125 |
+
foreach ( $this->tabs as $tab => $name ) {
|
126 |
+
$link_args = array( 'page' => 'wpmem-settings', 'tab' => $tab );
|
127 |
+
$link = add_query_arg( $link_args, admin_url( 'options-general.php' ) );
|
128 |
+
$class = ( $tab == $current ) ? 'nav-tab nav-tab-active' : 'nav-tab';
|
129 |
+
$links[] = sprintf( '<a class="%s" href="%s">%s</a>', $class, $link, $name );
|
130 |
+
}
|
131 |
+
|
132 |
+
echo '<h2 class="nav-tab-wrapper">';
|
133 |
+
foreach ( $links as $link ) {
|
134 |
+
echo $link;
|
135 |
+
}
|
136 |
+
echo '</h2>';
|
137 |
+
}
|
138 |
+
|
139 |
+
/**
|
140 |
+
* Adds custom email dialog to the Emails tab.
|
141 |
+
*
|
142 |
+
* @since 3.1.0
|
143 |
+
*
|
144 |
+
* @param array $args Settings array for the email.
|
145 |
+
*/
|
146 |
+
function do_email_input( $args ) { ?>
|
147 |
+
<tr valign="top"><td colspan="2"><strong><?php echo $args['heading']; ?></strong></td></tr>
|
148 |
+
<tr valign="top">
|
149 |
+
<th scope="row"><?php echo $args['subject_label']; ?></th>
|
150 |
+
<td><input type="text" name="<?php echo $args['subject_input']; ?>" size="80" value="<?php echo $args['subject_value']; ?>"></td>
|
151 |
+
</tr>
|
152 |
+
<tr valign="top">
|
153 |
+
<th scope="row"><?php echo $args['body_label']; ?></th>
|
154 |
+
<td><textarea name="<?php echo $args['body_input']; ?>" rows="12" cols="50" id="" class="large-text code"><?php echo $args['body_value']; ?></textarea></td>
|
155 |
+
</tr>
|
156 |
+
<tr><td colspan="2"><hr /></td></tr><?php
|
157 |
+
}
|
158 |
+
|
159 |
+
/**
|
160 |
+
* Saves custom email settings.
|
161 |
+
*
|
162 |
+
* @since 3.1.0
|
163 |
+
*
|
164 |
+
* @param array $args Settings array for the email.
|
165 |
+
*/
|
166 |
+
function email_update( $args ) {
|
167 |
+
$settings = array(
|
168 |
+
'subj' => ( isset( $_POST[ $args['subject_input'] ] ) ) ? $_POST[ $args['subject_input'] ] : '',
|
169 |
+
'body' => ( isset( $_POST[ $args['body_input'] ] ) ) ? $_POST[ $args['body_input'] ] : '',
|
170 |
+
);
|
171 |
+
update_option( $args['name'], $settings, true );
|
172 |
+
$this->emails[ $args['name'] ]['subject_value'] = $settings['subj'];
|
173 |
+
$this->emails[ $args['name'] ]['body_value'] = $settings['body'];
|
174 |
+
return;
|
175 |
+
}
|
176 |
+
|
177 |
+
/**
|
178 |
+
* Handles custom email settings.
|
179 |
+
*
|
180 |
+
* @since 3.1.0
|
181 |
+
*
|
182 |
+
* @param array $args Settings array for the email.
|
183 |
+
* @return array $args
|
184 |
+
*/
|
185 |
+
function add_email( $args ) {
|
186 |
+
|
187 |
+
// Get saved settings.
|
188 |
+
$settings = get_option( $args['name'] );
|
189 |
+
|
190 |
+
$defaults = array(
|
191 |
+
'name' => $args['name'],
|
192 |
+
'heading' => 'Custom email',
|
193 |
+
'subject_label' => 'Subject',
|
194 |
+
'subject_input' => $args['name'] . '_subject',
|
195 |
+
'subject_value' => ( $settings ) ? $settings['subj'] : 'Subject',
|
196 |
+
'body_label' => 'Body',
|
197 |
+
'body_input' => $args['name'] . '_body',
|
198 |
+
'body_value' => ( $settings ) ? $settings['body'] : 'Your custom email message content.',
|
199 |
+
);
|
200 |
+
|
201 |
+
// Merge args with settings.
|
202 |
+
$args = wp_parse_args( $args, $defaults );
|
203 |
+
|
204 |
+
$this->emails[ $args['name'] ] = $args;
|
205 |
+
|
206 |
+
return $args;
|
207 |
+
}
|
208 |
+
|
209 |
+
/**
|
210 |
+
* Settings for default tabs.
|
211 |
+
*
|
212 |
+
* @since 3.1.0
|
213 |
+
*/
|
214 |
+
function default_tabs() {
|
215 |
+
$this->tabs = array(
|
216 |
+
'options' => 'WP-Members ' . __( 'Options', 'wp-members' ),
|
217 |
+
'fields' => __( 'Fields', 'wp-members' ),
|
218 |
+
'dialogs' => __( 'Dialogs', 'wp-members' ),
|
219 |
+
'emails' => __( 'Emails', 'wp-members' ),
|
220 |
+
);
|
221 |
+
}
|
222 |
+
|
223 |
+
/**
|
224 |
+
* Settings for default emails.
|
225 |
+
*
|
226 |
+
* @since 3.1.0
|
227 |
+
*/
|
228 |
+
function default_emails() {
|
229 |
+
global $wpmem;
|
230 |
+
|
231 |
+
if ( $wpmem->mod_reg == 0 ) {
|
232 |
+
|
233 |
+
$this->add_email( array(
|
234 |
+
'name' => 'wpmembers_email_newreg',
|
235 |
+
'heading' => __( "New Registration", 'wp-members' ),
|
236 |
+
'subject_input' => 'wpmembers_email_newreg_subj',
|
237 |
+
'body_input' => 'wpmembers_email_newreg_body',
|
238 |
+
) );
|
239 |
+
|
240 |
+
} else {
|
241 |
+
|
242 |
+
$this->add_email( array(
|
243 |
+
'name' => 'wpmembers_email_newmod',
|
244 |
+
'heading' => __( "Registration is Moderated", 'wp-members' ),
|
245 |
+
'subject_input' => 'wpmembers_email_newmod_subj',
|
246 |
+
'body_input' => 'wpmembers_email_newmod_body',
|
247 |
+
) );
|
248 |
+
$this->add_email( array(
|
249 |
+
'name' => 'wpmembers_email_appmod',
|
250 |
+
'heading' => __( "Registration is Moderated, User is Approved", 'wp-members' ),
|
251 |
+
'subject_input' => 'wpmembers_email_appmod_subj',
|
252 |
+
'body_input' => 'wpmembers_email_appmod_body',
|
253 |
+
) );
|
254 |
+
}
|
255 |
+
|
256 |
+
$this->add_email( array(
|
257 |
+
'name' => 'wpmembers_email_repass',
|
258 |
+
'heading' => __( "Password Reset", 'wp-members' ),
|
259 |
+
'subject_input' => 'wpmembers_email_repass_subj',
|
260 |
+
'body_input' => 'wpmembers_email_repass_body',
|
261 |
+
) );
|
262 |
+
|
263 |
+
$this->add_email( array(
|
264 |
+
'name' => 'wpmembers_email_getuser',
|
265 |
+
'heading' => __( "Retrieve Username", 'wp-members' ),
|
266 |
+
'subject_input' => 'wpmembers_email_getuser_subj',
|
267 |
+
'body_input' => 'wpmembers_email_getuser_body',
|
268 |
+
) );
|
269 |
+
|
270 |
+
if ( $wpmem->notify == 1 ) {
|
271 |
+
$this->add_email( array(
|
272 |
+
'name' => 'wpmembers_email_notify',
|
273 |
+
'heading' => __( "Admin Notification", 'wp-members' ),
|
274 |
+
'subject_input' => 'wpmembers_email_notify_subj',
|
275 |
+
'body_input' => 'wpmembers_email_notify_body',
|
276 |
+
) );
|
277 |
+
}
|
278 |
+
|
279 |
+
}
|
280 |
+
|
281 |
+
} // End of WP_Members_Admin_API class.
|
282 |
+
|
283 |
+
// End of file.
|
admin/includes/class-wp-members-sortable-user-columns.php
CHANGED
@@ -1,4 +1,3 @@
|
|
1 |
-
|
2 |
<?php
|
3 |
/**
|
4 |
* WP-Members Sortable Columns Class.
|
|
|
1 |
<?php
|
2 |
/**
|
3 |
* WP-Members Sortable Columns Class.
|
admin/js/admin.js
CHANGED
@@ -434,11 +434,15 @@ jQuery.fn.extend(
|
|
434 |
$("#wpmem_checkbox_info").show();
|
435 |
else
|
436 |
$("#wpmem_checkbox_info").hide();
|
437 |
-
if ($("#wpmem_field_type_select").val() == 'select'
|
|
|
|
|
|
|
|
|
438 |
$("#wpmem_dropdown_info").show();
|
439 |
else
|
440 |
$("#wpmem_dropdown_info").hide();
|
441 |
-
if ($("#wpmem_field_type_select").val() == 'file')
|
442 |
$("#wpmem_file_info").show();
|
443 |
else
|
444 |
$("#wpmem_file_info").hide();
|
434 |
$("#wpmem_checkbox_info").show();
|
435 |
else
|
436 |
$("#wpmem_checkbox_info").hide();
|
437 |
+
if ( $("#wpmem_field_type_select").val() == 'select'
|
438 |
+
|| $("#wpmem_field_type_select").val() == 'multiselect'
|
439 |
+
|| $("#wpmem_field_type_select").val() == 'radio'
|
440 |
+
|| $("#wpmem_field_type_select").val() == 'multicheckbox'
|
441 |
+
)
|
442 |
$("#wpmem_dropdown_info").show();
|
443 |
else
|
444 |
$("#wpmem_dropdown_info").hide();
|
445 |
+
if ($("#wpmem_field_type_select").val() == 'file' || $("#wpmem_field_type_select").val() == 'image' )
|
446 |
$("#wpmem_file_info").show();
|
447 |
else
|
448 |
$("#wpmem_file_info").hide();
|
admin/js/shortcodes_tinymce_4.js
CHANGED
@@ -54,24 +54,24 @@
|
|
54 |
editor.insertContent('[wpmem_form register]');
|
55 |
}
|
56 |
},
|
57 |
-
{
|
58 |
text: "registration + redirect",
|
59 |
onclick: function(){
|
60 |
editor.insertContent('[wpmem_form register redirect_to="http://mysite.com/my-page/"]');
|
61 |
}
|
62 |
-
}
|
63 |
{
|
64 |
text: "registration + logged in content",
|
65 |
onclick: function(){
|
66 |
editor.insertContent('[wpmem_form register]<br />This displays when logged in<br />[/wpmem_form]');
|
67 |
}
|
68 |
},
|
69 |
-
{
|
70 |
text: "registration + redirect + content",
|
71 |
onclick: function(){
|
72 |
editor.insertContent('[wpmem_form register redirect_to="http://mysite.com/my-page/"]<br />This displays when logged in<br />[/wpmem_form]');
|
73 |
}
|
74 |
-
}
|
75 |
]
|
76 |
},
|
77 |
{
|
@@ -80,7 +80,7 @@
|
|
80 |
{
|
81 |
text: "User Profile Page",
|
82 |
onclick: function(){
|
83 |
-
editor.insertContent('[
|
84 |
}
|
85 |
},
|
86 |
{
|
54 |
editor.insertContent('[wpmem_form register]');
|
55 |
}
|
56 |
},
|
57 |
+
/*{
|
58 |
text: "registration + redirect",
|
59 |
onclick: function(){
|
60 |
editor.insertContent('[wpmem_form register redirect_to="http://mysite.com/my-page/"]');
|
61 |
}
|
62 |
+
},*/
|
63 |
{
|
64 |
text: "registration + logged in content",
|
65 |
onclick: function(){
|
66 |
editor.insertContent('[wpmem_form register]<br />This displays when logged in<br />[/wpmem_form]');
|
67 |
}
|
68 |
},
|
69 |
+
/*{
|
70 |
text: "registration + redirect + content",
|
71 |
onclick: function(){
|
72 |
editor.insertContent('[wpmem_form register redirect_to="http://mysite.com/my-page/"]<br />This displays when logged in<br />[/wpmem_form]');
|
73 |
}
|
74 |
+
},*/
|
75 |
]
|
76 |
},
|
77 |
{
|
80 |
{
|
81 |
text: "User Profile Page",
|
82 |
onclick: function(){
|
83 |
+
editor.insertContent('[wpmem_profile]');
|
84 |
}
|
85 |
},
|
86 |
{
|
admin/post.php
CHANGED
@@ -176,18 +176,19 @@ function wpmem_block_meta_add() {
|
|
176 |
}
|
177 |
|
178 |
foreach ( $post_arr as $key => $val ) {
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
|
|
191 |
}
|
192 |
}
|
193 |
|
176 |
}
|
177 |
|
178 |
foreach ( $post_arr as $key => $val ) {
|
179 |
+
if ( isset( $wp_post_types[ $key ] ) ) {
|
180 |
+
$post_type = $wp_post_types[ $key ];
|
181 |
+
/**
|
182 |
+
* Filter the post meta box title.
|
183 |
+
*
|
184 |
+
* @since 2.9.0
|
185 |
+
*
|
186 |
+
* @param Post restriction title.
|
187 |
+
*/
|
188 |
+
$post_title = apply_filters( 'wpmem_admin_' . $key . '_meta_title', sprintf( __( '%s Restriction', 'wp-members' ), $post_type->labels->singular_name ) );
|
189 |
+
|
190 |
+
add_meta_box( 'wpmem-block-meta-id', $post_title, 'wpmem_block_meta', $key, 'side', 'high' );
|
191 |
+
}
|
192 |
}
|
193 |
}
|
194 |
|
admin/tab-captcha.php
CHANGED
@@ -228,6 +228,11 @@ function wpmem_update_captcha() {
|
|
228 |
$update_type = $_POST['wpmem_recaptcha_type'];
|
229 |
$new_settings = array();
|
230 |
|
|
|
|
|
|
|
|
|
|
|
231 |
if ( $update_type == 'recaptcha' || $update_type == 'recaptcha2' ) {
|
232 |
if ( array_key_exists( 'really_simple', $settings ) ) {
|
233 |
// Updating recaptcha but need to maintain really_simple.
|
228 |
$update_type = $_POST['wpmem_recaptcha_type'];
|
229 |
$new_settings = array();
|
230 |
|
231 |
+
// If there are no current settings.
|
232 |
+
if ( ! $settings ) {
|
233 |
+
$settings = array();
|
234 |
+
}
|
235 |
+
|
236 |
if ( $update_type == 'recaptcha' || $update_type == 'recaptcha2' ) {
|
237 |
if ( array_key_exists( 'really_simple', $settings ) ) {
|
238 |
// Updating recaptcha but need to maintain really_simple.
|
admin/tab-dialogs.php
CHANGED
@@ -62,8 +62,8 @@ function wpmem_a_build_dialogs() {
|
|
62 |
<table class="form-table">
|
63 |
<?php for( $row = 0; $row < count( $wpmem_dialog_title_arr ); $row++ ) { ?>
|
64 |
<tr valign="top">
|
65 |
-
<th scope="row"><?php echo $wpmem_dialog_title_arr[$row]; ?></th>
|
66 |
-
<td><textarea name="<?php echo "dialogs_".$row; ?>" rows="3" cols="50" id="" class="large-text code"><?php echo stripslashes( $wpmem_dialogs[$row] ); ?></textarea></td>
|
67 |
</tr>
|
68 |
<?php } ?>
|
69 |
|
@@ -104,9 +104,9 @@ function wpmem_update_dialogs() {
|
|
104 |
|
105 |
$wpmem_dialogs = get_option( 'wpmembers_dialogs' );
|
106 |
|
107 |
-
for( $row = 0; $row < count( $wpmem_dialogs); $row++ ) {
|
108 |
$dialog = "dialogs_" . $row;
|
109 |
-
$wpmem_newdialogs[$row] = $_POST[$dialog];
|
110 |
}
|
111 |
|
112 |
update_option( 'wpmembers_dialogs', $wpmem_newdialogs );
|
62 |
<table class="form-table">
|
63 |
<?php for( $row = 0; $row < count( $wpmem_dialog_title_arr ); $row++ ) { ?>
|
64 |
<tr valign="top">
|
65 |
+
<th scope="row"><?php echo $wpmem_dialog_title_arr[ $row ]; ?></th>
|
66 |
+
<td><textarea name="<?php echo "dialogs_".$row; ?>" rows="3" cols="50" id="" class="large-text code"><?php echo stripslashes( $wpmem_dialogs[ $row ] ); ?></textarea></td>
|
67 |
</tr>
|
68 |
<?php } ?>
|
69 |
|
104 |
|
105 |
$wpmem_dialogs = get_option( 'wpmembers_dialogs' );
|
106 |
|
107 |
+
for( $row = 0; $row < count( $wpmem_dialogs ); $row++ ) {
|
108 |
$dialog = "dialogs_" . $row;
|
109 |
+
$wpmem_newdialogs[ $row ] = $_POST[ $dialog ];
|
110 |
}
|
111 |
|
112 |
update_option( 'wpmembers_dialogs', $wpmem_newdialogs );
|
admin/tab-emails.php
CHANGED
@@ -23,39 +23,12 @@
|
|
23 |
* Builds the emails panel.
|
24 |
*
|
25 |
* @since 2.7
|
|
|
|
|
26 |
*/
|
27 |
function wpmem_a_build_emails() {
|
28 |
|
29 |
-
global $wpmem;
|
30 |
-
|
31 |
-
if ( $wpmem->mod_reg == 0 ) {
|
32 |
-
$wpmem_email_title_arr = array(
|
33 |
-
array( __( "New Registration", 'wp-members' ), 'wpmembers_email_newreg' ),
|
34 |
-
);
|
35 |
-
} else {
|
36 |
-
$wpmem_email_title_arr = array(
|
37 |
-
array( __( "Registration is Moderated", 'wp-members' ), 'wpmembers_email_newmod' ),
|
38 |
-
array( __( "Registration is Moderated, User is Approved", 'wp-members' ), 'wpmembers_email_appmod' ),
|
39 |
-
);
|
40 |
-
}
|
41 |
-
array_push(
|
42 |
-
$wpmem_email_title_arr,
|
43 |
-
array( __( "Password Reset", 'wp-members' ), 'wpmembers_email_repass' )
|
44 |
-
);
|
45 |
-
array_push(
|
46 |
-
$wpmem_email_title_arr,
|
47 |
-
array( __( "Retrieve Username", 'wp-members' ), 'wpmembers_email_getuser' )
|
48 |
-
);
|
49 |
-
if ( $wpmem->notify == 1 ) {
|
50 |
-
array_push(
|
51 |
-
$wpmem_email_title_arr,
|
52 |
-
array( __( "Admin Notification", 'wp-members' ), 'wpmembers_email_notify' )
|
53 |
-
);
|
54 |
-
}
|
55 |
-
array_push(
|
56 |
-
$wpmem_email_title_arr,
|
57 |
-
array( __( "Email Signature", 'wp-members' ), 'wpmembers_email_footer' )
|
58 |
-
); ?>
|
59 |
<div class="metabox-holder">
|
60 |
|
61 |
<div id="post-body">
|
@@ -74,35 +47,22 @@ function wpmem_a_build_emails() {
|
|
74 |
<table class="form-table">
|
75 |
<tr valign="top">
|
76 |
<th scope="row"><?php _e( 'Set a custom email address', 'wp-members' ); ?></th>
|
77 |
-
<td><input type="text" name="wp_mail_from" size="40" value="<?php echo
|
78 |
</tr>
|
79 |
<tr valign="top">
|
80 |
<th scope="row"><?php _e( 'Set a custom email name', 'wp-members' ); ?></th>
|
81 |
-
<td><input type="text" name="wp_mail_from_name" size="40" value="<?php echo stripslashes(
|
82 |
</tr>
|
83 |
<tr><td colspan="2"><hr /></td></tr>
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
<tr valign="top">
|
91 |
-
<th scope="row"><?php _e( '
|
92 |
-
<td><
|
93 |
-
</tr>
|
94 |
-
<tr valign="top">
|
95 |
-
<th scope="row"><?php _e( 'Body', 'wp-members' ); ?></th>
|
96 |
-
<td><textarea name="<?php echo $wpmem_email_title_arr[$row][1] . '_body'; ?>" rows="12" cols="50" id="" class="large-text code"><?php echo stripslashes( $arr['body'] ); ?></textarea></td>
|
97 |
-
</tr>
|
98 |
-
<tr><td colspan="2"><hr /></td></tr>
|
99 |
-
<?php }
|
100 |
-
|
101 |
-
$arr = get_option( $wpmem_email_title_arr[$row][1] ); ?>
|
102 |
-
|
103 |
-
<tr valign="top">
|
104 |
-
<th scope="row"><strong><?php echo $wpmem_email_title_arr[$row][0]; ?></strong> <span class="description"><?php _e( '(optional)', 'wp-members' ); ?></span></th>
|
105 |
-
<td><textarea name="<?php echo $wpmem_email_title_arr[$row][1] . '_body'; ?>" rows="10" cols="50" id="" class="large-text code"><?php echo stripslashes( $arr ); ?></textarea></td>
|
106 |
</tr>
|
107 |
<tr><td colspan="2"><hr /></td></tr>
|
108 |
<tr valign="top">
|
@@ -134,7 +94,8 @@ function wpmem_a_build_emails() {
|
|
134 |
*
|
135 |
* @since 2.8
|
136 |
*
|
137 |
-
* @
|
|
|
138 |
*/
|
139 |
function wpmem_update_emails() {
|
140 |
|
@@ -144,9 +105,13 @@ function wpmem_update_emails() {
|
|
144 |
check_admin_referer( 'wpmem-update-emails' );
|
145 |
|
146 |
// Update the email address (if applicable).
|
147 |
-
|
148 |
-
|
149 |
-
|
|
|
|
|
|
|
|
|
150 |
// Update the various emails being used.
|
151 |
( $wpmem->mod_reg == 0 ) ? $arr = array( 'wpmembers_email_newreg' ) : $arr = array( 'wpmembers_email_newmod', 'wpmembers_email_appmod' );
|
152 |
array_push( $arr, 'wpmembers_email_repass' );
|
@@ -165,6 +130,12 @@ function wpmem_update_emails() {
|
|
165 |
|
166 |
// Updated the email footer.
|
167 |
update_option( $arr[$row], $_POST[$arr[$row] . '_body'], false );
|
|
|
|
|
|
|
|
|
|
|
|
|
168 |
|
169 |
return __( 'WP-Members emails were updated', 'wp-members' );
|
170 |
|
23 |
* Builds the emails panel.
|
24 |
*
|
25 |
* @since 2.7
|
26 |
+
*
|
27 |
+
* @global object $wpmem
|
28 |
*/
|
29 |
function wpmem_a_build_emails() {
|
30 |
|
31 |
+
global $wpmem; ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
<div class="metabox-holder">
|
33 |
|
34 |
<div id="post-body">
|
47 |
<table class="form-table">
|
48 |
<tr valign="top">
|
49 |
<th scope="row"><?php _e( 'Set a custom email address', 'wp-members' ); ?></th>
|
50 |
+
<td><input type="text" name="wp_mail_from" size="40" value="<?php echo $wpmem->email['from']; ?>" /> <span class="description"><?php _e( '(optional)', 'wp-members' ); ?> email@yourdomain.com</span></td>
|
51 |
</tr>
|
52 |
<tr valign="top">
|
53 |
<th scope="row"><?php _e( 'Set a custom email name', 'wp-members' ); ?></th>
|
54 |
+
<td><input type="text" name="wp_mail_from_name" size="40" value="<?php echo stripslashes( $wpmem->email['from_name'] ); ?>" /> <span class="description"><?php _e( '(optional)', 'wp-members' ); ?> John Smith</span></td>
|
55 |
</tr>
|
56 |
<tr><td colspan="2"><hr /></td></tr>
|
57 |
+
<?php if ( ! empty ( $wpmem->admin->emails ) ) {
|
58 |
+
foreach( $wpmem->admin->emails as $email ) {
|
59 |
+
$wpmem->admin->do_email_input( $email );
|
60 |
+
}
|
61 |
+
}
|
62 |
+
$arr = get_option( 'wpmembers_email_footer' ); ?>
|
63 |
<tr valign="top">
|
64 |
+
<th scope="row"><strong><?php echo __( "Email Signature", 'wp-members' ); ?></strong> <span class="description"><?php _e( '(optional)', 'wp-members' ); ?></span></th>
|
65 |
+
<td><textarea name="<?php echo 'wpmembers_email_footer_body'; ?>" rows="10" cols="50" id="" class="large-text code"><?php echo stripslashes( $arr ); ?></textarea></td>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
66 |
</tr>
|
67 |
<tr><td colspan="2"><hr /></td></tr>
|
68 |
<tr valign="top">
|
94 |
*
|
95 |
* @since 2.8
|
96 |
*
|
97 |
+
* @global object $wpmem The WP_Members object class.
|
98 |
+
* @return string The emails updated message.
|
99 |
*/
|
100 |
function wpmem_update_emails() {
|
101 |
|
105 |
check_admin_referer( 'wpmem-update-emails' );
|
106 |
|
107 |
// Update the email address (if applicable).
|
108 |
+
$wpmem->email['from'] = $_POST['wp_mail_from'];
|
109 |
+
$wpmem->email['from_name'] = $_POST['wp_mail_from_name'];
|
110 |
+
$wpmem_newsettings = get_option( 'wpmembers_settings' );
|
111 |
+
$wpmem_newsettings['email']['from'] = $_POST['wp_mail_from'];
|
112 |
+
$wpmem_newsettings['email']['from_name'] = $_POST['wp_mail_from_name'];
|
113 |
+
update_option( 'wpmembers_settings', $wpmem_newsettings );
|
114 |
+
|
115 |
// Update the various emails being used.
|
116 |
( $wpmem->mod_reg == 0 ) ? $arr = array( 'wpmembers_email_newreg' ) : $arr = array( 'wpmembers_email_newmod', 'wpmembers_email_appmod' );
|
117 |
array_push( $arr, 'wpmembers_email_repass' );
|
130 |
|
131 |
// Updated the email footer.
|
132 |
update_option( $arr[$row], $_POST[$arr[$row] . '_body'], false );
|
133 |
+
|
134 |
+
if ( ! empty ( $wpmem->admin->emails ) ) {
|
135 |
+
foreach( $wpmem->admin->emails as $email ) {
|
136 |
+
$wpmem->admin->email_update( $email );
|
137 |
+
}
|
138 |
+
}
|
139 |
|
140 |
return __( 'WP-Members emails were updated', 'wp-members' );
|
141 |
|
admin/tab-fields.php
CHANGED
@@ -217,7 +217,11 @@ function wpmem_update_fields( $action ) {
|
|
217 |
$arr[8] = ( isset( $_POST['add_checked_default'] ) ) ? $_POST['add_checked_default'] : 'n';
|
218 |
}
|
219 |
|
220 |
-
if (
|
|
|
|
|
|
|
|
|
221 |
// Get the values.
|
222 |
$str = stripslashes( $_POST['add_dropdown_value'] );
|
223 |
// Remove linebreaks.
|
@@ -230,7 +234,7 @@ function wpmem_update_fields( $action ) {
|
|
230 |
}
|
231 |
}
|
232 |
|
233 |
-
if ( $_POST['add_type'] == 'file' ) {
|
234 |
$arr[7] = stripslashes( $_POST['add_file_value'] );
|
235 |
}
|
236 |
|
@@ -247,8 +251,8 @@ function wpmem_update_fields( $action ) {
|
|
247 |
for ( $row = 0; $row < count( $wpmem_fields ); $row++ ) {
|
248 |
if ( $wpmem_fields[$row][2] == $_GET['edit'] ) {
|
249 |
$arr[0] = $wpmem_fields[$row][0];
|
250 |
-
|
251 |
-
for ( $r = 0; $r < $
|
252 |
$wpmem_fields[$row][$r] = $arr[$r];
|
253 |
}
|
254 |
}
|
@@ -327,14 +331,21 @@ function wpmem_a_field_edit( $mode, $wpmem_fields = null, $field = null ) {
|
|
327 |
<?php if ( $mode == 'edit' ) {
|
328 |
echo $field_arr[3]; ?>
|
329 |
<input type="hidden" name="add_type" value="<?php echo $field_arr[3]; ?>" />
|
330 |
-
<?php } else { ?>
|
331 |
<select name="add_type" id="wpmem_field_type_select">
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
338 |
</select>
|
339 |
<?php } ?>
|
340 |
</li>
|
@@ -375,8 +386,12 @@ function wpmem_a_field_edit( $mode, $wpmem_fields = null, $field = null ) {
|
|
375 |
<input type="text" name="add_checked_value" value="<?php echo ( $mode == 'edit' && $field_arr[3] == 'checkbox' ) ? $field_arr[7] : false; ?>" class="small-text" />
|
376 |
</li>
|
377 |
<?php echo ( $mode == 'add' ) ? '</div>' : ''; ?>
|
378 |
-
<?php }
|
379 |
-
|
|
|
|
|
|
|
|
|
380 |
<?php echo ( $mode == 'add' ) ? '<div id="wpmem_dropdown_info">' : ''; ?>
|
381 |
<li>
|
382 |
<strong><?php _e( 'Additional information for dropdown fields', 'wp-members' ); ?></strong>
|
217 |
$arr[8] = ( isset( $_POST['add_checked_default'] ) ) ? $_POST['add_checked_default'] : 'n';
|
218 |
}
|
219 |
|
220 |
+
if ( $_POST['add_type'] == 'select'
|
221 |
+
|| $_POST['add_type'] == 'multiselect'
|
222 |
+
|| $_POST['add_type'] == 'radio'
|
223 |
+
|| $_POST['add_type'] == 'multicheckbox'
|
224 |
+
) {
|
225 |
// Get the values.
|
226 |
$str = stripslashes( $_POST['add_dropdown_value'] );
|
227 |
// Remove linebreaks.
|
234 |
}
|
235 |
}
|
236 |
|
237 |
+
if ( $_POST['add_type'] == 'file' || $_POST['add_type'] == 'image' ) {
|
238 |
$arr[7] = stripslashes( $_POST['add_file_value'] );
|
239 |
}
|
240 |
|
251 |
for ( $row = 0; $row < count( $wpmem_fields ); $row++ ) {
|
252 |
if ( $wpmem_fields[$row][2] == $_GET['edit'] ) {
|
253 |
$arr[0] = $wpmem_fields[$row][0];
|
254 |
+
//$x = ( $arr[3] == 'checkbox' ) ? 8 : ( ( $arr[3] == 'select' || $arr[3] == 'file' ) ? 7 : 6 );
|
255 |
+
for ( $r = 0; $r < count( $arr ); $r++ ) {
|
256 |
$wpmem_fields[$row][$r] = $arr[$r];
|
257 |
}
|
258 |
}
|
331 |
<?php if ( $mode == 'edit' ) {
|
332 |
echo $field_arr[3]; ?>
|
333 |
<input type="hidden" name="add_type" value="<?php echo $field_arr[3]; ?>" />
|
334 |
+
<?php } else { ?>
|
335 |
<select name="add_type" id="wpmem_field_type_select">
|
336 |
+
<option value="text"><?php _e( 'text', 'wp-members' ); ?></option>
|
337 |
+
<option value="email"><?php _e( 'email', 'wp-members' ); ?></option>
|
338 |
+
<option value="textarea"><?php _e( 'textarea', 'wp-members' ); ?></option>
|
339 |
+
<option value="checkbox"><?php _e( 'checkbox', 'wp-members' ); ?></option>
|
340 |
+
<option value="multicheckbox"><?php _e( 'multiple checkbox', 'wp-members' ); ?></option>
|
341 |
+
<option value="select"><?php _e( 'select (dropdown)', 'wp-members' ); ?></option>
|
342 |
+
<option value="multiselect"><?php _e( 'multiple select', 'wp-members' ); ?></option>
|
343 |
+
<option value="radio"><?php _e( 'radio group', 'wp-members' ); ?></option>
|
344 |
+
<option value="password"><?php _e( 'password', 'wp-members' ); ?></option>
|
345 |
+
<option value="image"><?php _e( 'image', 'wp-members' ); ?></option>
|
346 |
+
<option value="file"><?php _e( 'file', 'wp-members' ); ?></option>
|
347 |
+
<option value="url"><?php _e( 'url', 'wp-members' ); ?></option>
|
348 |
+
<option value="hidden"><?php _e( 'hidden', 'wp-members' ); ?></option>
|
349 |
</select>
|
350 |
<?php } ?>
|
351 |
</li>
|
386 |
<input type="text" name="add_checked_value" value="<?php echo ( $mode == 'edit' && $field_arr[3] == 'checkbox' ) ? $field_arr[7] : false; ?>" class="small-text" />
|
387 |
</li>
|
388 |
<?php echo ( $mode == 'add' ) ? '</div>' : ''; ?>
|
389 |
+
<?php }
|
390 |
+
|
391 |
+
if ( isset( $field_arr[3] ) ) {
|
392 |
+
$additional_settings = ( $field_arr[3] == 'select' || $field_arr[3] == 'multiselect' || $field_arr[3] == 'multicheckbox' || $field_arr[3] == 'radio' ) ? true : false;
|
393 |
+
}
|
394 |
+
if ( $mode == 'add' || ( $mode == 'edit' && $additional_settings ) ) { ?>
|
395 |
<?php echo ( $mode == 'add' ) ? '<div id="wpmem_dropdown_info">' : ''; ?>
|
396 |
<li>
|
397 |
<strong><?php _e( 'Additional information for dropdown fields', 'wp-members' ); ?></strong>
|
admin/tab-options.php
CHANGED
@@ -141,8 +141,8 @@ function wpmem_a_build_options() {
|
|
141 |
for ( $row = 0; $row < count( $arr ); $row++ ) { ?>
|
142 |
<li>
|
143 |
<label><?php echo $arr[$row][0]; ?></label>
|
144 |
-
<?php if (WPMEM_DEBUG == true) { echo $wpmem
|
145 |
-
<input name="<?php echo $arr[$row][1]; ?>" type="checkbox" id="<?php echo $arr[$row][1]; ?>" value="1" <?php if ( $wpmem
|
146 |
<?php if ( $arr[$row][2] ) { ?><span class="description"><?php echo $arr[$row][2]; ?></span><?php } ?>
|
147 |
</li>
|
148 |
<?php }
|
@@ -157,8 +157,8 @@ function wpmem_a_build_options() {
|
|
157 |
for ( $row = 0; $row < count( $arr ); $row++ ) { ?>
|
158 |
<li>
|
159 |
<label><?php echo $arr[$row][0]; ?></label>
|
160 |
-
<?php if (WPMEM_DEBUG == true) { echo $wpmem
|
161 |
-
<input name="<?php echo $arr[$row][1]; ?>" type="checkbox" id="<?php echo $arr[$row][1]; ?>" value="1" <?php if ( $wpmem
|
162 |
<?php if ( $arr[$row][2] ) { ?><span class="description"><?php echo $arr[$row][2]; ?></span><?php } ?>
|
163 |
</li>
|
164 |
<?php } ?>
|
@@ -414,6 +414,16 @@ function wpmem_update_options() {
|
|
414 |
}
|
415 |
}
|
416 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
417 |
// Get settings for blocking, excerpts, show login, and show registration for posts, pages, and custom post types.
|
418 |
$option_group_array = array( 'block', 'show_excerpt', 'show_login', 'show_reg', 'autoex' );
|
419 |
foreach ( $option_group_array as $option_group_item ) {
|
@@ -440,7 +450,7 @@ function wpmem_update_options() {
|
|
440 |
*/
|
441 |
if ( isset( $_POST['wpmem_settings_moderate'] ) == 1 ) {
|
442 |
global $current_user;
|
443 |
-
|
444 |
$user_ID = $current_user->ID;
|
445 |
update_user_meta( $user_ID, 'active', 1 );
|
446 |
}
|
@@ -499,7 +509,7 @@ function wpmem_admin_style_list( $style ) {
|
|
499 |
'Twenty Twelve' => WPMEM_DIR . 'css/wp-members-2012.css',
|
500 |
'Twenty Eleven' => WPMEM_DIR . 'css/wp-members-2011.css',
|
501 |
'Twenty Ten' => WPMEM_DIR . 'css/wp-members.css',
|
502 |
-
'Kubrick' => WPMEM_DIR . 'css/wp-members-kubrick.css',
|
503 |
);
|
504 |
|
505 |
/**
|
@@ -514,7 +524,7 @@ function wpmem_admin_style_list( $style ) {
|
|
514 |
$selected = false;
|
515 |
foreach ( $list as $name => $location ) {
|
516 |
$selected = ( $location == $style ) ? true : $selected;
|
517 |
-
echo '<option value="' . $location . '" ' .
|
518 |
}
|
519 |
$selected = ( ! $selected ) ? ' selected' : '';
|
520 |
echo '<option value="use_custom"' . $selected . '>' . __( 'USE CUSTOM URL BELOW', 'wp-members' ) . '</option>';
|
141 |
for ( $row = 0; $row < count( $arr ); $row++ ) { ?>
|
142 |
<li>
|
143 |
<label><?php echo $arr[$row][0]; ?></label>
|
144 |
+
<?php if (WPMEM_DEBUG == true) { echo $wpmem->{$arr[$row][3]}; } ?>
|
145 |
+
<input name="<?php echo $arr[$row][1]; ?>" type="checkbox" id="<?php echo $arr[$row][1]; ?>" value="1" <?php if ( $wpmem->{$arr[$row][3]} == 1 ) { echo "checked"; }?> />
|
146 |
<?php if ( $arr[$row][2] ) { ?><span class="description"><?php echo $arr[$row][2]; ?></span><?php } ?>
|
147 |
</li>
|
148 |
<?php }
|
157 |
for ( $row = 0; $row < count( $arr ); $row++ ) { ?>
|
158 |
<li>
|
159 |
<label><?php echo $arr[$row][0]; ?></label>
|
160 |
+
<?php if (WPMEM_DEBUG == true) { echo $wpmem->{$arr[$row][3]}; } ?>
|
161 |
+
<input name="<?php echo $arr[$row][1]; ?>" type="checkbox" id="<?php echo $arr[$row][1]; ?>" value="1" <?php if ( $wpmem->{$arr[$row][3]} == 1 ) { echo "checked"; }?> />
|
162 |
<?php if ( $arr[$row][2] ) { ?><span class="description"><?php echo $arr[$row][2]; ?></span><?php } ?>
|
163 |
</li>
|
164 |
<?php } ?>
|
414 |
}
|
415 |
}
|
416 |
|
417 |
+
// Leave form tag settings alone.
|
418 |
+
if ( isset( $wpmem->form_tags ) ) {
|
419 |
+
$wpmem_newsettings['form_tags'] = $wpmem->form_tags;
|
420 |
+
}
|
421 |
+
|
422 |
+
// Leave email settings alone.
|
423 |
+
if ( isset( $wpmem->email ) ) {
|
424 |
+
$wpmem_newsettings['email'] = $wpmem->email;
|
425 |
+
}
|
426 |
+
|
427 |
// Get settings for blocking, excerpts, show login, and show registration for posts, pages, and custom post types.
|
428 |
$option_group_array = array( 'block', 'show_excerpt', 'show_login', 'show_reg', 'autoex' );
|
429 |
foreach ( $option_group_array as $option_group_item ) {
|
450 |
*/
|
451 |
if ( isset( $_POST['wpmem_settings_moderate'] ) == 1 ) {
|
452 |
global $current_user;
|
453 |
+
wp_get_current_user();
|
454 |
$user_ID = $current_user->ID;
|
455 |
update_user_meta( $user_ID, 'active', 1 );
|
456 |
}
|
509 |
'Twenty Twelve' => WPMEM_DIR . 'css/wp-members-2012.css',
|
510 |
'Twenty Eleven' => WPMEM_DIR . 'css/wp-members-2011.css',
|
511 |
'Twenty Ten' => WPMEM_DIR . 'css/wp-members.css',
|
512 |
+
//'Kubrick' => WPMEM_DIR . 'css/wp-members-kubrick.css',
|
513 |
);
|
514 |
|
515 |
/**
|
524 |
$selected = false;
|
525 |
foreach ( $list as $name => $location ) {
|
526 |
$selected = ( $location == $style ) ? true : $selected;
|
527 |
+
echo '<option value="' . $location . '" ' . selected( $location, $style ) . '>' . $name . "</option>\n";
|
528 |
}
|
529 |
$selected = ( ! $selected ) ? ' selected' : '';
|
530 |
echo '<option value="use_custom"' . $selected . '>' . __( 'USE CUSTOM URL BELOW', 'wp-members' ) . '</option>';
|
admin/user-profile.php
CHANGED
@@ -64,41 +64,97 @@ function wpmem_admin_fields() {
|
|
64 |
*/
|
65 |
do_action( 'wpmem_admin_before_profile', $user_id, $wpmem_fields );
|
66 |
|
|
|
67 |
foreach ( $wpmem_fields as $meta ) {
|
68 |
|
69 |
-
$valtochk = '';
|
70 |
|
71 |
// Determine which fields to show in the additional fields area.
|
72 |
$show = ( $meta[6] == 'n' && ! in_array( $meta[2], $exclude ) ) ? true : false;
|
73 |
$show = ( $meta[1] == 'TOS' && $meta[4] != 'y' ) ? null : $show;
|
74 |
|
75 |
if ( $show ) {
|
76 |
-
// Is the field required?
|
77 |
-
$req = ( $meta[5] == 'y' ) ? ' <span class="description">' . __( '(required)' ) . '</span>' : '';
|
78 |
|
79 |
-
$
|
80 |
-
|
81 |
-
|
82 |
-
<td>';
|
83 |
-
$val = htmlspecialchars( get_user_meta( $user_id, $meta[2], true ) );
|
84 |
-
if ( $meta[3] == 'checkbox' || $meta[3] == 'select' ) {
|
85 |
$valtochk = $val;
|
86 |
$val = $meta[7];
|
87 |
}
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
100 |
}
|
101 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
102 |
|
103 |
// See if reg is moderated, and if the user has been activated.
|
104 |
if ( $wpmem->mod_reg == 1 ) {
|
@@ -183,12 +239,20 @@ function wpmem_admin_update() {
|
|
183 |
$fields = array();
|
184 |
$chk_pass = false;
|
185 |
foreach ( $wpmem_fields as $meta ) {
|
186 |
-
if ( $meta[6] == "n"
|
|
|
|
|
|
|
|
|
|
|
|
|
187 |
( isset( $_POST[ $meta[2] ] ) ) ? $fields[ $meta[2] ] = $_POST[ $meta[2] ] : false;
|
188 |
} elseif ( $meta[2] == 'password' && $meta[4] == 'y' ) {
|
189 |
$chk_pass = true;
|
190 |
} elseif ( $meta[3] == 'checkbox' ) {
|
191 |
$fields[ $meta[2] ] = ( isset( $_POST[ $meta[2] ] ) ) ? $_POST[ $meta[2] ] : '';
|
|
|
|
|
192 |
}
|
193 |
}
|
194 |
|
64 |
*/
|
65 |
do_action( 'wpmem_admin_before_profile', $user_id, $wpmem_fields );
|
66 |
|
67 |
+
$rows = array();
|
68 |
foreach ( $wpmem_fields as $meta ) {
|
69 |
|
70 |
+
$valtochk = ''; $values = '';
|
71 |
|
72 |
// Determine which fields to show in the additional fields area.
|
73 |
$show = ( $meta[6] == 'n' && ! in_array( $meta[2], $exclude ) ) ? true : false;
|
74 |
$show = ( $meta[1] == 'TOS' && $meta[4] != 'y' ) ? null : $show;
|
75 |
|
76 |
if ( $show ) {
|
|
|
|
|
77 |
|
78 |
+
$val = get_user_meta( $user_id, $meta[2], true );
|
79 |
+
$val = ( $meta[3] == 'multiselect' || $meta[3] == 'multicheckbox' ) ? $val : htmlspecialchars( $val );
|
80 |
+
if ( $meta[3] == 'checkbox' ) {
|
|
|
|
|
|
|
81 |
$valtochk = $val;
|
82 |
$val = $meta[7];
|
83 |
}
|
84 |
+
|
85 |
+
if ( 'multicheckbox' == $meta[3] || 'select' == $meta[3] || 'multiselect' == $meta[3] || 'radio' == $meta[3] ) {
|
86 |
+
$values = $meta[7];
|
87 |
+
$valtochk = $val;
|
88 |
+
}
|
89 |
+
|
90 |
+
// Is this an image or a file?
|
91 |
+
if ( 'file' == $meta[3] || 'image' == $meta[3] ) {
|
92 |
+
$attachment_url = wp_get_attachment_url( $val );
|
93 |
+
$empty_file = '<span class="description">' . __( 'None' ) . '</span>';
|
94 |
+
if ( 'file' == $meta[3] ) {
|
95 |
+
$input = ( $attachment_url ) ? '<a href="' . $attachment_url . '">' . $attachment_url . '</a>' : $empty_file;
|
96 |
+
} else {
|
97 |
+
$input = ( $attachment_url ) ? '<img src="' . $attachment_url . '">' : $empty_file;
|
98 |
+
}
|
99 |
+
// @todo - come up with a way to handle file updates - user profile form does not support multitype
|
100 |
+
//$show_field.= ' <span class="description">' . __( 'Update this file:' ) . '</span><br />';
|
101 |
+
//$show_field.= wpmem_create_formfield( $meta[2] . '_update_file', $meta[3], $val, $valtochk );
|
102 |
+
} else {
|
103 |
+
if ( 'multicheckbox' == $meta[3] || 'select' == $meta[3] || 'multiselect' == $meta[3] || 'radio' == $meta[3] ) {
|
104 |
+
$input = wpmem_create_formfield( $meta[2], $meta[3], $values, $valtochk );
|
105 |
+
} else {
|
106 |
+
$input = wpmem_create_formfield( $meta[2], $meta[3], $val, $valtochk );
|
107 |
+
}
|
108 |
+
}
|
109 |
+
|
110 |
+
// Is the field required?
|
111 |
+
$req = ( $meta[5] == 'y' ) ? ' <span class="description">' . __( '(required)' ) . '</span>' : '';
|
112 |
+
$label = '<label>' . __( $meta[1], 'wp-members' ) . $req . '</label>';
|
113 |
+
|
114 |
+
// Build the form rows for filtering.
|
115 |
+
$rows[ $meta[2] ] = array(
|
116 |
+
'order' => $meta[0],
|
117 |
+
'meta' => $meta[2],
|
118 |
+
'type' => $meta[3],
|
119 |
+
'value' => $val,
|
120 |
+
'values' => $values,
|
121 |
+
'label_text' => __( $meta[1], 'wp-members' ),
|
122 |
+
'row_before' => '',
|
123 |
+
'label' => $label,
|
124 |
+
'field_before' => '',
|
125 |
+
'field' => $input,
|
126 |
+
'field_after' => '',
|
127 |
+
'row_after' => '',
|
128 |
+
);
|
129 |
}
|
130 |
}
|
131 |
+
|
132 |
+
/**
|
133 |
+
* Filter for rows
|
134 |
+
*
|
135 |
+
* @since 3.1.0
|
136 |
+
*
|
137 |
+
* @param array $rows
|
138 |
+
* @param string $toggle
|
139 |
+
*/
|
140 |
+
$rows = apply_filters( 'wpmem_register_form_rows_admin', $rows, 'adminprofile' );
|
141 |
+
|
142 |
+
foreach ( $rows as $row ) {
|
143 |
+
$show_field = '
|
144 |
+
<tr>
|
145 |
+
<th>' . $row['label'] . '</th>
|
146 |
+
<td>' . $row['field'] . '</td>
|
147 |
+
</tr>';
|
148 |
+
|
149 |
+
/**
|
150 |
+
* Filter the profile field.
|
151 |
+
*
|
152 |
+
* @since 2.8.2
|
153 |
+
*
|
154 |
+
* @param string $show_field The HTML string for the additional profile field.
|
155 |
+
*/
|
156 |
+
echo apply_filters( 'wpmem_admin_profile_field', $show_field );
|
157 |
+
}
|
158 |
|
159 |
// See if reg is moderated, and if the user has been activated.
|
160 |
if ( $wpmem->mod_reg == 1 ) {
|
239 |
$fields = array();
|
240 |
$chk_pass = false;
|
241 |
foreach ( $wpmem_fields as $meta ) {
|
242 |
+
if ( $meta[6] == "n"
|
243 |
+
&& $meta[3] != 'password'
|
244 |
+
&& $meta[3] != 'checkbox'
|
245 |
+
&& $meta[3] != 'multiselect'
|
246 |
+
&& $meta[3] != 'multicheckbox'
|
247 |
+
&& $meta[3] != 'file'
|
248 |
+
&& $meta[3] != 'image' ) {
|
249 |
( isset( $_POST[ $meta[2] ] ) ) ? $fields[ $meta[2] ] = $_POST[ $meta[2] ] : false;
|
250 |
} elseif ( $meta[2] == 'password' && $meta[4] == 'y' ) {
|
251 |
$chk_pass = true;
|
252 |
} elseif ( $meta[3] == 'checkbox' ) {
|
253 |
$fields[ $meta[2] ] = ( isset( $_POST[ $meta[2] ] ) ) ? $_POST[ $meta[2] ] : '';
|
254 |
+
} elseif ( $meta[3] == 'multiselect' || $meta[3] == 'multicheckbox' ) {
|
255 |
+
$fields[ $meta[2] ] = ( isset( $_POST[ $meta[2] ] ) ) ? implode( '|', $_POST[ $meta[2] ] ) : '';
|
256 |
}
|
257 |
}
|
258 |
|
admin/users.php
CHANGED
@@ -389,8 +389,8 @@ function wpmem_a_activate_user( $user_id, $chk_pass = false ) {
|
|
389 |
$wpdb->update( $wpdb->users, array( 'user_pass' => $new_hash ), array( 'ID' => $user_id ), array( '%s' ), array( '%d' ) );
|
390 |
}
|
391 |
|
392 |
-
// If subscriptions can expire,
|
393 |
-
if( $wpmem->use_exp == 1 ) {
|
394 |
wpmem_set_exp( $user_id );
|
395 |
}
|
396 |
|
389 |
$wpdb->update( $wpdb->users, array( 'user_pass' => $new_hash ), array( 'ID' => $user_id ), array( '%s' ), array( '%d' ) );
|
390 |
}
|
391 |
|
392 |
+
// If subscriptions can expire, and the user has no expiration date, set one.
|
393 |
+
if( $wpmem->use_exp == 1 && ! get_user_meta( $user_id, 'expires', true ) ) {
|
394 |
wpmem_set_exp( $user_id );
|
395 |
}
|
396 |
|
changelog.txt
ADDED
@@ -0,0 +1,745 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
= 3.0.8 =
|
2 |
+
|
3 |
+
* Added process for forgotten username retrieval.
|
4 |
+
* Removed last remaining instances of extract function.
|
5 |
+
* Updated settings for special pages (login|register|user-profile) to store only the numeric primary key ID. This will eliminate the need to update these settings if the site is moved (from a dev to live site, for example). Legacy full URL settings will still be compatible without needing to be updated, but will be automatically updated when main options are saved.
|
6 |
+
|
7 |
+
= 3.0.7 =
|
8 |
+
|
9 |
+
* Fix for use of display_name on profile update.
|
10 |
+
* Fix for newer installs (post WP 4.0) where WPLANG is not defined and reCAPTCHA is used.
|
11 |
+
* Fix in wpmem_form shortcode to skp if no additional tag exists.
|
12 |
+
* Fix to plugin_basename.
|
13 |
+
* Changes in core to use fields from WP_Members class (preparing for new form field process).
|
14 |
+
* Reviews and updates to code standards and inline documentation.
|
15 |
+
* Fix for password reset (typo in object name checking for moderated registration)
|
16 |
+
* Fix for PayPal extension (http://rkt.bz/r3); added logic to avoid errors if the PayPal extension is disabled but the main option setting remained turned on.
|
17 |
+
|
18 |
+
= 3.0.6 =
|
19 |
+
|
20 |
+
* Updates to localization function - documented plugin_locale filter, wpmem_localization_file filter, and improved load_textdomain logic.
|
21 |
+
* Added /lang domain path to plugin header.
|
22 |
+
* Fixed a bug in the user export function that broke CSV columns when moderated registration was turned on.
|
23 |
+
* Improved current page retrieval in wpmem_redirect_to_login() function.
|
24 |
+
* Fixed admin enqueued scripts (post/page screen hook did not load from new location).
|
25 |
+
|
26 |
+
= 3.0.5 =
|
27 |
+
|
28 |
+
* Updated wpmem_pwd_change and wpmem_pwd_reset action hooks to include password as a parameter.
|
29 |
+
* Stylesheet updates for 2015, 2014, and generic (both float and no float).
|
30 |
+
* Fix to TinyMCE shortcode button, should now load button on new post/page editor.
|
31 |
+
* Added [WP-Members] to the TinyMCE shortcode button for clarity as to what it is.
|
32 |
+
* Moved admin js and css files to /admin/js/ and /admin/css/
|
33 |
+
* Moved admin class files to /admin/includes/
|
34 |
+
* Updated and verified all directories contain an index.php file to prevent directory browsing.
|
35 |
+
|
36 |
+
= 3.0.4 =
|
37 |
+
|
38 |
+
* Reintroduced the global action variable $wpmem_a for backward compatibility with certain add-ons, most notably the WP-Members MailChimp extension ( see http://rkt.bz/3b ). Users of this extension should upgrade. This variable had been replaced with the new WP-Members object class introduced in 3.0. However, users of older extensions and those that may have customziations with logic may be using this variable, so rather than force updating and upgrading, it is being added back in.
|
39 |
+
* Change to the priority of functions hooked to the the_content filter. Lowering the priority should better integrate the plugin with various builder plugins and other processes that currently filter the_content after WP-Members since the content will now be filtered later in the process. This also should improve situations where in the past the on-the-fly texturization shortcode for the WP-Members forms might remain unparsed.
|
40 |
+
|
41 |
+
= 3.0.3 =
|
42 |
+
|
43 |
+
* Bug fix recaptcha v2 decode json response on validation.
|
44 |
+
* Bug fix typo in $wpmem object name in admin/user-profile.php.
|
45 |
+
* Bug fix message string variable in wpmem_msg_dialog_arr filter.
|
46 |
+
* Fix register form shortcode redirect_to parameter.
|
47 |
+
* Admin forms now use submit_button() function to generate submit button.
|
48 |
+
* Changed localization to load on init action which will allow for more flexibility with filtering custom language files.
|
49 |
+
* Added wpmem_localization_file and wpmem_localization_dir filters.
|
50 |
+
* Localization checks for file in /wp-content/ language directory first, then loads plugin default.
|
51 |
+
|
52 |
+
= 3.0.2 =
|
53 |
+
|
54 |
+
* Added reCAPTCHA version 2 as an option. v1 will remain available for now, to be fully deprecated later.
|
55 |
+
* Fixed widget to use __construct for WP 4.3 compatibility.
|
56 |
+
* Added error checking for WP reserved names when adding new custom fields.
|
57 |
+
* Added wpmem_wp_reserved_terms filter for overriding reserved terms list.
|
58 |
+
* Added trim whitespace to password reset and password change form validation.
|
59 |
+
|
60 |
+
= 3.0.1 =
|
61 |
+
|
62 |
+
* Fixed use of wp_signon() for ssl.
|
63 |
+
* Fixed [wpmem_msurl] email shortcode.
|
64 |
+
* Fixed admin js and css load (removed unnecessary slash).
|
65 |
+
* Fixed autoexcerpt to use setting from object and not wpmemembers_autoex option.
|
66 |
+
* Added filter to remove comments array if content is blocked.
|
67 |
+
|
68 |
+
= 3.0.0 =
|
69 |
+
|
70 |
+
This release makes significant changes to the plugin's main options in the way they are stored. While care has been taken to make sure that you can roll back to a previous version, you may need to resave settings in the plugin's main options tab when attempting to roll back. It is advised that you test this update prior upgrading an existing install on a production site.
|
71 |
+
|
72 |
+
If you have any custom functions hooked to filters and actions that call any file includes directly from the plugin, please note that several file names have changed.
|
73 |
+
|
74 |
+
* New settings and new plugin class WP_Members.
|
75 |
+
* New settings now natively support Custom Post Types, both setting defaults and individual post blocking.
|
76 |
+
* Settings constants removed in favor of using the $wpmem object class.
|
77 |
+
* Added new|edit toggle to wpmem-register_data filter hook.
|
78 |
+
* wpmem_settings_loaded action added.
|
79 |
+
* Securify comments changed to use comments_open instead of comments_template (with a blank template).
|
80 |
+
* New wpmem_securify_comments filter hook to customize whether comments load or not.
|
81 |
+
* Registration clear form button defaults to false.
|
82 |
+
* Removed wp_set_auth_cookie from login function; it is already done as part of wp_signon.
|
83 |
+
* Post meta box title filter is now for all post types wpmem_admin_{post type}_meta_title.
|
84 |
+
* New filter for Really Simple Captcha folder location: wpmem_rs_captcha_folder.
|
85 |
+
* New shortcodes [wpmem_form] added.
|
86 |
+
* Shortcode dropdown selector added to tinymce toolbar in Post/Page editor.
|
87 |
+
* Added redirect_to as a function argument if calling wpmem_logout() directly.
|
88 |
+
|
89 |
+
= 2.9.9 =
|
90 |
+
* Code standards in wp-members-email.php
|
91 |
+
* Rebuilt admin notification email to follow new regular email structure with more filters in wp-members-email.com
|
92 |
+
* Added $toggle to headers filter that is used in both emails so that headers could be filtered based on the email being sent (i.e. sending plain text for admin notification vs html for others. in wp-members-email.php
|
93 |
+
* Added redirect_to parameter as a widget entry in wp-members-sidebar.php
|
94 |
+
* Corrected flaws in error checking for adding new fields in /admin/tab-fields.php
|
95 |
+
* Added functions for updating user_status in wp_users table in /admin/users.php
|
96 |
+
* Fixed get_user_meta 'true' error in wp-members-core.php, users.php, /admin/users.php, /admin/user-profile.php
|
97 |
+
* Added dummy comments template to protect comments without post password.
|
98 |
+
* Added new action for deactivting a user (opposite of wpmem_user_activated).
|
99 |
+
* Added check to remove password, confirm_password, and confirm_email from export (data for these was already skipped, but the field space was there).
|
100 |
+
* Added wpmem_status_msg_args and wpmem_login_links_args filters.
|
101 |
+
* Corrected Really Simple Captcha, added field wrapper and should not display on user profile edit.
|
102 |
+
|
103 |
+
= 2.9.8 =
|
104 |
+
* Fixed bug in settings update that caused the stored version number to be erased.
|
105 |
+
* Fixed bug with new email function that causes the wpmem_email_newreg not to apply any filtered changes to the email body.
|
106 |
+
* Major updates to wpmem_block logic, changing to universal _wpmem_block from two separate metas (block & unblock).
|
107 |
+
* Fixed bug in the page bulk action that caused the result to end up on the posts page.
|
108 |
+
* Added wpmem_use_ssl utility function.
|
109 |
+
* Added use of wpmem_use_ssl function to reCAPTCHA to load correctly (previously handled ssl directly).
|
110 |
+
* Added use of wpmem_use_ssl function for default input text for custom register page, user profile page, and custom stylesheet settings inputs.
|
111 |
+
* Added new redirect_to parameter to login page shortcode.
|
112 |
+
* Fixed checkbox for checked by default on the add new user screen.
|
113 |
+
* Fixed "admin only" fields to display on the add new user screen.
|
114 |
+
* Added underscores parameter to the fields shortcode to strip underscores. Defaults to off.
|
115 |
+
* Updated excerpt logic to not show excerpts on multipage posts if not the first page.
|
116 |
+
* Added new 2015 stylesheets (currently available, but subject to changes/updates)
|
117 |
+
|
118 |
+
= 2.9.7 =
|
119 |
+
* Fixed comparison for the checkbox CSS class in wpmem_create_formfield.
|
120 |
+
* Corrected wp native registration function for use on localized sites.
|
121 |
+
* Rebuilt export function, merges the two previous functions into one (export selected and export all) and will allow for calling custom exports.
|
122 |
+
* Rebuilt user email function.
|
123 |
+
* Added default "from" headers to email.
|
124 |
+
* Added new filter wpmem_export_args.
|
125 |
+
* Added new filter wpmem_email_filter.
|
126 |
+
* Added a redirect_to parameter to the registration form similar to the login.
|
127 |
+
* Fixed plugin admin page load for multisite, if user has theme options edit capabilities.
|
128 |
+
|
129 |
+
= 2.9.6 =
|
130 |
+
* Updated admin.js to show/hide custom url fields for User Profile page, Register page, and Stylesheet settings.
|
131 |
+
* Updated options panel to show/hide custom url fields mentioned above.
|
132 |
+
* Updated admin.js to show/hide checkbox and dropdown extra settings when adding a custom field in Fields.
|
133 |
+
* Updated fields panel to show/hide extra fields mentioned above.
|
134 |
+
* Updated reCAPTCHA to automatically change language if the language is (1) set as WPLANG and (2) used by reCAPTCHA.
|
135 |
+
* Added error checking if Really Simple CAPTCHA is enabled but not installed.
|
136 |
+
* Updated registration function for improved operation when used with popular cache plugins.
|
137 |
+
|
138 |
+
= 2.9.5 =
|
139 |
+
|
140 |
+
* Added support for Really Simple CAPTCHA (Really Simple CAPTCHA must also be installed).
|
141 |
+
* Added support for custom field meta keys as shortcodes in emails.
|
142 |
+
* Added support for default permalinks when using wpmem_logout shortcode.
|
143 |
+
* Improved admin notification email to skip metas defined as excluded meta.
|
144 |
+
* Fixed activation function for activations from user profile omitting passwords (see 2.9.4 bug fix for moderated password registration).
|
145 |
+
|
146 |
+
= 2.9.4 =
|
147 |
+
|
148 |
+
* Bug fix for moderated password registration (changes in 2.9.3 introduced a bug that caused moderated registration to send a blank password).
|
149 |
+
* Bug fix for premium PayPal Subscription extension showing expired users, improved user query.
|
150 |
+
* Fixed user profile update so that wp_update_user is called only once.
|
151 |
+
* Added [wpmem_logged_out] shortcode to show content to logged out users. Same as [wp-members status="out"] shortcode but can be used on blocked content without changing security status.
|
152 |
+
* Removed checkbox for adding password and confirmation fields to the User Screen since these are not stored data.
|
153 |
+
|
154 |
+
= 2.9.3 =
|
155 |
+
|
156 |
+
* Fixed a backend user profile update and create new user issue introduced with some 2.9.2 code improvements. The issue caused the additional fields not to save.
|
157 |
+
* Added a confirm password and confirm email field to the default install, as well as automatic form validation when used.
|
158 |
+
* Updated all functions that store/read user data to skip these fields as there is not need to store them, they are simply form validation fields.
|
159 |
+
* Improved error checking in the admin Fields tab when attempting to add an option name that already exists.
|
160 |
+
* Added separate registration validation for multisite (refers to WP-Members front end registration only). Multisite has different username requirements and the existing error message was valid, the wording did not fit well for multisite making it confusing. The multisite validation returns the WP error message rather than a custom error message. I may be updating other validation messages in the plugin to utilize this method (while allowing them to be filtered for customization).
|
161 |
+
* Added a separate install for multisite.
|
162 |
+
* Updated the template for all localization files (some strings still need translation).
|
163 |
+
|
164 |
+
= 2.9.2 =
|
165 |
+
|
166 |
+
* Added user ID parameter to wpmem_login_redirect filter.
|
167 |
+
* Added new action hooks
|
168 |
+
* Added logout shortcode
|
169 |
+
* Added wpmem_msg_dialog_arr filter
|
170 |
+
* Improvements to registration function
|
171 |
+
* Admin panel updates for smaller screens
|
172 |
+
* Added bulk block/unblock for posts and pages
|
173 |
+
|
174 |
+
= 2.9.1 =
|
175 |
+
|
176 |
+
This is primarily a cleanup and fix update with a few new features.
|
177 |
+
|
178 |
+
* Added WP-Members registration fields to WordPress Users > Add New screen.
|
179 |
+
* Fixed wpmem_test_shortcode error for TOS.
|
180 |
+
* Plugin options tab - lists notify address for notify admin setting
|
181 |
+
* Updated default password change success message - removed need to re-login string.
|
182 |
+
* Make dropdown values in wpmem_create_formfield function translatable strings for localization
|
183 |
+
* Changed "logout" to "log out"
|
184 |
+
* Update to register function to check for unset values for WP native fields.
|
185 |
+
* Moved the path constants to be defined earlier.
|
186 |
+
* Added $action parameter to most of the login form filters, allows more direct filtering based on form state (login, password reset, password change).
|
187 |
+
|
188 |
+
= 2.9.0 =
|
189 |
+
|
190 |
+
This is a major update focusing on upgrades to the form building functions, but also includes a number of other changes and improvements.
|
191 |
+
|
192 |
+
Major updates
|
193 |
+
|
194 |
+
* New form building functions include new hooks and a more customizable form building process.
|
195 |
+
* Form functions moved from wp-members-dialogs.php to new file forms.php
|
196 |
+
* Sidebar login form also rebuilt in the same way the login and register forms were changed.
|
197 |
+
* Legacy (old table based) forms completely removed in 2.9
|
198 |
+
* Updates to error and dialog messages, removed unnecessary html tags
|
199 |
+
|
200 |
+
Changes in wp-members-core.php
|
201 |
+
|
202 |
+
* updated calling of wpmem_test_shortcode, now it works like has_shortcode, put off deprecating at this time.
|
203 |
+
* updated shortcode to include tos page, allow for new tags (wpmem_field, wpmem_logged_in) (added new shortcode calls in wp-members.php), and accept id attribute for fields. Added $tag argument, can use shortcode_atts_{$shortcode} filter
|
204 |
+
* moved wpmem_test_shortcode to utilities.php
|
205 |
+
* added new action hooks: wpmem_pwd_change and wpmem_pwd_reset
|
206 |
+
* added new filter hook: wpmem_regchk
|
207 |
+
|
208 |
+
Changes in wp-members.php
|
209 |
+
|
210 |
+
* a pretty major overhaul of this file. Moved all but four declarations that weren't already in functions into the init function. Only two constants are declared before the function. This initialization comes after the theme is setup, so pre-initilization needs, such as loading pluggable functions can be declared in the theme's functions.php file. Pluggable functions do not need to be loaded only from the wp-members-pluggable.php file.
|
211 |
+
* The file name of the wp-members-pluggable.php file is loaded in a filter hook, wpmem_plugins_file, so you could call it something else or load it from another location.
|
212 |
+
* New action hooks: wpmem_pre_init, wpmem_after_init, wpmem_pre_admin_init, wpmem_after_admin_init
|
213 |
+
* New filter hook: wpmem_settings
|
214 |
+
|
215 |
+
Miscellaneous Changes
|
216 |
+
|
217 |
+
* Updates to the html for some of the admin to better fit the new WP admin layout. Old html was compatible, but the new works better.
|
218 |
+
* Updates to the options tab to better group options
|
219 |
+
* Updates to native (wp-login.php) registration to include require field indication
|
220 |
+
* Review of output, localized a few missed strings
|
221 |
+
* Implementation of changes in localization of field names. English values are now stored in the db (except for custom fields that would be whatever language the user creates the field as). Fields are then translated when displayed, rather than stored as translated strings.
|
222 |
+
* Updated user profile to fix some issues with checkbox and required fields in users.php
|
223 |
+
* Updated user export to include wp_users table fields user_url, user_nicename, and display_name fields
|
224 |
+
* Code cleanup in wpmem_block function
|
225 |
+
* Updated autoexcerpt function
|
226 |
+
* New filter hooks for post editor meta box titles: wpmem_admin_post_meta_title, wpmem_admin_page_meta_title
|
227 |
+
* Some updates to existing stylesheets
|
228 |
+
* Added new stylesheets, including two with non-floated elements. Generic, non-floated stylesheet new default for fresh installs
|
229 |
+
|
230 |
+
= 2.8.10 =
|
231 |
+
|
232 |
+
This is a security update the closes 2 reported XSS vulnerabilities. This update also includes a fix for using SSL with reCAPTCHA.
|
233 |
+
|
234 |
+
= 2.8.9 =
|
235 |
+
|
236 |
+
This is an interim update with some changes that need to get done prior to the 2.9 release. Note: This is the last version that will be compatible with WordPress 3.1. Also, this will be the last version to contain the legacy table based forms. These have been deprecated since version 2.8.0.
|
237 |
+
|
238 |
+
* Added a Twenty Fourteen stylesheet based on the new WP default theme.
|
239 |
+
* Twenty Fourteen installs as the default stylesheet with a new install
|
240 |
+
* User export fix - the new user export functions from 2.8.7 were inadvertenly incompatible with PHP 5.2.4 (WP minimum requirements)
|
241 |
+
* Admin options tab style/layout updates to work better with new WP (3.8) admin theme
|
242 |
+
* Moved the plugin's texurize process into wpmem_securify rather than in the form functions. This is going to happen in 2.9, and doing it as an interim update will allow users to test 2.9 with pluggable functions.
|
243 |
+
* Added the texturize process to the shortcode function for the same reason as above, plus this runs on the User List extension as well.
|
244 |
+
* Made the shortcode function pluggable
|
245 |
+
* Improved the auto excerpt function
|
246 |
+
|
247 |
+
= 2.8.8 =
|
248 |
+
|
249 |
+
* Updated no password reset for non-activated users to use get_user_by('email')
|
250 |
+
* Fixed undefined variable $sendback in users.php
|
251 |
+
* Fixed undefined user object in wpmem_check_activated function
|
252 |
+
* Set a column width for the WP-Members column in the All Posts and All Pages admin panels, load admin.css
|
253 |
+
* Added wpmem_admin_after_block_meta and wpmem_admin_block_meta_save actions
|
254 |
+
|
255 |
+
= 2.8.7 =
|
256 |
+
|
257 |
+
* Upgraded the user export process. Eliminates the need for directly loading an export file as in past versions. This also eliminates the need for wp-load.php.
|
258 |
+
* All user management functions that were in the Users > WP-Members menu are now included under Users > All Users. The Users > WP-Members menu is fully deprecated and removed.
|
259 |
+
* Corrected some undefined variable notices.
|
260 |
+
* New filter for the widget title wpmem_widget_title
|
261 |
+
* Further enhancements to the native WP registration. Even though the plugin was intended to put the registration process into the front end of your WP site, there are always users that either (a) prefer to use the backend native registration or (b) don't read or follow installation and usage instructions. So in an earlier version, I went ahead and added the WP-Members custom fields to the backend registration if it is turned on. This version finishes that process with proper support for dropdown select fields, checkboxes, and text area fields. It also cleans up the error checking and CSS styling for that process.
|
262 |
+
|
263 |
+
= 2.8.6 =
|
264 |
+
|
265 |
+
* Continued updating the stylesheets, this update includes some minor changes to 2010, 2011, 2012, and 2013 to clean up the .noinput class (used in the User Profile update) and the reCAPTCHA area.
|
266 |
+
* Added responsive elements to the Twenty Twelve stylesheet (remains the plugin's default)
|
267 |
+
* Changed from PHP_SELF to REQUEST_URI for elements where the plugin forms need to post back to themselves and no other URL exists
|
268 |
+
* Changed from "siteurl" to "home" for getting the home page link - corrects problems for users who have WP installed in a different directory
|
269 |
+
|
270 |
+
= 2.8.5 =
|
271 |
+
|
272 |
+
* Improved the Twenty Eleven and Twenty Twelve stylesheets (Twenty Twelve remains the plugin default).
|
273 |
+
* Added a responsive stylesheet based on Twenty Thirteen theme.
|
274 |
+
* Added a new filter hook for password reset args wpmem_pwdreset_args. This will allow mods for single stage reset (username only or email only).
|
275 |
+
* Corrected update_user_meta during registration use the filtered value of the user's IP and registration URL.
|
276 |
+
|
277 |
+
= 2.8.4 =
|
278 |
+
|
279 |
+
* Fixed a small bug on admin-side user profile that caused checkboxes to not update correctly
|
280 |
+
* Added optional small "powered by" attribution link at the bottom of the registration form.
|
281 |
+
|
282 |
+
= 2.8.3 =
|
283 |
+
|
284 |
+
Feature Updates
|
285 |
+
|
286 |
+
* Allows native fields display_name, nicename, and nickname to be removed from the field manager.
|
287 |
+
* New filter wpmem_logout_link filters all logout links.
|
288 |
+
* Added default registration via wp-login page (backend). This of course can be disabled by unchecking "anyone can register" in the WP settings.
|
289 |
+
* Completion of user admin panel implementation. Added screens for non-active and non-exported users.
|
290 |
+
* Added a custom column to page/post tables to indicate if a post/page is blocked/unblocked opposite the chosen default setting.
|
291 |
+
|
292 |
+
Fixes
|
293 |
+
|
294 |
+
* Fixed bug in admin/post.php that caused an error due a typo in the selected capability.
|
295 |
+
* Applied the patch for the users table custom columns that didn't return non-WP-Members custom column values.
|
296 |
+
* Fixed the use of the nonce constant to check if the constant is defined.
|
297 |
+
* Applied patch to the utilities file that left some debugging code artifacts in the 2.8.2 release.
|
298 |
+
|
299 |
+
Improvements
|
300 |
+
|
301 |
+
* Updated dashboard widget to either superadmin or not display for multisite.
|
302 |
+
* Added a div tag to the "Required Field" text in the registration form - NOTE: if you run any filters on the registration form, you may need to test them and update accordingly.
|
303 |
+
* Updated the included stylesheets for the addition of req-text class for the "Required Field" text in the registration form.
|
304 |
+
* Added Portugese translation files (Thanks Joana!)
|
305 |
+
|
306 |
+
= 2.8.2 =
|
307 |
+
|
308 |
+
Feature Updates
|
309 |
+
|
310 |
+
* Added WP user fields user_nicename, display_name, and nickname to the $fields array, defaults to $username for backward compatibility.
|
311 |
+
* Updated field manager process to allow user_nicename, display_name, and nickname to be added via the fields manager as WP native fields
|
312 |
+
* Added wpmem_register_data filter for $fields to allow filtering of all fields prior to new user insertion, including above new fields (added updates to registration function to make better use of the filter).
|
313 |
+
* Added wpmem_pre_validate_form for $fields to allow filtering fields prior to default form field validation.
|
314 |
+
* Begin implementation of moving bulk user management features into Users > All Users. Users > All Users screen can now activate and export users, and will show additional fields as selected in the fields manager.
|
315 |
+
* Added wpmem_admin_profile_heading, wpmem_admin_profile_field, and wpmem_admin_profile_update filters. These filters are all part of the user profile section.
|
316 |
+
|
317 |
+
Fixes, Patches, & Code Improvements
|
318 |
+
|
319 |
+
* Fixed the conversion of update-profile to members-area shortcode. The bug renders all page shortcodes as members-area.
|
320 |
+
* Fixed the activate user process for user defined passwords, a bug from 2.8.0/2.8.1.
|
321 |
+
* Fixed a bug that can cause the sidebar login widget to not post to the correct url when a static front page is used.
|
322 |
+
* Fixed user profile update (updates with custom checkbox don't stay checked), an issue from 2.8.0.
|
323 |
+
* Patch correcting the front-side registration form nonce. This patch should improve reliability while still using nonces for security.
|
324 |
+
* Patch for the dropdown field for users running < PHP 5.3.
|
325 |
+
* Made front-side nonce optional, defaults to off.
|
326 |
+
* Moved utility functions out of core.php to utility file utilities.php.
|
327 |
+
* Moved the location of the wpmem_email_notify hook so the filter comes after shortcodes are parsed.
|
328 |
+
* Updated the registration function to rely on the values contain in $fields, allowing for the array values to be filtered.
|
329 |
+
* Updated the registration form to accommodate registration function updates.
|
330 |
+
* Improved auto excerpt function screens for unclosed common html tags and provides a closing tag if none exists.
|
331 |
+
* Improved export process to wrap fields with double quotes - fixes issues if field contains a comma.
|
332 |
+
|
333 |
+
= 2.8.1 =
|
334 |
+
|
335 |
+
Security update release: 2.8.1 primarily closes some potential security holes. This update is highly recommended.
|
336 |
+
|
337 |
+
Security Updates:
|
338 |
+
|
339 |
+
* Closed potential cross site scripting exploit
|
340 |
+
* Added nonces to front-side registration
|
341 |
+
* Updated nonces in admin form submission
|
342 |
+
* Security evaluation and updates to other areas
|
343 |
+
|
344 |
+
Feature Updates:
|
345 |
+
|
346 |
+
* Added dropdown option for User Profile (members-area) and Register page location
|
347 |
+
* Updated dropdown field to accommodate commas in the values (ex: 1,000)
|
348 |
+
|
349 |
+
Other Updates:
|
350 |
+
|
351 |
+
* Updated TOS shortcode to be case-insensitive for the shortcode parameter (TOS/tos)
|
352 |
+
* Begin deprecating members-area parameter to be replaced with user-profile
|
353 |
+
* Separated User Profile functions from wp-members-core.php file
|
354 |
+
* Applied post 2.8.0 patches and corrected missing files
|
355 |
+
|
356 |
+
= 2.8.0 =
|
357 |
+
|
358 |
+
New Feature release: 2.8.0 offers the beginning of a major rebuild of the admin panels with a few front-side features slipped in along the way.
|
359 |
+
|
360 |
+
Security Improvements:
|
361 |
+
|
362 |
+
* Added a dummy index.php file in all plugin directories. This is a security improvement and disallows direct access to a directory (in case your server allows directory browsing).
|
363 |
+
|
364 |
+
Code Improvements:
|
365 |
+
|
366 |
+
* Added new constants WPMEM_DIR and WPMEM_PATH. This will allow you to grab the directory of the plugin directly in action and filter functions.
|
367 |
+
* Broke up the admin file wp-members-admin.php into multiple files based on function. These are all now moved into an /admin/ directory.
|
368 |
+
* Added the password field to the fields array in the registration function so that this can be used in the registration hooks and filters.
|
369 |
+
* Updated the logout process to use wp_clear_auth_cookie. The previous wp_clearcookie was deprecated and was causing header errors in some instances.
|
370 |
+
* Improved the TOS shortcode. This should eliminate some of the parsing errors some users experienced in previous releases.
|
371 |
+
|
372 |
+
Admin Panel Updates:
|
373 |
+
|
374 |
+
* New admin look updates the tabs to the WP format. This also was built to allow extensible tabs so you can hook in and create your own tabs and panels.
|
375 |
+
* Add field dialog was updated and improved.
|
376 |
+
* Added an admin process to edit existing fields.
|
377 |
+
* Added new option in the plugin options to load one of the predefined stylesheets from a dropdown.
|
378 |
+
* Block/Unblock post meta box added to the post/page editor – no need to use custom fields anymore (this feature actually updates the custom fields accordingly, so you can use custom fields if you want to).
|
379 |
+
* Added dropdown selector for preloaded stylesheets - no need to enter the location of the preloaded stylesheets to use them.
|
380 |
+
|
381 |
+
New Filters:
|
382 |
+
|
383 |
+
* wpmem_admin_tabs - allows developers to hook into the admin tabs to add additional tabs.
|
384 |
+
* wpmem_admin_style_list - allows developers to hook into the dropdown list of stylesheets to add additional stylesheets.
|
385 |
+
* wpmem_auto_excerpt - filters the automatically generated excerpt. Allows you to customize a 'read more' link.
|
386 |
+
* wpmem_post_password - filters the automatically generated post password that blocks comments on blocked posts/pages.
|
387 |
+
* wpmem_forgot_link - filters the forgot password link that shows in the login forms.
|
388 |
+
* wpmem_reg_link - filters the register link that shows in the login forms.
|
389 |
+
|
390 |
+
Other Updates:
|
391 |
+
|
392 |
+
* Added a new pre-loaded stylesheet for Twenty Twelve theme. New installs will default to this style. Note: with the addition of the new style selector in the admin panel, you can easily toggle between the preloaded stylesheets. You can also add your own using the new wpmem_admin_style_list filter, enter the URL location in the Custom Stylesheet field, or load one using wp_enqueue_scripts.
|
393 |
+
|
394 |
+
= 2.7.7 =
|
395 |
+
|
396 |
+
New Features:
|
397 |
+
|
398 |
+
* Added a new filter hook wpmem_securify. This hook applies a filter to the $content variable at the end of the wpmem_securify function. The primary reason for this hook is to be able to run filters on $content that would give you the ability to block content even if the user is logged in (the wpmem_block filter only works for non-logged in state). This will bring in the ability to block users from content based on defined criteria such as content is for members of "group A" but the user is does not have access to "group A" content.
|
399 |
+
* Added wpmem_email_headers filter hook. This will allow you to easily filter the headers for the email process of the plugin giving you the ability to send HTML email without modifying the plugin.
|
400 |
+
* Added wpmem_user_activated action hook. This hook will give you the ability to run actions at the end of user activation. For sites that moderate registration, this gives you the ability to hook in actions that you might not want to do before approval of the registration (such as would normally be done with wpmem_post_register_data).
|
401 |
+
* Added new shortcode for creating a user list/member directory. __This shortcode requires installation of the premium add-on module WP-Members User List [available to rocketgeek.com members](http://rocketgeek.com/about/site-membership-subscription/)__. The shortcode has parameters for including a member search function as well as filter hooks for filtering the layout of the directory elements.
|
402 |
+
* Added new shortcode for protecting inline content with the __premium add-on module WP-Members PayPal Subscription [available to rocketgeek.com members](http://rocketgeek.com/about/site-membership-subscription/)__.
|
403 |
+
|
404 |
+
Bug Fix:
|
405 |
+
|
406 |
+
* Fixed a bug where the reCAPTCHA error messages do not display on the [shortcode pages "register" and "members-area"](http://rocketgeek.com/plugins/wp-members/users-guide/shortcodes/page-shortcodes/).
|
407 |
+
|
408 |
+
Code Improvement:
|
409 |
+
|
410 |
+
* Completed a rebuild of the login function wpmem_login. Updated the cookie process to switch from [wp_setcookie](http://codex.wordpress.org/Function_Reference/wp_setcookie) (which is deprecated) to [wp_set_auth_cookie](http://codex.wordpress.org/Function_Reference/wp_set_auth_cookie). Also, the [wpmem_login_redirect hook](http://rocketgeek.com/plugins/wp-members/users-guide/filter-hooks/wpmem_login_redirect/) was moved to after the login credentials have been validated and the user is logged in. This allows the hook to access user data without the need to validate the user within the filter.
|
411 |
+
|
412 |
+
= 2.7.6 =
|
413 |
+
|
414 |
+
This release has some new features and some code updates
|
415 |
+
|
416 |
+
* Added ability to use same redirect_to querystring that WP uses in the wp-login form. This allows more seamless replacement of the wp-login.
|
417 |
+
* Added a new page shortcode for password reset/change [wp-members page="password"]. If the user is logged out, it works the reset forgotten password functionality. If the user is logged in, it will offer the change password functionality. These functions do also remain in the members-area page shortcode as well, but now can be placed in a stand-alone location as well.
|
418 |
+
* Added a new page shortcode for the user edit page [wp-members page="user-edit"]. This needs to be used if the user is logged in and can be used with the login status shortcode.
|
419 |
+
* Removed $content global from the page shortcode function. This should correct the double form issue when used with plugins/themes that filter $content.
|
420 |
+
* Added do_shortcode to the page shortcode call. This should allow the page shortcodes to be used in conjuction with other shortcodes on the page (although this is not necessarily recommended).
|
421 |
+
* Added translations for Russian, Slovak, and Hindi.
|
422 |
+
* Moved _OLD forms to wp-members-deprecated.php. These forms can still be used, but will be deprecated in a future version. It is highly recommended that users still using legacy forms begin converting to the _NEW forms.
|
423 |
+
|
424 |
+
= 2.7.5 =
|
425 |
+
|
426 |
+
This is a new feature release (see [release announcement](http://wp.me/p1zYcs-xf) for full details.)
|
427 |
+
|
428 |
+
* Added 5 new filter hooks
|
429 |
+
* Final deprecation of the old style shortcodes for special pages (<!--members-area-->, <!--reg-area-->). If you are using these you need simply need to update to the modern shortcodes such as [wp-members page="members-area"]
|
430 |
+
* Added a check for the error message variable immediately following the wpmem_pre_register_data and wpmem_pre_update_data action hooks. This will allow for use of these hooks to include your own custom validation and still be able to return a relevant error message.
|
431 |
+
* Added a check to see if the TOS field is not being used and thus don't display it on the User Profile for the admin.
|
432 |
+
* Fixed a bug that showed the incorrect heading on the User Edit page when there is an empty field error.
|
433 |
+
* Added completely updated .pot file for translations
|
434 |
+
* Updated all .po/.mo translation files from the new .pot (still need some strings translated for some languages).
|
435 |
+
* Added all .po/.mo files to the download package.
|
436 |
+
|
437 |
+
= 2.7.4 =
|
438 |
+
|
439 |
+
This is a new feature release (see [release announcement](http://wp.me/p1zYcs-wQ) for full details.)
|
440 |
+
|
441 |
+
* Added 14 new filter hooks
|
442 |
+
* Added full user export function
|
443 |
+
* Force email in password reset to be non-case sensitive (changes to wpmem_reset_password in wp-members-core.php)
|
444 |
+
* Changed "Existing users Login" to "Existing Users Login" in wpmem_inc_login in wp-members-dialogs.php
|
445 |
+
|
446 |
+
= 2.7.3 =
|
447 |
+
|
448 |
+
This is a code improvement release (see [release announcement](http://wp.me/p1zYcs-wD) for full details.)
|
449 |
+
|
450 |
+
* Improved a number of functions in various files for improved functionality.
|
451 |
+
* Added p tag with class .noinput to the username field when updating profile, added property definition to the stylesheet as well to better align the username.
|
452 |
+
* Added css property to better align checkboxes in the reg form (a change to wp-members.css).
|
453 |
+
* Added a class to captcha, and a cooresponding css property in wp-members.css for top/bottom margin of captcha form.
|
454 |
+
|
455 |
+
New features (shortcodes and hooks):
|
456 |
+
|
457 |
+
* Added 'field' shortcode for displaying user data with a shortcode - currently considered experimental and subject to changes.
|
458 |
+
* Added wpmem_restricted_msg filter hook to filter the restricted post message.
|
459 |
+
* Added wpmem_login_failed filter hook to filter the login failed message (includes filtering display markup).
|
460 |
+
* Added wpmem_login_failed_sb filter hook to filter the login failed message in the sidebar (filters message only, not formatting).
|
461 |
+
|
462 |
+
= 2.7.2 =
|
463 |
+
|
464 |
+
This is primarily a bug fix release (see [release announcement](http://wp.me/p1zYcs-vW) for full details.)
|
465 |
+
|
466 |
+
* Fixed a bug where, when using moderated registration, updating a user's backend profile deactivates the user.
|
467 |
+
* Improved the login error message for login via wp-login.php.
|
468 |
+
* Added wpmem_pre_register_data action hook.
|
469 |
+
* Added wpmem_post_register_data action hook.
|
470 |
+
* Added wpmem_pre_update_data action hook.
|
471 |
+
* Added wpmem_post_update_data action hook.
|
472 |
+
|
473 |
+
= 2.7.1 =
|
474 |
+
|
475 |
+
This release contains some new features that didn't get completed for 2.7.0 and some fixes (see [release announcement](http://wp.me/p1zYcs-vq) for full details.)
|
476 |
+
|
477 |
+
New features:
|
478 |
+
|
479 |
+
* Deactivate/reactivate users
|
480 |
+
* Registration moderation added for user defined passwords
|
481 |
+
* Include an optional stylesheet based on TwentyEleven Theme
|
482 |
+
* Include an optional stylesheet based on Kubrick (for narrower content areas)
|
483 |
+
* Added wpmem_register_redirect action hook
|
484 |
+
* Added wpmem_login_redirect filter hook
|
485 |
+
* Added wpmem_logout_redirect filter hook
|
486 |
+
* Added wpmem_sidebar_status filter hook
|
487 |
+
* Added wpmem_register_links filter hook
|
488 |
+
* Added wpmem_member_links filter hook
|
489 |
+
* Added wpmem_login_links filter hook
|
490 |
+
|
491 |
+
|
492 |
+
Fixes:
|
493 |
+
|
494 |
+
* rebuilt default email install function
|
495 |
+
* skip password in [fields] shortcode (changes in wpmem_notify_admin)
|
496 |
+
* fixed widget sidebar div tag (changes in class widget_wpmemwidget)
|
497 |
+
* fixed form field validation for invalid email still registered user (changes in wpmem_registration)
|
498 |
+
* fixed rememberme in login process (changes in wpmem_login)
|
499 |
+
* moved send from filters to just the wp-members email processes (changes in wpmem_inc_regemail && wpmem_notify_admin)
|
500 |
+
|
501 |
+
|
502 |
+
= 2.7.0 =
|
503 |
+
|
504 |
+
This is new feature release with the following features and improvements (see :
|
505 |
+
|
506 |
+
* Email messages can be customized via the plugin admin panel.
|
507 |
+
* Dropdown fields can be added via the field managment panel.
|
508 |
+
* Moved location of pluggable file load so that constants may be used without loading twice.
|
509 |
+
* Registration stores the url the user registered on for all registrations, not just if registration is moderated.
|
510 |
+
* Trim trailing whitespace on members area, register, and custom css urls.
|
511 |
+
* Added wp_specialchars_decode to blogname in emails to decode any special characters (such as &) in the title.
|
512 |
+
* Registration function is now pluggable.
|
513 |
+
* Updated sidebar widget to be multi-widget compatible.
|
514 |
+
* TOS can be stored in dialogs OR be a WP page (set in dialogs with a shortcode).
|
515 |
+
* Plugin can be set up for users to select their own passwords at registration (cannot be used with moderated registration).
|
516 |
+
|
517 |
+
= 2.6.6 =
|
518 |
+
Bug fix release
|
519 |
+
|
520 |
+
* Fixes as bug where admin side user fields are cleared when a user updates their registration info.
|
521 |
+
|
522 |
+
= 2.6.5 =
|
523 |
+
|
524 |
+
* Rewrite of the reCAPTCHA script to address IE compatibility issues.
|
525 |
+
* Expansion of the wptexturize fix in 2.6.4, now wraps all of the login and registration forms.
|
526 |
+
* Fix for the user profile edit so that the admin can see his own additional fields
|
527 |
+
* Fix so users can edit additional fields through the user profile page.
|
528 |
+
* WPMEM_REGURL no longer sent to wpmem_chk_qstr as it is a direct URL.
|
529 |
+
|
530 |
+
= 2.6.4 =
|
531 |
+
Bug fix release with the following changes:
|
532 |
+
|
533 |
+
* Fixes the activate user bug, rolling back from wp_update_user to $wpdb->update.
|
534 |
+
* Added back wpmem_generatePassword (although this is no longer used, a lot of users are still using this in the comments template.
|
535 |
+
* Added an override in the login form for the wptexturize function so as to remove the <br> tag that WP puts into the generated form.
|
536 |
+
|
537 |
+
= 2.6.3 =
|
538 |
+
This is primarily a code improvement release
|
539 |
+
|
540 |
+
* Localized "Clear Form" and "Submit" buttons for translation
|
541 |
+
* Updated reCAPTCHA noscript (for loading when the browser has js turned off)
|
542 |
+
* Fixed front-end error messages that did not have stripslashes
|
543 |
+
* Updated bulk user management to paginate users when displaying all users
|
544 |
+
* Introduced dropdown support (must be added programmatically at this time)
|
545 |
+
* Cleaned up unused globals from the registration forms
|
546 |
+
* Updated the location of the pluggable function file to be outside the plugin folder
|
547 |
+
|
548 |
+
= 2.6.2 =
|
549 |
+
This is a bug fix release with some additional improvements.
|
550 |
+
|
551 |
+
Bug fixes
|
552 |
+
|
553 |
+
* Fixed checkbox that is set to be checked by default remains checked in the update user settings front end even if the user unchecked it.
|
554 |
+
* Fixed legacy form password reset bug
|
555 |
+
|
556 |
+
Improvements
|
557 |
+
|
558 |
+
* Registration fields that are not selected to be displayed on the front end will still display on the admin side and be exported. This provides fields that can be used by the admin only for additional user information.
|
559 |
+
* Checkbox field can be edited in the Manage Fields panel to be checked by default or not.
|
560 |
+
* Keep the active tab active when editing various plugin settings.
|
561 |
+
|
562 |
+
= 2.6.1 =
|
563 |
+
Bug fix release
|
564 |
+
|
565 |
+
* Corrected the settings link in the WP installed plugins panel.
|
566 |
+
* Fixed the view menu links for the bulk user management.
|
567 |
+
* Fixed ignore warning messages on the WP-Members settings.
|
568 |
+
* Fixed bulk activate users so already activated users would not be inadvertently reactivated.
|
569 |
+
* Deactivated auto-excerpt function (was not to be activated in 2.6 production version).
|
570 |
+
|
571 |
+
= 2.6.0 =
|
572 |
+
This version is a feature release that also includes some rebuilt functions and other code improvements.
|
573 |
+
|
574 |
+
New Features:
|
575 |
+
|
576 |
+
* Front-end now uses enqueue_style to load CSS, so advanced users can directly load their own styles for the plugin without using the plugin settings.
|
577 |
+
* Improved use of shortcodes. Old-style HTML comment shortcodes will continue to work in certain instances, but will no longer be supported in future versions. Upgrade to the new shortcodes. Major rewrite of the way WP-Members handles the_content() so that it will return a value rather than echo it. Working to better integrate with other shortcodes so they are propery parsed. New WP-Members shortcodes will added in future versions.
|
578 |
+
* Registration fields can now be customized via the admin panel. This includes adding new fields and deleting non-native fields, and also changing the field order.
|
579 |
+
|
580 |
+
Code Improvements
|
581 |
+
|
582 |
+
* eliminated unused globals
|
583 |
+
* updated certain functions to use more up-to-date native WP functions.
|
584 |
+
* core now checks to see if the action variable 'a' is set before requesting it.
|
585 |
+
* wpmem_securify now scans for 'more' tag so that it will not truncate if the work "more" exists in the excerpt.
|
586 |
+
* updated email validation/error message to registration process to use is_email().
|
587 |
+
|
588 |
+
= 2.5.4 =
|
589 |
+
This is a bug fix release. 2.5.3 introduced a bug where the random password sent to a new user was invalid. While the fix is simple, the nature of the bug related to the functionality of the plugin dictates a full update so that users unaware of the bug will be notified via their WP admin panel.
|
590 |
+
|
591 |
+
= 2.5.3 =
|
592 |
+
This is primarily a bug fix release.
|
593 |
+
|
594 |
+
Bug fixes:
|
595 |
+
|
596 |
+
* Fixed reCAPTCHA from trying to validate on the User Edit page even though reCAPTCHA is not used on this page.
|
597 |
+
* Added validation to change password page to not allow double empty fields.
|
598 |
+
* Added additional username validation to prevent invalid (non-alphanumeric) characters in the username.
|
599 |
+
* Fixed comments reply link which did not allow a registered user to reply on an unblocked page/post.
|
600 |
+
|
601 |
+
Other changes:
|
602 |
+
|
603 |
+
* Rebuild of registration function
|
604 |
+
* Review of comments process
|
605 |
+
* Added stripslashes to front-end user registration validation
|
606 |
+
|
607 |
+
= 2.5.2 =
|
608 |
+
This is predominately a release of fixes and improvements:
|
609 |
+
|
610 |
+
* Fixed the admin menus so that the user menu isn't open by default.
|
611 |
+
* Fixed the "ignore warning messages" that was broken in 2.5.1.
|
612 |
+
* Corrected the CAPTCHA to not show up on members settings update.
|
613 |
+
* Plugin checks to see if the reCAPTCHA library is already loaded to be compatible with other reCAPTCHA plugins.
|
614 |
+
* Fixed activate user function for bulk activation - checks to see if the user is already activated and if so, skips that user so we don't accidentally activate users that are already activated in bulk mode, thus resetting their passwords.
|
615 |
+
* Updated login process to use wp_signon (wp_login is deprecated).
|
616 |
+
* Updated sidebar widget include a new css class #wp-members .err for login error message
|
617 |
+
* Updated sidebar widget to use the appropriate `<li>` tag into the sidebar area. This should only be a factor for users that customized css. In this case, you'll need to update your stylesheet for ID #wpmem_login_side to #wp-members.
|
618 |
+
* Updated the sidebar login to better direct the user upon successful login (previously working fine on individual posts and pages, but not on categories).
|
619 |
+
* *Strictly Experimental* - Introducing pluggable functions - laying the ground work, won't be official yet, so some functions may be deprecated and/or modified.
|
620 |
+
|
621 |
+
= 2.5.1 =
|
622 |
+
Exanding on the features added in 2.5.0, this release adds setting for the register page, new tableless forms, and custom CSS
|
623 |
+
|
624 |
+
New Features
|
625 |
+
|
626 |
+
* Changed the "turn off registration" feature to allow for a registration page
|
627 |
+
* Specify registration page location (so we can have a register link in the login form)
|
628 |
+
* New tableless forms, can still toggle legacy forms
|
629 |
+
* Specify custom CSS for tableless forms
|
630 |
+
|
631 |
+
Fixes and Code Improvements
|
632 |
+
|
633 |
+
* Removed focus call in the reCAPTCHA that put the cursor focus immediately on the CAPTCHA
|
634 |
+
* Updated to wp_enqueue_script & _style for admin css and ajax.
|
635 |
+
* Fixed some typos.
|
636 |
+
* Fixed some security issues.
|
637 |
+
|
638 |
+
= 2.5.0 =
|
639 |
+
WP-Members™ 2.5 is essentially a pre-3.0 release and extention of the 2.4 release, which was only released as a public beta. In addition to the list below, see the list of features, improvements, and fixes for 2.4.0.
|
640 |
+
|
641 |
+
New Features
|
642 |
+
|
643 |
+
* added shortcode support for login only page
|
644 |
+
* added support for checkboxes in the registration fields
|
645 |
+
* added setting for members area/settings page url (so we can have "forgot password" link anywhere)
|
646 |
+
* added a "change your password" link in the email if members area/settings page url is set
|
647 |
+
|
648 |
+
Bug Fixes
|
649 |
+
|
650 |
+
* corrected a bug introduced in the 2.3.x widget update that caused the widget to be undraggable in certain instances
|
651 |
+
|
652 |
+
= 2.4.0 =
|
653 |
+
This was never a full production release, but was released as a public beta. The production completion of this project was 2.5
|
654 |
+
|
655 |
+
New Features
|
656 |
+
|
657 |
+
* added reCAPTCHA support for registration
|
658 |
+
* added Terms of Service (TOS) checkbox and popup
|
659 |
+
* added shortcode support for members area and register pages
|
660 |
+
* added custom user management panel for bulk user edits
|
661 |
+
* added user list export
|
662 |
+
* localization support (beginning)
|
663 |
+
* contextual help in admin panels (beginning)
|
664 |
+
|
665 |
+
Code Improvements
|
666 |
+
|
667 |
+
* updated the registration process so that unused fields are not put into the user_meta table
|
668 |
+
* updated emails for moderated registration to send user the url they signed up on
|
669 |
+
* capture user's IP address at registration
|
670 |
+
* sets logged in admin as activated (prevents admin from accidentally being locked out)
|
671 |
+
* added toggle to force clean install of settings
|
672 |
+
* improvements to uninstall process
|
673 |
+
|
674 |
+
Bug Fixes
|
675 |
+
|
676 |
+
* added stripslashes to dialogs (accommodates the use of apostrophes/quotation marks)
|
677 |
+
* fixed sidebar login for non-widget use (bug from 2.3.x)
|
678 |
+
|
679 |
+
= 2.3.2 =
|
680 |
+
Bug Fix Release
|
681 |
+
|
682 |
+
* fixed login failed message for sidebar widget
|
683 |
+
* fixed login failed message for members area page
|
684 |
+
* fixed email to include user_url field properly
|
685 |
+
* changed cell alignment for 'textarea' field type in reg form
|
686 |
+
|
687 |
+
= 2.3.1 =
|
688 |
+
Code Improvements
|
689 |
+
|
690 |
+
* updated deprecated call get_usermeta to get_user_meta, update_usermeta to update_user_meta
|
691 |
+
* completed update of deprecated call get_settings changed to get_option
|
692 |
+
* removed deprecated functions wpmem_register() and wpmem_update(), both of these are now handled by wpmem_registration
|
693 |
+
* $redirect_to in wpmem_login changed to $_POST
|
694 |
+
* fixed password reset link issue
|
695 |
+
* changed wp-members-admin.php to load for 'edit_users' capabilities, down from 'manage_options'.
|
696 |
+
* changes to admin form posts for use with WP Multisite (still need additional testing with Multisite for full compatibility)
|
697 |
+
|
698 |
+
New Features
|
699 |
+
|
700 |
+
* added direct link to edit user in notify admin email
|
701 |
+
* added optional registration page
|
702 |
+
|
703 |
+
= 2.3.0 =
|
704 |
+
Adds a number of features put off from the 2.2 release
|
705 |
+
|
706 |
+
* option to notify admin of new user registrations
|
707 |
+
* option to hold new registrations for admin approval
|
708 |
+
* option to turn registration off (for admins that want to control registrations in some other way)
|
709 |
+
* option to show excerpt on pages/posts
|
710 |
+
* updated widget calls to wp_register_sidebar_ (register_sidebar_ is deprecated)
|
711 |
+
* updated certain API calls known to be deprecated
|
712 |
+
* broke out email related functions to separate file; only loads when needed
|
713 |
+
* broke out core and dialog functions to separate files
|
714 |
+
|
715 |
+
= 2.2.2 =
|
716 |
+
This release is all code-side cleanup to make the plugin more efficient:
|
717 |
+
|
718 |
+
* Rewrote _securify function to remove redundancies
|
719 |
+
* Merged Login, Password Change, and Password Reset forms into _login_form
|
720 |
+
* Added uninstall/delete process to empty settings from database on plugin deletion
|
721 |
+
* Broke out install and admin scripts to separate file only loaded when needed
|
722 |
+
* Continued improvement of admin functions
|
723 |
+
|
724 |
+
= 2.2.1 =
|
725 |
+
* Change password bug fix
|
726 |
+
* Merged registration and user update functions to eliminate redundancy
|
727 |
+
* Added nonce security to the options admin
|
728 |
+
|
729 |
+
= 2.2.0 =
|
730 |
+
The #1 request with the plugin is to simply be able to change the required fields. I have greatly simplified the process so it can be managed from within the WP admin panel. Additionally, I added the ability to determine what fields will show in the registration form (both native WP fields, and additional WP-Members™ fields). Also, the error/dialog messages can now be managed from with the admin panel as well.
|
731 |
+
|
732 |
+
* Added new customization features and an admin panel
|
733 |
+
* Can set fields that will display
|
734 |
+
* Can set fields to be required
|
735 |
+
* Can manage error/dialog messages from admin
|
736 |
+
|
737 |
+
= 2.1.2 =
|
738 |
+
* Added fix to set new registrations as the default role
|
739 |
+
|
740 |
+
= 2.1.1 =
|
741 |
+
* Udates for the 2.1.0 release that were not completed.
|
742 |
+
* updated variables for some function calls.
|
743 |
+
* eliminated unnecessary $table_prefix globals.
|
744 |
+
* updated some queries to better utilize the $wpdb class.
|
745 |
+
* custom fields admin is now managed as an array (cuts the lines of code by 75%, and makes way for user defined custom fields).
|
css/generic-no-float.css
CHANGED
@@ -31,7 +31,8 @@ see http://rocketgeek.com/tips-and-tricks/load-a-custom-stylesheet/
|
|
31 |
|
32 |
/* Error and Dialog Messages */
|
33 |
|
34 |
-
#wpmem_msg,
|
|
|
35 |
background: #F9F9F9;
|
36 |
border:1px solid lightGrey;
|
37 |
border-radius: 3px;
|
@@ -78,7 +79,8 @@ see http://rocketgeek.com/tips-and-tricks/load-a-custom-stylesheet/
|
|
78 |
|
79 |
|
80 |
/* Login Form and Registration Form */
|
81 |
-
#wpmem_reg,
|
|
|
82 |
color: rgb(43, 43, 43);
|
83 |
font-family: Arial,sans-serif;
|
84 |
font-size: 16px;
|
@@ -87,6 +89,9 @@ see http://rocketgeek.com/tips-and-tricks/load-a-custom-stylesheet/
|
|
87 |
}
|
88 |
|
89 |
#wpmem_reg input[type="text"],
|
|
|
|
|
|
|
90 |
#wpmem_reg textarea,
|
91 |
#wpmem_login input[type="text"],
|
92 |
#wpmem_login input[type="password"] {
|
@@ -126,30 +131,44 @@ see http://rocketgeek.com/tips-and-tricks/load-a-custom-stylesheet/
|
|
126 |
margin: 5px 0;
|
127 |
}
|
128 |
|
129 |
-
#wpmem_reg fieldset,
|
|
|
130 |
border: none;
|
131 |
padding: 0;
|
132 |
margin: 40px 0;
|
133 |
}
|
134 |
-
#wpmem_reg legend,
|
|
|
135 |
font-size: 24px;
|
136 |
line-height: 1;
|
137 |
font-weight: 700;
|
138 |
margin-bottom: 10px;
|
139 |
}
|
140 |
-
#wpmem_reg .form,
|
|
|
141 |
margin:0;
|
142 |
padding:0;
|
143 |
}
|
144 |
-
#wpmem_reg .clear,
|
|
|
145 |
clear:both;
|
146 |
}
|
147 |
-
#wpmem_reg .holder,
|
|
|
148 |
background-color:#fff;
|
149 |
}
|
150 |
-
|
151 |
-
#
|
152 |
-
#wpmem_reg .
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
153 |
width:74%;
|
154 |
margin:0 0 14px 0;
|
155 |
}
|
@@ -157,9 +176,14 @@ see http://rocketgeek.com/tips-and-tricks/load-a-custom-stylesheet/
|
|
157 |
margin: 12px 2px;
|
158 |
}
|
159 |
#wpmem_reg .div_textarea textarea,
|
160 |
-
#wpmem_reg .textbox,
|
161 |
-
#
|
162 |
-
#wpmem_reg .
|
|
|
|
|
|
|
|
|
|
|
163 |
width:100%;
|
164 |
}
|
165 |
|
@@ -208,7 +232,7 @@ see http://rocketgeek.com/tips-and-tricks/load-a-custom-stylesheet/
|
|
208 |
|
209 |
#wpmem_reg .button_div, #wpmem_login .button_div {
|
210 |
width:74%;
|
211 |
-
height:
|
212 |
padding: 6px 0;
|
213 |
text-align: right;
|
214 |
}
|
31 |
|
32 |
/* Error and Dialog Messages */
|
33 |
|
34 |
+
#wpmem_msg,
|
35 |
+
.wpmem_msg {
|
36 |
background: #F9F9F9;
|
37 |
border:1px solid lightGrey;
|
38 |
border-radius: 3px;
|
79 |
|
80 |
|
81 |
/* Login Form and Registration Form */
|
82 |
+
#wpmem_reg,
|
83 |
+
#wpmem_login {
|
84 |
color: rgb(43, 43, 43);
|
85 |
font-family: Arial,sans-serif;
|
86 |
font-size: 16px;
|
89 |
}
|
90 |
|
91 |
#wpmem_reg input[type="text"],
|
92 |
+
#wpmem_reg input[type="password"],
|
93 |
+
#wpmem_reg input[type="email"],
|
94 |
+
#wpmem_reg input[type="url"],
|
95 |
#wpmem_reg textarea,
|
96 |
#wpmem_login input[type="text"],
|
97 |
#wpmem_login input[type="password"] {
|
131 |
margin: 5px 0;
|
132 |
}
|
133 |
|
134 |
+
#wpmem_reg fieldset,
|
135 |
+
#wpmem_login fieldset {
|
136 |
border: none;
|
137 |
padding: 0;
|
138 |
margin: 40px 0;
|
139 |
}
|
140 |
+
#wpmem_reg legend,
|
141 |
+
#wpmem_login legend {
|
142 |
font-size: 24px;
|
143 |
line-height: 1;
|
144 |
font-weight: 700;
|
145 |
margin-bottom: 10px;
|
146 |
}
|
147 |
+
#wpmem_reg .form,
|
148 |
+
#wpmem_login .form {
|
149 |
margin:0;
|
150 |
padding:0;
|
151 |
}
|
152 |
+
#wpmem_reg .clear,
|
153 |
+
#wpmem_login .clear {
|
154 |
clear:both;
|
155 |
}
|
156 |
+
#wpmem_reg .holder,
|
157 |
+
#wpmem_login .holder {
|
158 |
background-color:#fff;
|
159 |
}
|
160 |
+
|
161 |
+
#wpmem_login .div_text,
|
162 |
+
#wpmem_reg .div_text,
|
163 |
+
#wpmem_reg .div_textarea,
|
164 |
+
#wpmem_reg .div_select,
|
165 |
+
#wpmem_reg .div_checkbox,
|
166 |
+
#wpmem_reg .div_multiselect,
|
167 |
+
#wpmem_reg .div_multicheckbox,
|
168 |
+
#wpmem_reg .div_radio,
|
169 |
+
#wpmem_reg .div_image,
|
170 |
+
#wpmem_reg .div_file,
|
171 |
+
#wpmem_reg .div_url {
|
172 |
width:74%;
|
173 |
margin:0 0 14px 0;
|
174 |
}
|
176 |
margin: 12px 2px;
|
177 |
}
|
178 |
#wpmem_reg .div_textarea textarea,
|
179 |
+
#wpmem_reg .textbox,
|
180 |
+
#wpmem_login .textbox,
|
181 |
+
#wpmem_reg .username,
|
182 |
+
#wpmem_reg .password,
|
183 |
+
#wpmem_reg .file,
|
184 |
+
#wpmem_reg .image,
|
185 |
+
#wpmem_login .username,
|
186 |
+
#wpmem_login .password {
|
187 |
width:100%;
|
188 |
}
|
189 |
|
232 |
|
233 |
#wpmem_reg .button_div, #wpmem_login .button_div {
|
234 |
width:74%;
|
235 |
+
height:55px;
|
236 |
padding: 6px 0;
|
237 |
text-align: right;
|
238 |
}
|
css/generic-rigid.css
CHANGED
@@ -5,13 +5,13 @@
|
|
5 |
*
|
6 |
* This file is part of the WP-Members plugin by Chad Butler
|
7 |
* You can find out more about this plugin at http://rocketgeek.com
|
8 |
-
* Copyright (c) 2006-
|
9 |
* WP-Members(tm) is a trademark of butlerblog.com
|
10 |
*
|
11 |
* @package WordPress
|
12 |
* @subpackage WP-Members
|
13 |
* @author Chad Butler
|
14 |
-
* @copyright 2006-
|
15 |
*/
|
16 |
|
17 |
/*
|
@@ -65,7 +65,7 @@ see http://rocketgeek.com/tips-and-tricks/load-a-custom-stylesheet/
|
|
65 |
}
|
66 |
#wp-members .err {
|
67 |
width:100%;
|
68 |
-
|
69 |
font-family: inherit;
|
70 |
border: 1px solid #ccc;
|
71 |
border-radius: 3px;
|
@@ -78,20 +78,24 @@ see http://rocketgeek.com/tips-and-tricks/load-a-custom-stylesheet/
|
|
78 |
Fonts
|
79 |
*/
|
80 |
|
81 |
-
#wpmem_reg label,
|
|
|
82 |
font-family: Arial,sans-serif;
|
83 |
font-size: 100%;
|
84 |
font-size: 14px;
|
85 |
font-weight: 400;
|
86 |
}
|
87 |
|
88 |
-
#wpmem_reg legend,
|
|
|
89 |
font-size: 24px;
|
90 |
font-weight: 700;
|
91 |
}
|
92 |
|
93 |
-
#wpmem_reg input,
|
94 |
-
#wpmem_reg
|
|
|
|
|
95 |
font-family: Arial,sans-serif;
|
96 |
font-size: 100%;
|
97 |
font-size: 14px;
|
@@ -107,12 +111,15 @@ see http://rocketgeek.com/tips-and-tricks/load-a-custom-stylesheet/
|
|
107 |
Form Design
|
108 |
*/
|
109 |
|
110 |
-
#wpmem_reg fieldset,
|
|
|
111 |
border: none;
|
112 |
}
|
113 |
|
114 |
-
#wpmem_reg input,
|
115 |
-
#wpmem_reg
|
|
|
|
|
116 |
border: 1px solid rgba(0, 0, 0, 0.3);
|
117 |
outline: 0px none;
|
118 |
border-radius: 2px;
|
@@ -125,14 +132,16 @@ see http://rocketgeek.com/tips-and-tricks/load-a-custom-stylesheet/
|
|
125 |
}
|
126 |
|
127 |
|
128 |
-
#wpmem_reg
|
129 |
width:311px;
|
130 |
}
|
131 |
#wpmem_reg .dropdown:focus {
|
132 |
border: 1px solid rgba(0, 0, 0, 0.3);
|
133 |
outline: 0;
|
134 |
}
|
135 |
-
|
|
|
|
|
136 |
#wpmem_reg .username:focus, #wpmem_reg .username:hover, #wpmem_login .username:focus, #wpmem_login .username:hover,
|
137 |
#wpmem_reg .password:focus, #wpmem_reg .password:hover, #wpmem_login .password:focus, #wpmem_login .password:hover {
|
138 |
background-color:inherit;
|
@@ -142,50 +151,71 @@ see http://rocketgeek.com/tips-and-tricks/load-a-custom-stylesheet/
|
|
142 |
Size and Spacing
|
143 |
*/
|
144 |
|
145 |
-
#wpmem_reg fieldset,
|
|
|
146 |
padding: 0;
|
147 |
margin: 40px 0;
|
148 |
}
|
149 |
-
#wpmem_reg legend,
|
|
|
150 |
line-height: 1;
|
151 |
margin-bottom: 10px;
|
152 |
}
|
153 |
-
#wpmem_reg label.text,
|
154 |
-
#wpmem_reg label.
|
|
|
|
|
155 |
#wpmem_login label {
|
156 |
height: 30px;
|
157 |
width:32%;
|
158 |
float:left;
|
159 |
display: block;
|
160 |
}
|
161 |
-
#wpmem_reg label.text,
|
162 |
-
#wpmem_reg label.
|
|
|
|
|
|
|
|
|
|
|
163 |
padding: 14px 0 4px 0;
|
164 |
}
|
165 |
#wpmem_reg label.textarea {
|
166 |
height: 176px;
|
167 |
padding: 16px 0 2px;
|
168 |
}
|
169 |
-
#wpmem_reg input[type="checkbox"]{
|
170 |
margin-top:18px;
|
171 |
}
|
172 |
-
#wpmem_reg .
|
|
|
|
|
|
|
|
|
173 |
margin:0;
|
174 |
padding:0;
|
175 |
}
|
176 |
-
#wpmem_reg .clear,
|
|
|
177 |
clear:both;
|
178 |
}
|
179 |
-
#wpmem_reg .holder,
|
|
|
180 |
background-color:#fff;
|
181 |
}
|
182 |
-
#
|
183 |
-
#wpmem_reg .
|
184 |
-
#wpmem_reg .
|
|
|
|
|
|
|
|
|
|
|
185 |
width:311px;
|
186 |
float:right;
|
187 |
}
|
188 |
-
#wpmem_reg .div_text,
|
|
|
189 |
padding: 8px 0 6px;
|
190 |
}
|
191 |
#wpmem_reg .div_checkbox {
|
@@ -200,9 +230,12 @@ see http://rocketgeek.com/tips-and-tricks/load-a-custom-stylesheet/
|
|
200 |
#wpmem_login input[type="checkbox"] {
|
201 |
margin: 12px 2px;
|
202 |
}
|
203 |
-
#wpmem_reg .textbox,
|
204 |
-
#wpmem_reg .username,
|
205 |
-
#wpmem_reg .password,
|
|
|
|
|
|
|
206 |
display: block;
|
207 |
width:100%;
|
208 |
height: 34px;
|
@@ -215,6 +248,7 @@ see http://rocketgeek.com/tips-and-tricks/load-a-custom-stylesheet/
|
|
215 |
height: 36px;
|
216 |
padding: 8px 10px;
|
217 |
margin: 5px 0 4px 0;
|
|
|
218 |
}
|
219 |
#wpmem_reg textarea {
|
220 |
height:185px;
|
@@ -252,11 +286,12 @@ see http://rocketgeek.com/tips-and-tricks/load-a-custom-stylesheet/
|
|
252 |
|
253 |
/* Buttons */
|
254 |
|
255 |
-
#wpmem_reg .button_div,
|
|
|
256 |
width:100%;
|
257 |
float:right;
|
258 |
text-align:right;
|
259 |
-
height:
|
260 |
padding: 6px 0;
|
261 |
}
|
262 |
|
@@ -264,16 +299,25 @@ see http://rocketgeek.com/tips-and-tricks/load-a-custom-stylesheet/
|
|
264 |
/** for smaller screens */
|
265 |
|
266 |
@media screen and (max-width: 720px) {
|
267 |
-
#wpmem_reg label.text,
|
268 |
-
#wpmem_reg label.
|
269 |
-
#
|
270 |
-
#wpmem_reg .
|
271 |
-
#wpmem_reg .
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
272 |
float: none;
|
273 |
}
|
274 |
|
275 |
-
#wpmem_reg label.text,
|
276 |
-
#wpmem_reg label.
|
|
|
|
|
277 |
#wpmem_login label {
|
278 |
width: 90%;
|
279 |
padding: 5px 0 0 0;
|
@@ -281,9 +325,11 @@ see http://rocketgeek.com/tips-and-tricks/load-a-custom-stylesheet/
|
|
281 |
#wpmem_reg label.textarea {
|
282 |
height: 26px;
|
283 |
}
|
284 |
-
#wpmem_reg .div_text,
|
285 |
-
#wpmem_reg .
|
286 |
-
#wpmem_reg .
|
|
|
|
|
287 |
width: 98%;
|
288 |
}
|
289 |
}
|
5 |
*
|
6 |
* This file is part of the WP-Members plugin by Chad Butler
|
7 |
* You can find out more about this plugin at http://rocketgeek.com
|
8 |
+
* Copyright (c) 2006-2016 Chad Butler
|
9 |
* WP-Members(tm) is a trademark of butlerblog.com
|
10 |
*
|
11 |
* @package WordPress
|
12 |
* @subpackage WP-Members
|
13 |
* @author Chad Butler
|
14 |
+
* @copyright 2006-2016
|
15 |
*/
|
16 |
|
17 |
/*
|
65 |
}
|
66 |
#wp-members .err {
|
67 |
width:100%;
|
68 |
+
padding: 5px;
|
69 |
font-family: inherit;
|
70 |
border: 1px solid #ccc;
|
71 |
border-radius: 3px;
|
78 |
Fonts
|
79 |
*/
|
80 |
|
81 |
+
#wpmem_reg label,
|
82 |
+
#wpmem_login label {
|
83 |
font-family: Arial,sans-serif;
|
84 |
font-size: 100%;
|
85 |
font-size: 14px;
|
86 |
font-weight: 400;
|
87 |
}
|
88 |
|
89 |
+
#wpmem_reg legend,
|
90 |
+
#wpmem_login legend {
|
91 |
font-size: 24px;
|
92 |
font-weight: 700;
|
93 |
}
|
94 |
|
95 |
+
#wpmem_reg input,
|
96 |
+
#wpmem_reg textarea,
|
97 |
+
#wpmem_reg select,
|
98 |
+
#wpmem_login input {
|
99 |
font-family: Arial,sans-serif;
|
100 |
font-size: 100%;
|
101 |
font-size: 14px;
|
111 |
Form Design
|
112 |
*/
|
113 |
|
114 |
+
#wpmem_reg fieldset,
|
115 |
+
#wpmem_login fieldset {
|
116 |
border: none;
|
117 |
}
|
118 |
|
119 |
+
#wpmem_reg input,
|
120 |
+
#wpmem_reg textarea,
|
121 |
+
#wpmem_reg select,
|
122 |
+
#wpmem_login input {
|
123 |
border: 1px solid rgba(0, 0, 0, 0.3);
|
124 |
outline: 0px none;
|
125 |
border-radius: 2px;
|
132 |
}
|
133 |
|
134 |
|
135 |
+
#wpmem_reg select {
|
136 |
width:311px;
|
137 |
}
|
138 |
#wpmem_reg .dropdown:focus {
|
139 |
border: 1px solid rgba(0, 0, 0, 0.3);
|
140 |
outline: 0;
|
141 |
}
|
142 |
+
|
143 |
+
#wpmem_login .textbox:focus, #wpmem_login .textbox:hover,
|
144 |
+
#wpmem_reg .textbox:focus, #wpmem_reg .textbox:hover,
|
145 |
#wpmem_reg .username:focus, #wpmem_reg .username:hover, #wpmem_login .username:focus, #wpmem_login .username:hover,
|
146 |
#wpmem_reg .password:focus, #wpmem_reg .password:hover, #wpmem_login .password:focus, #wpmem_login .password:hover {
|
147 |
background-color:inherit;
|
151 |
Size and Spacing
|
152 |
*/
|
153 |
|
154 |
+
#wpmem_reg fieldset,
|
155 |
+
#wpmem_login fieldset {
|
156 |
padding: 0;
|
157 |
margin: 40px 0;
|
158 |
}
|
159 |
+
#wpmem_reg legend,
|
160 |
+
#wpmem_login legend {
|
161 |
line-height: 1;
|
162 |
margin-bottom: 10px;
|
163 |
}
|
164 |
+
#wpmem_reg label.text,
|
165 |
+
#wpmem_reg label.checkbox,
|
166 |
+
#wpmem_reg label.textarea ,
|
167 |
+
#wpmem_reg label.select,
|
168 |
#wpmem_login label {
|
169 |
height: 30px;
|
170 |
width:32%;
|
171 |
float:left;
|
172 |
display: block;
|
173 |
}
|
174 |
+
#wpmem_reg label.text,
|
175 |
+
#wpmem_reg label.checkbox,
|
176 |
+
#wpmem_reg label.select,
|
177 |
+
#wpmem_reg label.radio
|
178 |
+
#wpmem_reg label.multicheckbox,
|
179 |
+
#wpmem_reg.multiselect,
|
180 |
+
#wpmem_login label{
|
181 |
padding: 14px 0 4px 0;
|
182 |
}
|
183 |
#wpmem_reg label.textarea {
|
184 |
height: 176px;
|
185 |
padding: 16px 0 2px;
|
186 |
}
|
187 |
+
#wpmem_reg input[type="checkbox"] {
|
188 |
margin-top:18px;
|
189 |
}
|
190 |
+
#wpmem_reg .div_multicheckbox input[type="checkbox"] {
|
191 |
+
margin: 0 0 0 0;
|
192 |
+
}
|
193 |
+
#wpmem_reg .form,
|
194 |
+
#wpmem_login .form {
|
195 |
margin:0;
|
196 |
padding:0;
|
197 |
}
|
198 |
+
#wpmem_reg .clear,
|
199 |
+
#wpmem_login .clear {
|
200 |
clear:both;
|
201 |
}
|
202 |
+
#wpmem_reg .holder,
|
203 |
+
#wpmem_login .holder {
|
204 |
background-color:#fff;
|
205 |
}
|
206 |
+
#wpmem_login .div_text,
|
207 |
+
#wpmem_reg .div_text,
|
208 |
+
#wpmem_reg .div_checkbox,
|
209 |
+
#wpmem_reg .div_select,
|
210 |
+
#wpmem_reg .div_textarea,
|
211 |
+
#wpmem_reg .div_multiselect,
|
212 |
+
#wpmem_reg .div_multicheckbox,
|
213 |
+
#wpmem_reg .div_radio {
|
214 |
width:311px;
|
215 |
float:right;
|
216 |
}
|
217 |
+
#wpmem_reg .div_text,
|
218 |
+
#wpmem_login .div_text {
|
219 |
padding: 8px 0 6px;
|
220 |
}
|
221 |
#wpmem_reg .div_checkbox {
|
230 |
#wpmem_login input[type="checkbox"] {
|
231 |
margin: 12px 2px;
|
232 |
}
|
233 |
+
#wpmem_reg .textbox,
|
234 |
+
#wpmem_reg .username,
|
235 |
+
#wpmem_reg .password,
|
236 |
+
#wpmem_login .textbox,
|
237 |
+
#wpmem_login .username,
|
238 |
+
#wpmem_login .password {
|
239 |
display: block;
|
240 |
width:100%;
|
241 |
height: 34px;
|
248 |
height: 36px;
|
249 |
padding: 8px 10px;
|
250 |
margin: 5px 0 4px 0;
|
251 |
+
background-color: transparent;
|
252 |
}
|
253 |
#wpmem_reg textarea {
|
254 |
height:185px;
|
286 |
|
287 |
/* Buttons */
|
288 |
|
289 |
+
#wpmem_reg .button_div,
|
290 |
+
#wpmem_login .button_div {
|
291 |
width:100%;
|
292 |
float:right;
|
293 |
text-align:right;
|
294 |
+
height:55px;
|
295 |
padding: 6px 0;
|
296 |
}
|
297 |
|
299 |
/** for smaller screens */
|
300 |
|
301 |
@media screen and (max-width: 720px) {
|
302 |
+
#wpmem_reg label.text,
|
303 |
+
#wpmem_reg label.checkbox,
|
304 |
+
#wpmem_reg label.textarea,
|
305 |
+
#wpmem_reg label.select,
|
306 |
+
#wpmem_reg .div_text,
|
307 |
+
#wpmem_reg .div_textarea,
|
308 |
+
#wpmem_reg .div_select,
|
309 |
+
#wpmem_reg .div_checkbox,
|
310 |
+
#wpmem_reg .button_div,
|
311 |
+
#wpmem_login label,
|
312 |
+
#wpmem_login .button_div,
|
313 |
+
#wpmem_login .div_text {
|
314 |
float: none;
|
315 |
}
|
316 |
|
317 |
+
#wpmem_reg label.text,
|
318 |
+
#wpmem_reg label.checkbox,
|
319 |
+
#wpmem_reg label.textarea,
|
320 |
+
#wpmem_reg label.select,
|
321 |
#wpmem_login label {
|
322 |
width: 90%;
|
323 |
padding: 5px 0 0 0;
|
325 |
#wpmem_reg label.textarea {
|
326 |
height: 26px;
|
327 |
}
|
328 |
+
#wpmem_reg .div_text,
|
329 |
+
#wpmem_reg .div_textarea,
|
330 |
+
#wpmem_reg .div_select,
|
331 |
+
#wpmem_reg .div_checkbox,
|
332 |
+
#wpmem_login .div_text {
|
333 |
width: 98%;
|
334 |
}
|
335 |
}
|
css/wp-members-2011.css
CHANGED
@@ -182,7 +182,10 @@ see http://rocketgeek.com/tips-and-tricks/load-a-custom-stylesheet/
|
|
182 |
}
|
183 |
#wpmem_login input[type="password"],
|
184 |
#wpmem_login input[type="text"],
|
185 |
-
#wpmem_reg input[type="text"]
|
|
|
|
|
|
|
186 |
height: 26px;
|
187 |
}
|
188 |
#wpmem_reg input[type=checkbox]{
|
182 |
}
|
183 |
#wpmem_login input[type="password"],
|
184 |
#wpmem_login input[type="text"],
|
185 |
+
#wpmem_reg input[type="text"],
|
186 |
+
#wpmem_reg input[type="password"],
|
187 |
+
#wpmem_reg input[type="email"],
|
188 |
+
#wpmem_reg input[type="url"] {
|
189 |
height: 26px;
|
190 |
}
|
191 |
#wpmem_reg input[type=checkbox]{
|
css/wp-members-2014-no-float.css
CHANGED
@@ -1,235 +1,254 @@
|
|
1 |
-
/**
|
2 |
-
* WP-Members Styles CSS
|
3 |
-
*
|
4 |
-
* CSS for the WP-Members plugin using Twenty Fourteen Theme, no float
|
5 |
-
*
|
6 |
-
* This file is part of the WP-Members plugin by Chad Butler
|
7 |
-
* You can find out more about this plugin at http://rocketgeek.com
|
8 |
-
* Copyright (c) 2006-2015 Chad Butler
|
9 |
-
* WP-Members(tm) is a trademark of butlerblog.com
|
10 |
-
*
|
11 |
-
* @package WordPress
|
12 |
-
* @subpackage WP-Members
|
13 |
-
* @author Chad Butler
|
14 |
-
* @copyright 2006-2015
|
15 |
-
*/
|
16 |
-
|
17 |
-
/*
|
18 |
-
This stylesheet is designed to integrate WP-Members with the Twenty Fourteen theme.
|
19 |
-
There are quite a few examples in here of what you can do to style the forms.
|
20 |
-
You can build off of this or start from scratch and set your own
|
21 |
-
custom css for the plugin (set the location in the admin panel).
|
22 |
-
|
23 |
-
See http://rocketgeek.com/tips-and-tricks/setting-up-a-custom-wp-members-stylesheet/
|
24 |
-
for information on how to set up the plugin with a custom stylesheet.
|
25 |
-
|
26 |
-
For information how to load custom stylesheets with wp_enqueue_style,
|
27 |
-
see http://rocketgeek.com/tips-and-tricks/load-a-custom-stylesheet/
|
28 |
-
*/
|
29 |
-
|
30 |
-
|
31 |
-
/* Error and Dialog Messages */
|
32 |
-
|
33 |
-
#wpmem_msg, .wpmem_msg {
|
34 |
-
background: #F9F9F9;
|
35 |
-
border:1px solid lightGrey;
|
36 |
-
border-radius: 3px;
|
37 |
-
padding: 20px 0 0 0;
|
38 |
-
}
|
39 |
-
#wpmem_msg {
|
40 |
-
width: 100%;
|
41 |
-
}
|
42 |
-
.wpmem_msg {
|
43 |
-
width: 74%;
|
44 |
-
}
|
45 |
-
|
46 |
-
|
47 |
-
/* Sidebar Login Widget */
|
48 |
-
|
49 |
-
#wp-members {
|
50 |
-
width: 100%;
|
51 |
-
}
|
52 |
-
#wp-members fieldset {
|
53 |
-
border:none;
|
54 |
-
padding:0px
|
55 |
-
}
|
56 |
-
#wp-members input {
|
57 |
-
font-family: inherit;
|
58 |
-
}
|
59 |
-
#wp-members input[type="text"],
|
60 |
-
#wp-members input[type="password"]{
|
61 |
-
margin: 0 0 4px 0;
|
62 |
-
width: 92%;
|
63 |
-
}
|
64 |
-
#wp-members input[type="submit"] {
|
65 |
-
padding: 5px 6px 4px;
|
66 |
-
margin: 0 4px 0 0;
|
67 |
-
}
|
68 |
-
#wp-members .button_div {
|
69 |
-
margin-top:4px;
|
70 |
-
}
|
71 |
-
#wp-members .err {
|
72 |
-
width:100%;
|
73 |
-
padding: 5px;
|
74 |
-
font-family: inherit;
|
75 |
-
border: 1px solid #ccc;
|
76 |
-
border-radius: 3px;
|
77 |
-
}
|
78 |
-
|
79 |
-
|
80 |
-
/* Login Form and Registration Form */
|
81 |
-
|
82 |
-
#wpmem_reg fieldset,
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
font-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
}
|
100 |
-
#wpmem_reg .
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
#wpmem_reg .
|
105 |
-
#
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
#
|
110 |
-
|
111 |
-
|
112 |
-
#wpmem_reg .
|
113 |
-
#wpmem_reg .
|
114 |
-
#wpmem_reg .
|
115 |
-
#wpmem_reg .
|
116 |
-
|
117 |
-
|
118 |
-
#wpmem_reg .
|
119 |
-
width:
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
#wpmem_reg .
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
#
|
131 |
-
#
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
#wpmem_reg
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
#wpmem_reg .
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
#wpmem_reg .
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
}
|
156 |
-
|
157 |
-
#
|
158 |
-
|
159 |
-
|
160 |
-
}
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
}
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
#
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
#wpmem_reg .
|
230 |
-
|
231 |
-
|
232 |
-
#
|
233 |
-
|
234 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
235 |
}
|
1 |
+
/**
|
2 |
+
* WP-Members Styles CSS
|
3 |
+
*
|
4 |
+
* CSS for the WP-Members plugin using Twenty Fourteen Theme, no float
|
5 |
+
*
|
6 |
+
* This file is part of the WP-Members plugin by Chad Butler
|
7 |
+
* You can find out more about this plugin at http://rocketgeek.com
|
8 |
+
* Copyright (c) 2006-2015 Chad Butler
|
9 |
+
* WP-Members(tm) is a trademark of butlerblog.com
|
10 |
+
*
|
11 |
+
* @package WordPress
|
12 |
+
* @subpackage WP-Members
|
13 |
+
* @author Chad Butler
|
14 |
+
* @copyright 2006-2015
|
15 |
+
*/
|
16 |
+
|
17 |
+
/*
|
18 |
+
This stylesheet is designed to integrate WP-Members with the Twenty Fourteen theme.
|
19 |
+
There are quite a few examples in here of what you can do to style the forms.
|
20 |
+
You can build off of this or start from scratch and set your own
|
21 |
+
custom css for the plugin (set the location in the admin panel).
|
22 |
+
|
23 |
+
See http://rocketgeek.com/tips-and-tricks/setting-up-a-custom-wp-members-stylesheet/
|
24 |
+
for information on how to set up the plugin with a custom stylesheet.
|
25 |
+
|
26 |
+
For information how to load custom stylesheets with wp_enqueue_style,
|
27 |
+
see http://rocketgeek.com/tips-and-tricks/load-a-custom-stylesheet/
|
28 |
+
*/
|
29 |
+
|
30 |
+
|
31 |
+
/* Error and Dialog Messages */
|
32 |
+
|
33 |
+
#wpmem_msg, .wpmem_msg {
|
34 |
+
background: #F9F9F9;
|
35 |
+
border:1px solid lightGrey;
|
36 |
+
border-radius: 3px;
|
37 |
+
padding: 20px 0 0 0;
|
38 |
+
}
|
39 |
+
#wpmem_msg {
|
40 |
+
width: 100%;
|
41 |
+
}
|
42 |
+
.wpmem_msg {
|
43 |
+
width: 74%;
|
44 |
+
}
|
45 |
+
|
46 |
+
|
47 |
+
/* Sidebar Login Widget */
|
48 |
+
|
49 |
+
#wp-members {
|
50 |
+
width: 100%;
|
51 |
+
}
|
52 |
+
#wp-members fieldset {
|
53 |
+
border:none;
|
54 |
+
padding:0px
|
55 |
+
}
|
56 |
+
#wp-members input {
|
57 |
+
font-family: inherit;
|
58 |
+
}
|
59 |
+
#wp-members input[type="text"],
|
60 |
+
#wp-members input[type="password"]{
|
61 |
+
margin: 0 0 4px 0;
|
62 |
+
width: 92%;
|
63 |
+
}
|
64 |
+
#wp-members input[type="submit"] {
|
65 |
+
padding: 5px 6px 4px;
|
66 |
+
margin: 0 4px 0 0;
|
67 |
+
}
|
68 |
+
#wp-members .button_div {
|
69 |
+
margin-top:4px;
|
70 |
+
}
|
71 |
+
#wp-members .err {
|
72 |
+
width:100%;
|
73 |
+
padding: 5px;
|
74 |
+
font-family: inherit;
|
75 |
+
border: 1px solid #ccc;
|
76 |
+
border-radius: 3px;
|
77 |
+
}
|
78 |
+
|
79 |
+
|
80 |
+
/* Login Form and Registration Form */
|
81 |
+
|
82 |
+
#wpmem_reg fieldset,
|
83 |
+
#wpmem_login fieldset {
|
84 |
+
border: none;
|
85 |
+
padding: 0;
|
86 |
+
margin: 40px 0;
|
87 |
+
}
|
88 |
+
#wpmem_reg legend,
|
89 |
+
#wpmem_login legend {
|
90 |
+
font-size: 24px;
|
91 |
+
line-height: 1;
|
92 |
+
font-weight: 700;
|
93 |
+
margin-bottom: 10px;
|
94 |
+
}
|
95 |
+
#wpmem_reg .form,
|
96 |
+
#wpmem_login .form {
|
97 |
+
margin:0;
|
98 |
+
padding:0;
|
99 |
+
}
|
100 |
+
#wpmem_reg .clear,
|
101 |
+
#wpmem_login .clear {
|
102 |
+
clear:both;
|
103 |
+
}
|
104 |
+
#wpmem_reg .holder,
|
105 |
+
#wpmem_login .holder {
|
106 |
+
background-color:#fff;
|
107 |
+
}
|
108 |
+
#wpmem_login .div_text,
|
109 |
+
#wpmem_reg .div_text,
|
110 |
+
#wpmem_reg .div_textarea,
|
111 |
+
#wpmem_reg .div_select,
|
112 |
+
#wpmem_reg .div_checkbox,
|
113 |
+
#wpmem_reg .div_multicheckbox,
|
114 |
+
#wpmem_reg .div_multiselect,
|
115 |
+
#wpmem_reg .div_radio,
|
116 |
+
#wpmem_reg .div_image,
|
117 |
+
#wpmem_reg .div_file,
|
118 |
+
#wpmem_reg .div_url{
|
119 |
+
width:74%;
|
120 |
+
margin:0 0 14px 0;
|
121 |
+
}
|
122 |
+
#wpmem_login input[type="checkbox"] {
|
123 |
+
margin: 12px 2px;
|
124 |
+
}
|
125 |
+
#wpmem_reg .div_textarea textarea,
|
126 |
+
#wpmem_reg .textbox,
|
127 |
+
#wpmem_reg .username,
|
128 |
+
#wpmem_reg .password,
|
129 |
+
#wpmem_login .textbox,
|
130 |
+
#wpmem_login .username,
|
131 |
+
#wpmem_login .password {
|
132 |
+
width:100%;
|
133 |
+
}
|
134 |
+
#wpmem_reg .dropdown,
|
135 |
+
#wpmem_reg select,
|
136 |
+
#wpmem_reg input[type="file"] {
|
137 |
+
width:100%;
|
138 |
+
padding: 8px 10px 7px;
|
139 |
+
border: 1px solid rgba(0, 0, 0, 0.1);
|
140 |
+
border-radius: 2px;
|
141 |
+
color: rgb(43, 43, 43);
|
142 |
+
margin: 5px 0;
|
143 |
+
}
|
144 |
+
#wpmem_reg .dropdown:focus {
|
145 |
+
border: 1px solid rgba(0, 0, 0, 0.3);
|
146 |
+
outline: 0;
|
147 |
+
}
|
148 |
+
#wpmem_reg .textbox:focus, #wpmem_reg .textbox:hover, #wpmem_login .textbox:focus, #wpmem_login .textbox:hover,
|
149 |
+
#wpmem_reg .username:focus, #wpmem_reg .username:hover, #wpmem_login .username:focus, #wpmem_login .username:hover,
|
150 |
+
#wpmem_reg .password:focus, #wpmem_reg .password:hover, #wpmem_login .password:focus, #wpmem_login .password:hover {
|
151 |
+
background-color:inherit;
|
152 |
+
}
|
153 |
+
#wpmem_reg textarea {
|
154 |
+
height:185px;
|
155 |
+
}
|
156 |
+
#wpmem_reg .req {
|
157 |
+
color: #bd3500;
|
158 |
+
font-size: 22px;
|
159 |
+
line-height: 50%;
|
160 |
+
}
|
161 |
+
|
162 |
+
#wpmem_reg .req-text {
|
163 |
+
margin: 20px 0px 0px 5px;
|
164 |
+
}
|
165 |
+
|
166 |
+
#wpmem_reg .noinput {
|
167 |
+
width:94%;
|
168 |
+
padding: 8px 10px 7px;
|
169 |
+
border: 1px solid rgba(0, 0, 0, 0.1);
|
170 |
+
border-radius: 2px;
|
171 |
+
color: rgb(43, 43, 43);
|
172 |
+
margin: 5px 0;
|
173 |
+
}
|
174 |
+
|
175 |
+
#wpmem_reg .captcha {
|
176 |
+
width: 74%;
|
177 |
+
margin: 5px 0px;
|
178 |
+
}
|
179 |
+
#wpmem_reg .captcha table{
|
180 |
+
line-height: 0px;
|
181 |
+
}
|
182 |
+
#wpmem_login .link-text {
|
183 |
+
width: 74%;
|
184 |
+
text-align:right;
|
185 |
+
}
|
186 |
+
|
187 |
+
#tos {
|
188 |
+
margin-right:5px;
|
189 |
+
}
|
190 |
+
|
191 |
+
|
192 |
+
/* Buttons */
|
193 |
+
|
194 |
+
#wpmem_reg .button_div,
|
195 |
+
#wpmem_login .button_div {
|
196 |
+
width:74%;
|
197 |
+
height:35px;
|
198 |
+
padding: 6px 0;
|
199 |
+
text-align: right;
|
200 |
+
}
|
201 |
+
|
202 |
+
|
203 |
+
/** for smaller screens */
|
204 |
+
|
205 |
+
@media screen and (max-width: 1079px) {
|
206 |
+
#wp-members .button_div {
|
207 |
+
text-align:center;
|
208 |
+
}
|
209 |
+
#wp-members input[type="submit"] {
|
210 |
+
width: 92%;
|
211 |
+
margin: 0 10px 6px 0;
|
212 |
+
}
|
213 |
+
}
|
214 |
+
|
215 |
+
@media screen and (max-width: 1007px) {
|
216 |
+
#wp-members {
|
217 |
+
width: 179px;
|
218 |
+
}
|
219 |
+
#wp-members .button_div {
|
220 |
+
text-align: inherit;
|
221 |
+
}
|
222 |
+
#wp-members input[type="submit"] {
|
223 |
+
width: inherit;
|
224 |
+
margin: 0 4px 0 0;
|
225 |
+
}
|
226 |
+
}
|
227 |
+
|
228 |
+
@media screen and (max-width: 720px) {
|
229 |
+
#wpmem_reg label.text, #wpmem_reg label.checkbox,
|
230 |
+
#wpmem_reg label.textarea , #wpmem_reg label.select,
|
231 |
+
#wpmem_login label, #wpmem_reg .div_text, #wpmem_reg .div_textarea,
|
232 |
+
#wpmem_reg .div_select, #wpmem_login .div_text,
|
233 |
+
#wpmem_reg .div_checkbox, #wpmem_reg .button_div, #wpmem_login .button_div {
|
234 |
+
float: none;
|
235 |
+
}
|
236 |
+
|
237 |
+
#wpmem_reg label.text, #wpmem_reg label.checkbox,
|
238 |
+
#wpmem_reg label.textarea , #wpmem_reg label.select,
|
239 |
+
#wpmem_login label {
|
240 |
+
width: 90%;
|
241 |
+
padding: 5px 0 0 0;
|
242 |
+
}
|
243 |
+
#wpmem_reg label.textarea {
|
244 |
+
height: 26px;
|
245 |
+
}
|
246 |
+
#wpmem_reg .div_text, #wpmem_reg .div_textarea,
|
247 |
+
#wpmem_reg .div_select, #wpmem_login .div_text,
|
248 |
+
#wpmem_reg .div_checkbox {
|
249 |
+
width: 98%;
|
250 |
+
}
|
251 |
+
#wpmem_msg, .wpmem_msg {
|
252 |
+
width: 100%;
|
253 |
+
}
|
254 |
}
|
css/wp-members-2015-no-float.css
CHANGED
@@ -1,231 +1,250 @@
|
|
1 |
-
/**
|
2 |
-
* WP-Members Styles CSS
|
3 |
-
*
|
4 |
-
* CSS for the WP-Members plugin - Twenty Fifteen Theme, No Float
|
5 |
-
*
|
6 |
-
* This file is part of the WP-Members plugin by Chad Butler
|
7 |
-
* You can find out more about this plugin at http://rocketgeek.com
|
8 |
-
* Copyright (c) 2006-2015 Chad Butler
|
9 |
-
* WP-Members(tm) is a trademark of butlerblog.com
|
10 |
-
*
|
11 |
-
* @package WordPress
|
12 |
-
* @subpackage WP-Members
|
13 |
-
* @author Chad Butler
|
14 |
-
* @copyright 2006-2015
|
15 |
-
*/
|
16 |
-
|
17 |
-
/*
|
18 |
-
This stylesheet is designed to integrate WP-Members floated form elements
|
19 |
-
as simply as possible with most themes. There are quite a few examples
|
20 |
-
in here of what you can do to style the forms. You can build off of this
|
21 |
-
or start from scratch and set your own custom css for the plugin
|
22 |
-
(set the location in the admin panel).
|
23 |
-
|
24 |
-
See http://rocketgeek.com/tips-and-tricks/setting-up-a-custom-wp-members-stylesheet/
|
25 |
-
for information on how to set up the plugin with a custom stylesheet.
|
26 |
-
|
27 |
-
For information how to load custom stylesheets with wp_enqueue_style,
|
28 |
-
see http://rocketgeek.com/tips-and-tricks/load-a-custom-stylesheet/
|
29 |
-
*/
|
30 |
-
|
31 |
-
|
32 |
-
/* Error and Dialog Messages */
|
33 |
-
|
34 |
-
#wpmem_msg, .wpmem_msg {
|
35 |
-
background: #F7F7F7;
|
36 |
-
border: 1px solid rgba(51, 51, 51, 0.3);
|
37 |
-
padding: 0;
|
38 |
-
}
|
39 |
-
#wpmem_msg h2 {
|
40 |
-
margin: 0;
|
41 |
-
padding: 30px;
|
42 |
-
}
|
43 |
-
#wpmem_msg {
|
44 |
-
width: 100%;
|
45 |
-
}
|
46 |
-
.wpmem_msg {
|
47 |
-
margin: 0;
|
48 |
-
padding: 32px 26px 4px;
|
49 |
-
}
|
50 |
-
|
51 |
-
|
52 |
-
/* Sidebar Login Widget */
|
53 |
-
|
54 |
-
#wp-members {
|
55 |
-
width: 100%;
|
56 |
-
}
|
57 |
-
#wp-members fieldset {
|
58 |
-
border: none;
|
59 |
-
padding: 10px 0 0 0;
|
60 |
-
}
|
61 |
-
#wp-members input {
|
62 |
-
font-family: inherit;
|
63 |
-
}
|
64 |
-
#wp-members input[type="text"],
|
65 |
-
#wp-members input[type="password"]{
|
66 |
-
margin: 0 0 8px 0;
|
67 |
-
}
|
68 |
-
#wp-members input[type="submit"] {
|
69 |
-
padding: 5px 10px;
|
70 |
-
margin: 0 6px 0 0;
|
71 |
-
}
|
72 |
-
#wp-members .button_div {
|
73 |
-
margin-top: 8px;
|
74 |
-
}
|
75 |
-
#wp-members .err {
|
76 |
-
width:100%;
|
77 |
-
padding: 5px;
|
78 |
-
font-family: inherit;
|
79 |
-
background: #F7F7F7;
|
80 |
-
border: 1px solid rgba(51, 51, 51, 0.3);
|
81 |
-
}
|
82 |
-
|
83 |
-
|
84 |
-
/* Login Form and Registration Form */
|
85 |
-
|
86 |
-
#wpmem_reg label,
|
87 |
-
#wpmem_login label {
|
88 |
-
font-size: 1.6rem;
|
89 |
-
color: #707070;
|
90 |
-
color: rgba(51, 51, 51, 0.7);
|
91 |
-
font-family: "Noto Sans", sans-serif;
|
92 |
-
font-weight: 700;
|
93 |
-
display: block;
|
94 |
-
letter-spacing: 0.04em;
|
95 |
-
line-height: 1.5;
|
96 |
-
text-transform: uppercase;
|
97 |
-
margin-bottom: 6px;
|
98 |
-
}
|
99 |
-
|
100 |
-
#wpmem_reg select
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
font-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
#
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
#wpmem_reg .
|
132 |
-
|
133 |
-
|
134 |
-
}
|
135 |
-
#wpmem_login
|
136 |
-
|
137 |
-
|
138 |
-
#wpmem_reg .
|
139 |
-
#wpmem_reg .
|
140 |
-
#wpmem_reg .
|
141 |
-
#wpmem_reg .
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
}
|
149 |
-
#
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
#wpmem_reg .
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
#
|
160 |
-
width:
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
}
|
167 |
-
|
168 |
-
#
|
169 |
-
|
170 |
-
|
171 |
-
}
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
#wpmem_reg .
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
#
|
223 |
-
|
224 |
-
}
|
225 |
-
|
226 |
-
#wpmem_reg .
|
227 |
-
#
|
228 |
-
#wpmem_login
|
229 |
-
width:
|
230 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
231 |
}
|
1 |
+
/**
|
2 |
+
* WP-Members Styles CSS
|
3 |
+
*
|
4 |
+
* CSS for the WP-Members plugin - Twenty Fifteen Theme, No Float
|
5 |
+
*
|
6 |
+
* This file is part of the WP-Members plugin by Chad Butler
|
7 |
+
* You can find out more about this plugin at http://rocketgeek.com
|
8 |
+
* Copyright (c) 2006-2015 Chad Butler
|
9 |
+
* WP-Members(tm) is a trademark of butlerblog.com
|
10 |
+
*
|
11 |
+
* @package WordPress
|
12 |
+
* @subpackage WP-Members
|
13 |
+
* @author Chad Butler
|
14 |
+
* @copyright 2006-2015
|
15 |
+
*/
|
16 |
+
|
17 |
+
/*
|
18 |
+
This stylesheet is designed to integrate WP-Members floated form elements
|
19 |
+
as simply as possible with most themes. There are quite a few examples
|
20 |
+
in here of what you can do to style the forms. You can build off of this
|
21 |
+
or start from scratch and set your own custom css for the plugin
|
22 |
+
(set the location in the admin panel).
|
23 |
+
|
24 |
+
See http://rocketgeek.com/tips-and-tricks/setting-up-a-custom-wp-members-stylesheet/
|
25 |
+
for information on how to set up the plugin with a custom stylesheet.
|
26 |
+
|
27 |
+
For information how to load custom stylesheets with wp_enqueue_style,
|
28 |
+
see http://rocketgeek.com/tips-and-tricks/load-a-custom-stylesheet/
|
29 |
+
*/
|
30 |
+
|
31 |
+
|
32 |
+
/* Error and Dialog Messages */
|
33 |
+
|
34 |
+
#wpmem_msg, .wpmem_msg {
|
35 |
+
background: #F7F7F7;
|
36 |
+
border: 1px solid rgba(51, 51, 51, 0.3);
|
37 |
+
padding: 0;
|
38 |
+
}
|
39 |
+
#wpmem_msg h2 {
|
40 |
+
margin: 0;
|
41 |
+
padding: 30px;
|
42 |
+
}
|
43 |
+
#wpmem_msg {
|
44 |
+
width: 100%;
|
45 |
+
}
|
46 |
+
.wpmem_msg {
|
47 |
+
margin: 0;
|
48 |
+
padding: 32px 26px 4px;
|
49 |
+
}
|
50 |
+
|
51 |
+
|
52 |
+
/* Sidebar Login Widget */
|
53 |
+
|
54 |
+
#wp-members {
|
55 |
+
width: 100%;
|
56 |
+
}
|
57 |
+
#wp-members fieldset {
|
58 |
+
border: none;
|
59 |
+
padding: 10px 0 0 0;
|
60 |
+
}
|
61 |
+
#wp-members input {
|
62 |
+
font-family: inherit;
|
63 |
+
}
|
64 |
+
#wp-members input[type="text"],
|
65 |
+
#wp-members input[type="password"]{
|
66 |
+
margin: 0 0 8px 0;
|
67 |
+
}
|
68 |
+
#wp-members input[type="submit"] {
|
69 |
+
padding: 5px 10px;
|
70 |
+
margin: 0 6px 0 0;
|
71 |
+
}
|
72 |
+
#wp-members .button_div {
|
73 |
+
margin-top: 8px;
|
74 |
+
}
|
75 |
+
#wp-members .err {
|
76 |
+
width:100%;
|
77 |
+
padding: 5px;
|
78 |
+
font-family: inherit;
|
79 |
+
background: #F7F7F7;
|
80 |
+
border: 1px solid rgba(51, 51, 51, 0.3);
|
81 |
+
}
|
82 |
+
|
83 |
+
|
84 |
+
/* Login Form and Registration Form */
|
85 |
+
|
86 |
+
#wpmem_reg label,
|
87 |
+
#wpmem_login label {
|
88 |
+
font-size: 1.6rem;
|
89 |
+
color: #707070;
|
90 |
+
color: rgba(51, 51, 51, 0.7);
|
91 |
+
font-family: "Noto Sans", sans-serif;
|
92 |
+
font-weight: 700;
|
93 |
+
display: block;
|
94 |
+
letter-spacing: 0.04em;
|
95 |
+
line-height: 1.5;
|
96 |
+
text-transform: uppercase;
|
97 |
+
margin-bottom: 6px;
|
98 |
+
}
|
99 |
+
|
100 |
+
#wpmem_reg select,
|
101 |
+
#wpmem_reg input[type="file"] {
|
102 |
+
width:100%;
|
103 |
+
padding: 8px 10px 7px;
|
104 |
+
border: 1px solid rgba(0, 0, 0, 0.1);
|
105 |
+
margin: 5px 0;
|
106 |
+
}
|
107 |
+
|
108 |
+
#wpmem_reg fieldset,
|
109 |
+
#wpmem_login fieldset {
|
110 |
+
border: none;
|
111 |
+
padding: 0;
|
112 |
+
margin: 40px 0;
|
113 |
+
}
|
114 |
+
#wpmem_reg legend,
|
115 |
+
#wpmem_login legend {
|
116 |
+
font-weight: 700;
|
117 |
+
margin-bottom: 25px;
|
118 |
+
font-size: 27px;
|
119 |
+
font-size: 2.7rem;
|
120 |
+
line-height: 1.1852;
|
121 |
+
}
|
122 |
+
#wpmem_reg .form,
|
123 |
+
#wpmem_login .form {
|
124 |
+
margin:0;
|
125 |
+
padding:0;
|
126 |
+
}
|
127 |
+
#wpmem_reg .clear,
|
128 |
+
#wpmem_login .clear {
|
129 |
+
clear:both;
|
130 |
+
}
|
131 |
+
#wpmem_reg .holder,
|
132 |
+
#wpmem_login .holder {
|
133 |
+
background-color:#fff;
|
134 |
+
}
|
135 |
+
#wpmem_login .div_text,
|
136 |
+
#wpmem_reg .div_text,
|
137 |
+
#wpmem_reg .div_textarea,
|
138 |
+
#wpmem_reg .div_select,
|
139 |
+
#wpmem_reg .div_checkbox,
|
140 |
+
#wpmem_reg .div_multicheckbox,
|
141 |
+
#wpmem_reg .div_multiselect,
|
142 |
+
#wpmem_reg .div_radio,
|
143 |
+
#wpmem_reg .div_url,
|
144 |
+
#wpmem_reg .div_image,
|
145 |
+
#wpmem_reg .div_file {
|
146 |
+
width:74%;
|
147 |
+
margin:0 0 14px 0;
|
148 |
+
}
|
149 |
+
#wpmem_login input[type="checkbox"] {
|
150 |
+
margin: 12px 2px;
|
151 |
+
}
|
152 |
+
#wpmem_reg .div_textarea textarea,
|
153 |
+
#wpmem_reg .textbox,
|
154 |
+
#wpmem_reg .username,
|
155 |
+
#wpmem_reg .password,
|
156 |
+
#wpmem_reg input[type="file"],
|
157 |
+
#wpmem_login .textbox,
|
158 |
+
#wpmem_login .username,
|
159 |
+
#wpmem_login .password {
|
160 |
+
width:100%;
|
161 |
+
}
|
162 |
+
|
163 |
+
|
164 |
+
#wpmem_reg textarea {
|
165 |
+
height:185px;
|
166 |
+
}
|
167 |
+
#wpmem_reg .req {
|
168 |
+
color: #bd3500;
|
169 |
+
font-size: 22px;
|
170 |
+
line-height: 50%;
|
171 |
+
}
|
172 |
+
|
173 |
+
#wpmem_reg .req-text {
|
174 |
+
margin: 20px 0px 0px 5px;
|
175 |
+
}
|
176 |
+
|
177 |
+
#wpmem_reg .noinput {
|
178 |
+
width:100%;
|
179 |
+
padding: 8px 10px 7px;
|
180 |
+
border: 1px solid rgba(0, 0, 0, 0.1);
|
181 |
+
border-radius: 2px;
|
182 |
+
color: rgb(43, 43, 43);
|
183 |
+
margin: 5px 0;
|
184 |
+
}
|
185 |
+
|
186 |
+
#wpmem_reg .captcha {
|
187 |
+
width: 74%;
|
188 |
+
margin: 5px 0px;
|
189 |
+
}
|
190 |
+
#wpmem_reg .captcha table{
|
191 |
+
line-height: 0px;
|
192 |
+
}
|
193 |
+
#wpmem_login .link-text {
|
194 |
+
width: 74%;
|
195 |
+
margin: 4px 0;
|
196 |
+
text-align: right;
|
197 |
+
}
|
198 |
+
|
199 |
+
#tos {
|
200 |
+
margin-right:5px;
|
201 |
+
}
|
202 |
+
|
203 |
+
|
204 |
+
/* Buttons */
|
205 |
+
|
206 |
+
#wpmem_reg .button_div,
|
207 |
+
#wpmem_login .button_div {
|
208 |
+
width:74%;
|
209 |
+
height: 62px;
|
210 |
+
padding: 6px 0;
|
211 |
+
text-align: right;
|
212 |
+
}
|
213 |
+
|
214 |
+
|
215 |
+
/** for smaller screens */
|
216 |
+
|
217 |
+
@media screen and (max-width: 720px) {
|
218 |
+
#wpmem_reg label.text, #wpmem_reg label.checkbox,
|
219 |
+
#wpmem_reg label.textarea , #wpmem_reg label.select,
|
220 |
+
#wpmem_login label, #wpmem_reg .div_text, #wpmem_reg .div_textarea,
|
221 |
+
#wpmem_reg .div_select, #wpmem_login .div_text,
|
222 |
+
#wpmem_reg .div_checkbox, #wpmem_reg .button_div, #wpmem_login .button_div {
|
223 |
+
float: none;
|
224 |
+
}
|
225 |
+
|
226 |
+
#wpmem_reg label.text, #wpmem_reg label.checkbox,
|
227 |
+
#wpmem_reg label.textarea , #wpmem_reg label.select,
|
228 |
+
#wpmem_login label {
|
229 |
+
width: 90%;
|
230 |
+
padding: 5px 0 0 0;
|
231 |
+
}
|
232 |
+
#wpmem_reg label.textarea {
|
233 |
+
height: 26px;
|
234 |
+
}
|
235 |
+
#wpmem_reg .div_text, #wpmem_reg .div_textarea,
|
236 |
+
#wpmem_reg .div_select, #wpmem_login .div_text,
|
237 |
+
#wpmem_reg .div_checkbox {
|
238 |
+
width: 98%;
|
239 |
+
font-size: 80%;
|
240 |
+
}
|
241 |
+
#wpmem_msg, .wpmem_msg {
|
242 |
+
width: 100%;
|
243 |
+
}
|
244 |
+
|
245 |
+
#wpmem_reg .button_div,
|
246 |
+
#wpmem_login .button_div,
|
247 |
+
#wpmem_login .link-text {
|
248 |
+
width:98%;
|
249 |
+
}
|
250 |
}
|
css/wp-members-2016-no-float.css
ADDED
@@ -0,0 +1,288 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* WP-Members Styles CSS
|
3 |
+
*
|
4 |
+
* CSS for the WP-Members plugin using Twenty Sixteen Theme, no float
|
5 |
+
*
|
6 |
+
* This file is part of the WP-Members plugin by Chad Butler
|
7 |
+
* You can find out more about this plugin at http://rocketgeek.com
|
8 |
+
* Copyright (c) 2006-2015 Chad Butler
|
9 |
+
* WP-Members(tm) is a trademark of butlerblog.com
|
10 |
+
*
|
11 |
+
* @package WordPress
|
12 |
+
* @subpackage WP-Members
|
13 |
+
* @author Chad Butler
|
14 |
+
* @copyright 2006-2015
|
15 |
+
*/
|
16 |
+
|
17 |
+
/*
|
18 |
+
This stylesheet is designed to integrate WP-Members with the Twenty Fourteen theme.
|
19 |
+
There are quite a few examples in here of what you can do to style the forms.
|
20 |
+
You can build off of this or start from scratch and set your own
|
21 |
+
custom css for the plugin (set the location in the admin panel).
|
22 |
+
|
23 |
+
See http://rocketgeek.com/tips-and-tricks/setting-up-a-custom-wp-members-stylesheet/
|
24 |
+
for information on how to set up the plugin with a custom stylesheet.
|
25 |
+
|
26 |
+
For information how to load custom stylesheets with wp_enqueue_style,
|
27 |
+
see http://rocketgeek.com/tips-and-tricks/load-a-custom-stylesheet/
|
28 |
+
*/
|
29 |
+
|
30 |
+
|
31 |
+
/* Error and Dialog Messages */
|
32 |
+
|
33 |
+
#wpmem_msg, .wpmem_msg {
|
34 |
+
background: #F9F9F9;
|
35 |
+
border:1px solid lightGrey;
|
36 |
+
border-radius: 3px;
|
37 |
+
padding: 20px 0 0 0;
|
38 |
+
}
|
39 |
+
#wpmem_msg {
|
40 |
+
width: 100%;
|
41 |
+
}
|
42 |
+
#wpmem_msg h2 {
|
43 |
+
font-family: Montserrat, "Helvetica Neue", sans-serif;
|
44 |
+
}
|
45 |
+
.wpmem_msg {
|
46 |
+
width: 74%;
|
47 |
+
}
|
48 |
+
.wpmem_msg p {
|
49 |
+
margin: 0 0 1.3em;
|
50 |
+
}
|
51 |
+
|
52 |
+
/* Sidebar Login Widget */
|
53 |
+
|
54 |
+
#wp-members {
|
55 |
+
width: 100%;
|
56 |
+
}
|
57 |
+
#wp-members fieldset {
|
58 |
+
border:none;
|
59 |
+
padding:0px
|
60 |
+
}
|
61 |
+
#wp-members label {
|
62 |
+
font-family: Montserrat, "Helvetica Neue", sans-serif;
|
63 |
+
color: #686868;
|
64 |
+
display: block;
|
65 |
+
font-size: 13px;
|
66 |
+
font-size: 0.8125rem;
|
67 |
+
letter-spacing: 0.076923077em;
|
68 |
+
line-height: 1.6153846154;
|
69 |
+
margin-bottom: 0.5384615385em;
|
70 |
+
text-transform: uppercase;
|
71 |
+
}
|
72 |
+
#wp-members input {
|
73 |
+
font-family: Merriweather, Georgia, serif;
|
74 |
+
}
|
75 |
+
#wp-members input[type="text"],
|
76 |
+
#wp-members input[type="password"]{
|
77 |
+
margin: 0 0 4px 0;
|
78 |
+
width: 92%;
|
79 |
+
}
|
80 |
+
#wp-members input[type="submit"] {
|
81 |
+
font-family: Montserrat, "Helvetica Neue", sans-serif;
|
82 |
+
padding: 10px 10px 8px;
|
83 |
+
margin: 0 4px 0 0;
|
84 |
+
}
|
85 |
+
#wp-members .button_div {
|
86 |
+
margin-top:4px;
|
87 |
+
}
|
88 |
+
#wp-members .err {
|
89 |
+
width:92%;
|
90 |
+
padding: 5px;
|
91 |
+
font-family: inherit;
|
92 |
+
border: 1px solid #ccc;
|
93 |
+
border-radius: 3px;
|
94 |
+
}
|
95 |
+
|
96 |
+
|
97 |
+
/* Login Form and Registration Form */
|
98 |
+
|
99 |
+
#wpmem_reg fieldset,
|
100 |
+
#wpmem_login fieldset {
|
101 |
+
border: none;
|
102 |
+
padding: 0;
|
103 |
+
margin: 40px 0;
|
104 |
+
}
|
105 |
+
#wpmem_reg legend,
|
106 |
+
#wpmem_login legend {
|
107 |
+
border-top: 4px solid #1a1a1a;
|
108 |
+
font-family: Montserrat, "Helvetica Neue", sans-serif;
|
109 |
+
font-size: 23px;
|
110 |
+
font-size: 1.4375rem;
|
111 |
+
font-weight: 700;
|
112 |
+
line-height: 1.3125;
|
113 |
+
padding-top: 1.217391304em;
|
114 |
+
padding-bottom: 1.75em;
|
115 |
+
box-sizing: inherit;
|
116 |
+
width: 100%;
|
117 |
+
}
|
118 |
+
#wpmem_reg label,
|
119 |
+
#wpmem_login label {
|
120 |
+
color: #686868;
|
121 |
+
display: block;
|
122 |
+
font-family: Montserrat, "Helvetica Neue", sans-serif;
|
123 |
+
font-size: 13px;
|
124 |
+
font-size: 0.8125rem;
|
125 |
+
letter-spacing: 0.076923077em;
|
126 |
+
line-height: 1.6153846154;
|
127 |
+
margin-bottom: 0.5384615385em;
|
128 |
+
text-transform: uppercase;
|
129 |
+
}
|
130 |
+
#wpmem_reg .form,
|
131 |
+
#wpmem_login .form {
|
132 |
+
margin:0;
|
133 |
+
padding:0;
|
134 |
+
}
|
135 |
+
#wpmem_reg .clear,
|
136 |
+
#wpmem_login .clear {
|
137 |
+
clear:both;
|
138 |
+
}
|
139 |
+
#wpmem_reg .holder,
|
140 |
+
#wpmem_login .holder {
|
141 |
+
background-color:#fff;
|
142 |
+
}
|
143 |
+
#wpmem_login .div_text,
|
144 |
+
#wpmem_reg .div_text,
|
145 |
+
#wpmem_reg .div_textarea,
|
146 |
+
#wpmem_reg .div_select,
|
147 |
+
#wpmem_reg .div_checkbox,
|
148 |
+
#wpmem_reg .div_multicheckbox,
|
149 |
+
#wpmem_reg .div_multiselect,
|
150 |
+
#wpmem_reg .div_radio,
|
151 |
+
#wpmem_reg .div_url,
|
152 |
+
#wpmem_reg .div_file,
|
153 |
+
#wpmem_reg .div_image {
|
154 |
+
width:74%;
|
155 |
+
margin:0 0 14px 0;
|
156 |
+
}
|
157 |
+
#wpmem_login input[type="checkbox"] {
|
158 |
+
margin: 12px 2px;
|
159 |
+
}
|
160 |
+
#wpmem_reg .div_textarea textarea,
|
161 |
+
#wpmem_reg .textbox,
|
162 |
+
#wpmem_reg .username,
|
163 |
+
#wpmem_reg .password,
|
164 |
+
#wpmem_login .textbox,
|
165 |
+
#wpmem_login .username,
|
166 |
+
#wpmem_login .password{
|
167 |
+
width:100%;
|
168 |
+
}
|
169 |
+
#wpmem_reg .dropdown,
|
170 |
+
#wpmem_reg select,
|
171 |
+
#wpmem_reg input[type="file"] {
|
172 |
+
width:100%;
|
173 |
+
padding: 8px 10px 7px;
|
174 |
+
border: 1px solid rgba(0, 0, 0, 0.1);
|
175 |
+
border-radius: 2px;
|
176 |
+
color: rgb(43, 43, 43);
|
177 |
+
margin: 5px 0;
|
178 |
+
}
|
179 |
+
#wpmem_reg .dropdown:focus {
|
180 |
+
border: 1px solid rgba(0, 0, 0, 0.3);
|
181 |
+
outline: 0;
|
182 |
+
}
|
183 |
+
#wpmem_reg .textbox:focus, #wpmem_reg .textbox:hover, #wpmem_login .textbox:focus, #wpmem_login .textbox:hover,
|
184 |
+
#wpmem_reg .username:focus, #wpmem_reg .username:hover, #wpmem_login .username:focus, #wpmem_login .username:hover,
|
185 |
+
#wpmem_reg .password:focus, #wpmem_reg .password:hover, #wpmem_login .password:focus, #wpmem_login .password:hover {
|
186 |
+
background-color:inherit;
|
187 |
+
}
|
188 |
+
#wpmem_reg textarea {
|
189 |
+
height:185px;
|
190 |
+
}
|
191 |
+
#wpmem_reg .req {
|
192 |
+
color: #bd3500;
|
193 |
+
font-size: 22px;
|
194 |
+
line-height: 50%;
|
195 |
+
}
|
196 |
+
|
197 |
+
#wpmem_reg .req-text {
|
198 |
+
margin: 20px 0px 0px 5px;
|
199 |
+
}
|
200 |
+
|
201 |
+
#wpmem_reg .noinput {
|
202 |
+
width:100%;
|
203 |
+
padding: 8px 10px 7px;
|
204 |
+
border: 1px solid rgba(0, 0, 0, 0.1);
|
205 |
+
border-radius: 2px;
|
206 |
+
color: rgb(43, 43, 43);
|
207 |
+
margin: 5px 0;
|
208 |
+
}
|
209 |
+
|
210 |
+
#wpmem_reg .captcha {
|
211 |
+
width: 74%;
|
212 |
+
margin: 5px 0px;
|
213 |
+
}
|
214 |
+
#wpmem_reg .captcha table{
|
215 |
+
line-height: 0px;
|
216 |
+
}
|
217 |
+
#wpmem_login .link-text {
|
218 |
+
width: 74%;
|
219 |
+
text-align:right;
|
220 |
+
}
|
221 |
+
|
222 |
+
#tos {
|
223 |
+
margin-right:5px;
|
224 |
+
}
|
225 |
+
|
226 |
+
|
227 |
+
/* Buttons */
|
228 |
+
|
229 |
+
#wpmem_reg .button_div, #wpmem_login .button_div {
|
230 |
+
width:74%;
|
231 |
+
height:55px;
|
232 |
+
padding: 6px 0;
|
233 |
+
text-align: right;
|
234 |
+
}
|
235 |
+
|
236 |
+
|
237 |
+
/** for smaller screens */
|
238 |
+
|
239 |
+
@media screen and (max-width: 1079px) {
|
240 |
+
#wp-members .button_div {
|
241 |
+
text-align:center;
|
242 |
+
}
|
243 |
+
#wp-members input[type="submit"] {
|
244 |
+
width: 92%;
|
245 |
+
margin: 0 10px 6px 0;
|
246 |
+
}
|
247 |
+
}
|
248 |
+
|
249 |
+
@media screen and (max-width: 1007px) {
|
250 |
+
#wp-members {
|
251 |
+
width: 179px;
|
252 |
+
}
|
253 |
+
#wp-members .button_div {
|
254 |
+
text-align: inherit;
|
255 |
+
}
|
256 |
+
#wp-members input[type="submit"] {
|
257 |
+
width: inherit;
|
258 |
+
margin: 0 4px 0 0;
|
259 |
+
}
|
260 |
+
}
|
261 |
+
|
262 |
+
@media screen and (max-width: 720px) {
|
263 |
+
#wpmem_reg label.text, #wpmem_reg label.checkbox,
|
264 |
+
#wpmem_reg label.textarea , #wpmem_reg label.select,
|
265 |
+
#wpmem_login label, #wpmem_reg .div_text, #wpmem_reg .div_textarea,
|
266 |
+
#wpmem_reg .div_select, #wpmem_login .div_text,
|
267 |
+
#wpmem_reg .div_checkbox, #wpmem_reg .button_div, #wpmem_login .button_div {
|
268 |
+
float: none;
|
269 |
+
}
|
270 |
+
|
271 |
+
#wpmem_reg label.text, #wpmem_reg label.checkbox,
|
272 |
+
#wpmem_reg label.textarea , #wpmem_reg label.select,
|
273 |
+
#wpmem_login label {
|
274 |
+
width: 90%;
|
275 |
+
padding: 5px 0 0 0;
|
276 |
+
}
|
277 |
+
#wpmem_reg label.textarea {
|
278 |
+
height: 26px;
|
279 |
+
}
|
280 |
+
#wpmem_reg .div_text, #wpmem_reg .div_textarea,
|
281 |
+
#wpmem_reg .div_select, #wpmem_login .div_text,
|
282 |
+
#wpmem_reg .div_checkbox {
|
283 |
+
width: 98%;
|
284 |
+
}
|
285 |
+
#wpmem_msg, .wpmem_msg {
|
286 |
+
width: 100%;
|
287 |
+
}
|
288 |
+
}
|
inc/class-wp-members-forms.php
ADDED
@@ -0,0 +1,220 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* The WP_Members Forms Class.
|
4 |
+
*
|
5 |
+
* @package WP-Members
|
6 |
+
* @subpackage WP_Members Forms Object Class
|
7 |
+
* @since 3.1.0
|
8 |
+
*/
|
9 |
+
|
10 |
+
class WP_Members_Forms {
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Plugin initialization function.
|
14 |
+
*
|
15 |
+
* @since 3.1.0
|
16 |
+
*/
|
17 |
+
function __construct() {
|
18 |
+
|
19 |
+
}
|
20 |
+
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Creates form fields
|
24 |
+
*
|
25 |
+
* Creates various form fields and returns them as a string.
|
26 |
+
*
|
27 |
+
* @since 3.1.0
|
28 |
+
*
|
29 |
+
* @param array $args {
|
30 |
+
* @type string $name
|
31 |
+
* @type string $type
|
32 |
+
* @type string $value
|
33 |
+
* @type string $valtochk
|
34 |
+
* @type string $class
|
35 |
+
* @type string $required
|
36 |
+
* }
|
37 |
+
* @return string $str The field returned as a string.
|
38 |
+
*/
|
39 |
+
function create_form_field( $args ) {
|
40 |
+
|
41 |
+
$name = $args['name'];
|
42 |
+
$type = $args['type'];
|
43 |
+
$value = $args['value'];
|
44 |
+
$valtochk = $args['valtochk'];
|
45 |
+
$class = ( isset( $args['class'] ) ) ? $args['class'] : 'textbox';
|
46 |
+
$required = ( isset( $args['required'] ) ) ? $args['required'] : false;
|
47 |
+
|
48 |
+
switch ( $type ) {
|
49 |
+
|
50 |
+
case "url":
|
51 |
+
case "email":
|
52 |
+
$class = ( $class == 'textbox' ) ? "textbox" : $class;
|
53 |
+
$str = "<input name=\"$name\" type=\"$type\" id=\"$name\" value=\"$value\" class=\"$class\"" . ( ( $required ) ? " required " : "" ) . " />";
|
54 |
+
break;
|
55 |
+
|
56 |
+
case "image":
|
57 |
+
case "file":
|
58 |
+
$class = ( $class == 'textbox' ) ? "file" : $class;
|
59 |
+
$str = "<input name=\"$name\" type=\"file\" id=\"$name\" value=\"$value\" class=\"$class\"" . ( ( $required ) ? " required " : "" ) . " />";
|
60 |
+
break;
|
61 |
+
|
62 |
+
case "checkbox":
|
63 |
+
$class = ( $class == 'textbox' ) ? "checkbox" : $class;
|
64 |
+
$str = "<input name=\"$name\" type=\"$type\" id=\"$name\" value=\"$value\"" . checked( $value, $valtochk, false ) . ( ( $required ) ? " required " : "" ) . " />";
|
65 |
+
break;
|
66 |
+
|
67 |
+
case "text":
|
68 |
+
$value = stripslashes( esc_attr( $value ) );
|
69 |
+
$str = "<input name=\"$name\" type=\"$type\" id=\"$name\" value=\"$value\" class=\"$class\"" . ( ( $required ) ? " required " : "" ) . " />";
|
70 |
+
break;
|
71 |
+
|
72 |
+
case "textarea":
|
73 |
+
$value = stripslashes( esc_textarea( $value ) );
|
74 |
+
$class = ( $class == 'textbox' ) ? "textarea" : $class;
|
75 |
+
$str = "<textarea cols=\"20\" rows=\"5\" name=\"$name\" id=\"$name\" class=\"$class\"" . ( ( $required ) ? " required " : "" ) . ">$value</textarea>";
|
76 |
+
break;
|
77 |
+
|
78 |
+
case "password":
|
79 |
+
$str = "<input name=\"$name\" type=\"$type\" id=\"$name\" class=\"$class\"" . ( ( $required ) ? " required " : "" ) . " />";
|
80 |
+
break;
|
81 |
+
|
82 |
+
case "hidden":
|
83 |
+
$str = "<input name=\"$name\" type=\"$type\" value=\"$value\" />";
|
84 |
+
break;
|
85 |
+
|
86 |
+
case "option":
|
87 |
+
$str = "<option value=\"$value\" " . selected( $value, $valtochk, false ) . " >$name</option>";
|
88 |
+
break;
|
89 |
+
|
90 |
+
case "select":
|
91 |
+
case "multiselect":
|
92 |
+
$class = ( 'textbox' == $class ) ? "dropdown" : $class;
|
93 |
+
$class = ( 'multiselect' == $type ) ? "multiselect" : $class;
|
94 |
+
$pname = ( 'multiselect' == $type ) ? $name . "[]" : $name;
|
95 |
+
$str = "<select name=\"$pname\" id=\"$name\" class=\"$class\"" . ( ( 'multiselect' == $type ) ? " multiple " : "" ) . ( ( $required ) ? " required " : "" ) . ">\n";
|
96 |
+
foreach ( $value as $option ) {
|
97 |
+
$pieces = explode( '|', $option );
|
98 |
+
if ( 'multiselect' == $type ) {
|
99 |
+
$chk = '';
|
100 |
+
$values = ( empty( $valtochk ) ) ? array() : ( is_array( $valtochk ) ? $valtochk : explode( '|', $valtochk ) );
|
101 |
+
} else {
|
102 |
+
$chk = $valtochk;
|
103 |
+
$values = array();
|
104 |
+
}
|
105 |
+
$chk = ( ( isset( $pieces[2] ) && '' == $valtochk ) || in_array( $pieces[1], $values ) ) ? $pieces[1] : $chk;
|
106 |
+
$str = $str . "<option value=\"$pieces[1]\"" . selected( $pieces[1], $chk, false ) . ">" . __( $pieces[0], 'wp-members' ) . "</option>\n";
|
107 |
+
}
|
108 |
+
$str = $str . "</select>";
|
109 |
+
break;
|
110 |
+
|
111 |
+
case "multicheckbox":
|
112 |
+
$class = ( $class == 'textbox' ) ? "checkbox" : $class;
|
113 |
+
$str = '';
|
114 |
+
foreach ( $value as $option ) {
|
115 |
+
$pieces = explode( '|', $option );
|
116 |
+
$values = ( empty( $valtochk ) ) ? array() : ( is_array( $valtochk ) ? $valtochk : explode( '|', $valtochk ) );
|
117 |
+
$chk = ( isset( $pieces[2] ) && '' == $valtochk ) ? $pieces[1] : '';
|
118 |
+
$str = $str . $this->create_form_field( array(
|
119 |
+
'name' => $name . '[]',
|
120 |
+
'type' => 'checkbox',
|
121 |
+
'value' => $pieces[1],
|
122 |
+
'valtochk' => ( in_array( $pieces[1], $values ) ) ? $pieces[1] : $chk,
|
123 |
+
) ) . " " . $pieces[0] . "<br />\n";
|
124 |
+
}
|
125 |
+
break;
|
126 |
+
|
127 |
+
case "radio":
|
128 |
+
$class = ( $class == 'textbox' ) ? "radio" : $class;
|
129 |
+
$str = '';
|
130 |
+
$num = 1;
|
131 |
+
foreach ( $value as $option ) {
|
132 |
+
$pieces = explode( '|', $option );
|
133 |
+
$id = $name . '_' . $num;
|
134 |
+
$str = $str . "<input type=\"radio\" name=\"$name\" id=\"$id\" value=\"$pieces[1]\"" . checked( $pieces[1], $valtochk, false ) . ( ( $required ) ? " required " : " " ) . "> " . __( $pieces[0], 'wp-members' ) . "<br />\n";
|
135 |
+
$num++;
|
136 |
+
}
|
137 |
+
break;
|
138 |
+
|
139 |
+
}
|
140 |
+
|
141 |
+
return $str;
|
142 |
+
} // End create_form_field()
|
143 |
+
|
144 |
+
|
145 |
+
/**
|
146 |
+
* Uploads file from the user.
|
147 |
+
*
|
148 |
+
* @since 3.1.0
|
149 |
+
*
|
150 |
+
* @param array $file
|
151 |
+
* @param int $user_id
|
152 |
+
* @return int|bool
|
153 |
+
*/
|
154 |
+
function do_file_upload( $file = array(), $user_id = false ) {
|
155 |
+
|
156 |
+
// Filter the upload directory.
|
157 |
+
add_filter( 'upload_dir', array( &$this,'file_upload_dir' ) );
|
158 |
+
|
159 |
+
// Set up user ID for use in upload process.
|
160 |
+
$this->file_user_id = ( $user_id ) ? $user_id : 0;
|
161 |
+
|
162 |
+
// Get WordPress file upload processing scripts.
|
163 |
+
require_once( ABSPATH . 'wp-admin/includes/file.php' );
|
164 |
+
|
165 |
+
$file_return = wp_handle_upload( $file, array( 'test_form' => false ) );
|
166 |
+
|
167 |
+
if ( isset( $file_return['error'] ) || isset( $file_return['upload_error_handler'] ) ) {
|
168 |
+
return false;
|
169 |
+
} else {
|
170 |
+
|
171 |
+
$attachment = array(
|
172 |
+
'post_mime_type' => $file_return['type'],
|
173 |
+
'post_title' => preg_replace( '/\.[^.]+$/', '', basename( $file_return['file'] ) ),
|
174 |
+
'post_content' => '',
|
175 |
+
'post_status' => 'inherit',
|
176 |
+
'guid' => $file_return['url'],
|
177 |
+
'post_author' => ( $user_id ) ? $user_id : '',
|
178 |
+
);
|
179 |
+
|
180 |
+
$attachment_id = wp_insert_attachment( $attachment, $file_return['url'] );
|
181 |
+
|
182 |
+
require_once( ABSPATH . 'wp-admin/includes/image.php' );
|
183 |
+
$attachment_data = wp_generate_attachment_metadata( $attachment_id, $file_return['file'] );
|
184 |
+
wp_update_attachment_metadata( $attachment_id, $attachment_data );
|
185 |
+
|
186 |
+
if ( 0 < intval( $attachment_id ) ) {
|
187 |
+
// Returns an array with file information.
|
188 |
+
return $attachment_id;
|
189 |
+
}
|
190 |
+
}
|
191 |
+
|
192 |
+
return false;
|
193 |
+
} // End upload_file()
|
194 |
+
|
195 |
+
|
196 |
+
function file_upload_dir( $param ) {
|
197 |
+
$user_id = ( isset( $this->file_user_id ) ) ? $this->file_user_id : null;
|
198 |
+
|
199 |
+
$args = array(
|
200 |
+
'user_id' => $user_id,
|
201 |
+
'wpmem_dir' => 'wpmembers/',
|
202 |
+
'user_dir' => 'user_files/' . $user_id,
|
203 |
+
);
|
204 |
+
/**
|
205 |
+
* Filter the user directory elements.
|
206 |
+
*
|
207 |
+
* @since 3.1.0
|
208 |
+
*
|
209 |
+
* @param array $args
|
210 |
+
*/
|
211 |
+
$args = apply_filters( 'wpmem_user_upload_dir', $args );
|
212 |
+
|
213 |
+
$param['subdir'] = $sub_dir;
|
214 |
+
$param['path'] = $param['basedir'] . '/' . $args['wpmem_dir'] . $args['user_dir'];
|
215 |
+
$param['url'] = $param['baseurl'] . '/' . $args['wpmem_dir'] . $args['user_dir'];
|
216 |
+
|
217 |
+
return $param;
|
218 |
+
}
|
219 |
+
|
220 |
+
} // End of WP_Members_Forms class.
|
inc/class-wp-members-utilities.php
ADDED
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* The WP_Members Utilities Class.
|
4 |
+
*
|
5 |
+
* @package WP-Members
|
6 |
+
* @subpackage WP_Members Utilities Object Class
|
7 |
+
* @since 3.1.0
|
8 |
+
*/
|
9 |
+
|
10 |
+
class WP_Members_Utilities {
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Plugin initialization function.
|
14 |
+
*
|
15 |
+
* @since 3.1.0
|
16 |
+
*/
|
17 |
+
function __construct() {
|
18 |
+
|
19 |
+
}
|
20 |
+
|
21 |
+
/**
|
22 |
+
* Get field keys by meta.
|
23 |
+
*
|
24 |
+
* @since 3.1.0
|
25 |
+
*/
|
26 |
+
function get_field_keys_by_meta() {
|
27 |
+
global $wpmem;
|
28 |
+
$field_keys = array();
|
29 |
+
foreach ( $wpmem->fields as $key => $field ) {
|
30 |
+
$field_keys[ $field[2] ] = $key;
|
31 |
+
}
|
32 |
+
return $field_keys;
|
33 |
+
}
|
34 |
+
|
35 |
+
/**
|
36 |
+
* Get select field display values.
|
37 |
+
*
|
38 |
+
* @since 3.1.0
|
39 |
+
*
|
40 |
+
* @param string $meta_key The field's meta key.
|
41 |
+
* @return array $display_values {
|
42 |
+
* The field's display values in an array.
|
43 |
+
* Elements are stored_value => display value
|
44 |
+
*
|
45 |
+
* @type string The display value.
|
46 |
+
* }
|
47 |
+
*/
|
48 |
+
function get_select_display_values( $meta_key ) {
|
49 |
+
global $wpmem;
|
50 |
+
$keys = $this->get_field_keys_by_meta();
|
51 |
+
$raw = $wpmem->fields[ $keys[ $meta_key ] ][7];
|
52 |
+
$display_values = array();
|
53 |
+
foreach ( $raw as $value ) {
|
54 |
+
$pieces = explode( '|', trim( $value ) );
|
55 |
+
if ( $pieces[1] != '' ) {
|
56 |
+
$display_values[ $pieces[1] ] = $pieces[0];
|
57 |
+
}
|
58 |
+
}
|
59 |
+
return $display_values;
|
60 |
+
}
|
61 |
+
|
62 |
+
} // End of WP_Members_Utilties class.
|
inc/class-wp-members.php
CHANGED
@@ -12,6 +12,21 @@
|
|
12 |
*/
|
13 |
|
14 |
class WP_Members {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
|
16 |
/**
|
17 |
* Plugin initialization function.
|
@@ -37,7 +52,7 @@ class WP_Members {
|
|
37 |
*/
|
38 |
require_once( WPMEM_PATH . 'wp-members-install.php' );
|
39 |
// Update settings.
|
40 |
-
$settings = apply_filters( 'wpmem_settings',
|
41 |
}
|
42 |
|
43 |
// Assemble settings.
|
@@ -49,6 +64,15 @@ class WP_Members {
|
|
49 |
|
50 |
// Set the stylesheet.
|
51 |
$this->cssurl = ( isset( $this->style ) && $this->style == 'use_custom' ) ? $this->cssurl : $this->style;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
}
|
53 |
|
54 |
/**
|
@@ -63,13 +87,14 @@ class WP_Members {
|
|
63 |
*/
|
64 |
require_once( WPMEM_PATH . 'inc/shortcodes.php' );
|
65 |
|
66 |
-
add_shortcode( 'wp-members', 'wpmem_shortcode'
|
67 |
-
add_shortcode( 'wpmem_field', 'wpmem_shortcode'
|
68 |
-
add_shortcode( 'wpmem_logged_in', 'wpmem_sc_logged_in'
|
69 |
-
add_shortcode( 'wpmem_logged_out', 'wpmem_sc_logged_out'
|
70 |
-
add_shortcode( 'wpmem_logout', 'wpmem_shortcode'
|
71 |
-
add_shortcode( 'wpmem_form', 'wpmem_sc_forms'
|
72 |
-
add_shortcode( 'wpmem_show_count', 'wpmem_sc_user_count'
|
|
|
73 |
|
74 |
/**
|
75 |
* Fires after shortcodes load (for adding additional custom shortcodes).
|
@@ -87,7 +112,7 @@ class WP_Members {
|
|
87 |
function load_hooks() {
|
88 |
|
89 |
// Add actions.
|
90 |
-
add_action( '
|
91 |
add_action( 'widgets_init', 'widget_wpmemwidget_init' ); // initializes the widget
|
92 |
add_action( 'admin_init', 'wpmem_chk_admin' ); // check user role to load correct dashboard
|
93 |
add_action( 'admin_menu', 'wpmem_admin_options' ); // adds admin menu
|
@@ -216,7 +241,7 @@ class WP_Members {
|
|
216 |
|
217 |
case 'pwdchange':
|
218 |
$regchk = wpmem_change_password();
|
219 |
-
|
220 |
|
221 |
case 'pwdreset':
|
222 |
$regchk = wpmem_reset_password();
|
@@ -322,6 +347,9 @@ class WP_Members {
|
|
322 |
} else {
|
323 |
$args = array( 'block' => false );
|
324 |
}
|
|
|
|
|
|
|
325 |
|
326 |
/**
|
327 |
* Filter the block boolean.
|
@@ -342,9 +370,8 @@ class WP_Members {
|
|
342 |
*
|
343 |
* @since 3.0.0
|
344 |
*
|
345 |
-
* @global string $wpmem_themsg
|
346 |
-
* @global object $post
|
347 |
-
*
|
348 |
* @param string $content
|
349 |
* @return string $content
|
350 |
*/
|
@@ -499,5 +526,165 @@ class WP_Members {
|
|
499 |
}
|
500 |
}
|
501 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
502 |
|
503 |
-
}
|
12 |
*/
|
13 |
|
14 |
class WP_Members {
|
15 |
+
|
16 |
+
public $version;
|
17 |
+
public $block;
|
18 |
+
public $show_excerpt;
|
19 |
+
public $show_login;
|
20 |
+
public $show_reg;
|
21 |
+
public $autoex;
|
22 |
+
public $notify;
|
23 |
+
public $mod_reg;
|
24 |
+
public $captcha;
|
25 |
+
public $use_exp;
|
26 |
+
public $use_trial;
|
27 |
+
public $warnings;
|
28 |
+
public $user_pages;
|
29 |
+
public $post_types;
|
30 |
|
31 |
/**
|
32 |
* Plugin initialization function.
|
52 |
*/
|
53 |
require_once( WPMEM_PATH . 'wp-members-install.php' );
|
54 |
// Update settings.
|
55 |
+
$settings = apply_filters( 'wpmem_settings', wpmem_upgrade_settings() );
|
56 |
}
|
57 |
|
58 |
// Assemble settings.
|
64 |
|
65 |
// Set the stylesheet.
|
66 |
$this->cssurl = ( isset( $this->style ) && $this->style == 'use_custom' ) ? $this->cssurl : $this->style;
|
67 |
+
|
68 |
+
// Load forms.
|
69 |
+
require_once( WPMEM_PATH . 'inc/class-wp-members-forms.php' );
|
70 |
+
$this->forms = new WP_Members_Forms;
|
71 |
+
|
72 |
+
// Load utilities.
|
73 |
+
require_once( WPMEM_PATH . 'inc/class-wp-members-utilities.php' );
|
74 |
+
$this->utitilies = new WP_Members_Utilities;
|
75 |
+
|
76 |
}
|
77 |
|
78 |
/**
|
87 |
*/
|
88 |
require_once( WPMEM_PATH . 'inc/shortcodes.php' );
|
89 |
|
90 |
+
add_shortcode( 'wp-members', 'wpmem_shortcode' );
|
91 |
+
add_shortcode( 'wpmem_field', 'wpmem_shortcode' );
|
92 |
+
add_shortcode( 'wpmem_logged_in', 'wpmem_sc_logged_in' );
|
93 |
+
add_shortcode( 'wpmem_logged_out', 'wpmem_sc_logged_out' );
|
94 |
+
add_shortcode( 'wpmem_logout', 'wpmem_shortcode' );
|
95 |
+
add_shortcode( 'wpmem_form', 'wpmem_sc_forms' );
|
96 |
+
add_shortcode( 'wpmem_show_count', 'wpmem_sc_user_count' );
|
97 |
+
add_shortcode( 'wpmem_profile', 'wpmem_sc_user_profile' );
|
98 |
|
99 |
/**
|
100 |
* Fires after shortcodes load (for adding additional custom shortcodes).
|
112 |
function load_hooks() {
|
113 |
|
114 |
// Add actions.
|
115 |
+
add_action( 'template_redirect', array( $this, 'get_action' ) );
|
116 |
add_action( 'widgets_init', 'widget_wpmemwidget_init' ); // initializes the widget
|
117 |
add_action( 'admin_init', 'wpmem_chk_admin' ); // check user role to load correct dashboard
|
118 |
add_action( 'admin_menu', 'wpmem_admin_options' ); // adds admin menu
|
241 |
|
242 |
case 'pwdchange':
|
243 |
$regchk = wpmem_change_password();
|
244 |
+
break;
|
245 |
|
246 |
case 'pwdreset':
|
247 |
$regchk = wpmem_reset_password();
|
347 |
} else {
|
348 |
$args = array( 'block' => false );
|
349 |
}
|
350 |
+
|
351 |
+
// Don't block user pages.
|
352 |
+
$args['block'] = ( in_array( get_permalink(), $this->user_pages ) ) ? false : $args['block'];
|
353 |
|
354 |
/**
|
355 |
* Filter the block boolean.
|
370 |
*
|
371 |
* @since 3.0.0
|
372 |
*
|
373 |
+
* @global string $wpmem_themsg Contains messages to be output.
|
374 |
+
* @global object $post The WordPress Post object.
|
|
|
375 |
* @param string $content
|
376 |
* @return string $content
|
377 |
*/
|
526 |
}
|
527 |
}
|
528 |
}
|
529 |
+
|
530 |
+
|
531 |
+
/**
|
532 |
+
* Returns a requested text string.
|
533 |
+
*
|
534 |
+
* This function manages all of the front-end facing text.
|
535 |
+
* All defaults can be filtered using wpmem_default_text_strings.
|
536 |
+
*
|
537 |
+
* @since 3.1.0
|
538 |
+
*
|
539 |
+
* @param string $str
|
540 |
+
* @return string $text
|
541 |
+
*/
|
542 |
+
function get_text( $str ) {
|
543 |
+
|
544 |
+
// Default Form Fields.
|
545 |
+
$default_form_fields = array(
|
546 |
+
'first_name' => __( 'First Name', 'wp-members' ),
|
547 |
+
'last_name' => __( 'Last Name', 'wp-members' ),
|
548 |
+
'addr1' => __( 'Address 1', 'wp-members' ),
|
549 |
+
'addr2' => __( 'Address 2', 'wp-members' ),
|
550 |
+
'city' => __( 'City', 'wp-members' ),
|
551 |
+
'thestate' => __( 'State', 'wp-members' ),
|
552 |
+
'zip' => __( 'Zip', 'wp-members' ),
|
553 |
+
'country' => __( 'Country', 'wp-members' ),
|
554 |
+
'phone1' => __( 'Day Phone', 'wp-members' ),
|
555 |
+
'user_email' => __( 'Email', 'wp-members' ),
|
556 |
+
'confirm_email' => __( 'Confirm Email', 'wp-members' ),
|
557 |
+
'user_url' => __( 'Website', 'wp-members' ),
|
558 |
+
'description' => __( 'Biographical Info', 'wp-members' ),
|
559 |
+
'password' => __( 'Password', 'wp-members' ),
|
560 |
+
'confirm_password' => __( 'Confirm Password', 'wp-members' ),
|
561 |
+
'tos' => __( 'TOS', 'wp-members' ),
|
562 |
+
);
|
563 |
+
|
564 |
+
$defaults = array(
|
565 |
+
|
566 |
+
// Login form.
|
567 |
+
'login_heading' => __( 'Existing Users Log In', 'wp-members' ),
|
568 |
+
'login_username' => __( 'Username' ),
|
569 |
+
'login_password' => __( 'Password' ),
|
570 |
+
'login_button' => __( 'Log In' ),
|
571 |
+
'remember_me' => __( 'Remember Me' ),
|
572 |
+
'forgot_link_before' => __( 'Forgot password?', 'wp-members' ) . ' ',
|
573 |
+
'forgot_link' => __( 'Click here to reset', 'wp-members' ),
|
574 |
+
'register_link_before' => __( 'New User?', 'wp-members' ) . ' ',
|
575 |
+
'register_link' => __( 'Click here to register', 'wp-members' ),
|
576 |
+
'username_link_before' => __( 'Forgot username?', 'wp-members' ) . ' ',
|
577 |
+
'username_link' => __( 'Click here', 'wp-members' ),
|
578 |
+
|
579 |
+
// Password change form.
|
580 |
+
'pwdchg_heading' => __( 'Change Password', 'wp-members' ),
|
581 |
+
'pwdchg_password1' => __( 'New password' ),
|
582 |
+
'pwdchg_password2' => __( 'Confirm new password' ),
|
583 |
+
'pwdchg_button' => __( 'Update Password', 'wp-members' ),
|
584 |
+
|
585 |
+
// Password reset form.
|
586 |
+
'pwdreset_heading' => __( 'Reset Forgotten Password', 'wp-members' ),
|
587 |
+
'pwdreset_username' => __( 'Username' ),
|
588 |
+
'pwdreset_email' => __( 'Email' ),
|
589 |
+
'pwdreset_button' => __( 'Reset Password' ),
|
590 |
+
|
591 |
+
// Retrieve username form.
|
592 |
+
'username_heading' => __( 'Retrieve username', 'wp-members' ),
|
593 |
+
'username_email' => __( 'Email Address', 'wp-members' ),
|
594 |
+
'username_button' => __( 'Retrieve username', 'wp-members' ),
|
595 |
+
|
596 |
+
// Register form.
|
597 |
+
'register_heading' => __( 'New User Registration', 'wp-members' ),
|
598 |
+
'register_username' => __( 'Choose a Username', 'wp-members' ),
|
599 |
+
'register_rscaptcha' => __( 'Input the code:', 'wp-members' ),
|
600 |
+
'register_tos' => __( 'Please indicate that you agree to the %s TOS %s', 'wp-members' ),
|
601 |
+
'register_clear' => __( 'Reset Form', 'wp-members' ),
|
602 |
+
'register_submit' => __( 'Register' ),
|
603 |
+
'register_req_mark' => '<span class="req">*</span>',
|
604 |
+
'register_required' => '<span class="req">*</span>' . __( 'Required field', 'wp-members' ),
|
605 |
+
|
606 |
+
// User profile update form.
|
607 |
+
'profile_heading' => __( 'Edit Your Information', 'wp-members' ),
|
608 |
+
'profile_username' => __( 'Username' ),
|
609 |
+
'profile_submit' => __( 'Update Profile', 'wp-members' ),
|
610 |
+
'profile_upload' => __( 'Update this file', 'wp-members' ),
|
611 |
+
|
612 |
+
// Error messages and dialogs.
|
613 |
+
'login_failed_heading' => __( 'Login Failed!', 'wp-members' ),
|
614 |
+
'login_failed' => __( 'You entered an invalid username or password.', 'wp-members' ),
|
615 |
+
'login_failed_link' => __( 'Click here to continue.', 'wp-members' ),
|
616 |
+
'pwdchangempty' => __( 'Password fields cannot be empty', 'wp-members' ),
|
617 |
+
'usernamefailed' => __( 'Sorry, that email address was not found.', 'wp-members' ),
|
618 |
+
'usernamesuccess' => __( 'An email was sent to %s with your username.', 'wp-members' ),
|
619 |
+
'reg_empty_field' => __( 'Sorry, %s is a required field.', 'wp-members' ),
|
620 |
+
'reg_valid_email' => __( 'You must enter a valid email address.', 'wp-members' ),
|
621 |
+
'reg_non_alphanumeric' => __( 'The username cannot include non-alphanumeric characters.', 'wp-members' ),
|
622 |
+
'reg_empty_username' => __( 'Sorry, username is a required field', 'wp-members' ),
|
623 |
+
'reg_password_match' => __( 'Passwords did not match.', 'wp-members' ),
|
624 |
+
'reg_email_match' => __( 'Emails did not match.', 'wp-members' ),
|
625 |
+
'reg_empty_captcha' => __( 'You must complete the CAPTCHA form.', 'wp-members' ),
|
626 |
+
'reg_invalid_captcha' => __( 'CAPTCHA was not valid.', 'wp-members' ),
|
627 |
+
|
628 |
+
// Links.
|
629 |
+
'profile_edit' => __( 'Edit My Information', 'wp-members' ),
|
630 |
+
'profile_password' => __( 'Change Password', 'wp-members' ),
|
631 |
+
'register_status' => __( 'You are logged in as %s', 'wp-members' ),
|
632 |
+
'register_logout' => __( 'Click to log out.', 'wp-members' ),
|
633 |
+
'register_continue' => __( 'Begin using the site.', 'wp-members' ),
|
634 |
+
'login_welcome' => __( 'You are logged in as %s', 'wp-members' ),
|
635 |
+
'login_logout' => __( 'Click to log out', 'wp-members' ),
|
636 |
+
'status_welcome' => __( 'You are logged in as %s', 'wp-members' ),
|
637 |
+
'status_logout' => __( 'click to log out', 'wp-members' ),
|
638 |
+
|
639 |
+
// Widget.
|
640 |
+
'sb_status' => __( 'You are logged in as %s', 'wp-members' ),
|
641 |
+
'sb_logout' => __( 'click here to log out', 'wp-members' ),
|
642 |
+
'sb_login_failed' => __( 'Login Failed!<br />You entered an invalid username or password.', 'wp-members' ),
|
643 |
+
'sb_not_logged_in' => __( 'You are not logged in.', 'wp-members' ),
|
644 |
+
'sb_login_username' => __( 'Username' ),
|
645 |
+
'sb_login_password' => __( 'Password' ),
|
646 |
+
'sb_login_button' => __( 'log in', 'wp-members' ),
|
647 |
+
'sb_login_forgot' => __( 'Forgot?', 'wp-members' ),
|
648 |
+
'sb_login_register' => __( 'Register' ),
|
649 |
+
|
650 |
+
// Default Dialogs.
|
651 |
+
'restricted_msg' => __( "This content is restricted to site members. If you are an existing user, please log in. New users may register below.", 'wp-members' ),
|
652 |
+
'user' => __( "Sorry, that username is taken, please try another.", 'wp-members' ),
|
653 |
+
'email' => __( "Sorry, that email address already has an account.<br />Please try another.", 'wp-members' ),
|
654 |
+
'success' => __( "Congratulations! Your registration was successful.<br /><br />You may now log in using the password that was emailed to you.", 'wp-members' ),
|
655 |
+
'editsuccess' => __( "Your information was updated!", 'wp-members' ),
|
656 |
+
'pwdchangerr' => __( "Passwords did not match.<br /><br />Please try again.", 'wp-members' ),
|
657 |
+
'pwdchangesuccess' => __( "Password successfully changed!", 'wp-members' ),
|
658 |
+
'pwdreseterr' => __( "Either the username or email address do not exist in our records.", 'wp-members' ),
|
659 |
+
'pwdresetsuccess' => __( "Password successfully reset!<br /><br />An email containing a new password has been sent to the email address on file for your account.", 'wp-members' ),
|
660 |
+
|
661 |
+
); // End of $defaults array.
|
662 |
+
|
663 |
+
/**
|
664 |
+
* Filter default terms.
|
665 |
+
*
|
666 |
+
* @since 3.1.0
|
667 |
+
*/
|
668 |
+
$text = apply_filters( 'wpmem_default_text_strings', '' );
|
669 |
+
|
670 |
+
// Merge filtered $terms with $defaults.
|
671 |
+
$text = wp_parse_args( $text, $defaults );
|
672 |
+
|
673 |
+
// Return the requested text string.
|
674 |
+
return $text[ $str ];
|
675 |
+
|
676 |
+
} // End of get_text().
|
677 |
+
|
678 |
+
|
679 |
+
/**
|
680 |
+
* Load the admin api.
|
681 |
+
*
|
682 |
+
* @since 3.1.0
|
683 |
+
*/
|
684 |
+
function load_admin_api() {
|
685 |
+
if ( is_admin() ) {
|
686 |
+
$this->admin = new WP_Members_Admin_API;
|
687 |
+
}
|
688 |
+
}
|
689 |
|
690 |
+
} // End of WP_Members class.
|
inc/core.php
CHANGED
@@ -499,7 +499,7 @@ function wpmem_wp_reg_validate( $errors, $sanitized_user_login, $user_email ) {
|
|
499 |
if ( ( $field[3] != 'checkbox' ) && ( ! $_POST[ $field[2] ] ) ) {
|
500 |
$is_error = true;
|
501 |
}
|
502 |
-
if ( $is_error ) { $errors->add( 'wpmem_error', sprintf(
|
503 |
}
|
504 |
}
|
505 |
|
@@ -614,7 +614,7 @@ function wpmem_redirect_to_login() {
|
|
614 |
$current_page = home_url( add_query_arg( array(), $wp->request ) );
|
615 |
$redirect_to = urlencode( $current_page );
|
616 |
|
617 |
-
$url =
|
618 |
|
619 |
wp_redirect( $url );
|
620 |
exit();
|
499 |
if ( ( $field[3] != 'checkbox' ) && ( ! $_POST[ $field[2] ] ) ) {
|
500 |
$is_error = true;
|
501 |
}
|
502 |
+
if ( $is_error ) { $errors->add( 'wpmem_error', sprintf( $wpmem->get_text( 'reg_empty_field' ), __( $field[1], 'wp-members' ) ) ); }
|
503 |
}
|
504 |
}
|
505 |
|
614 |
$current_page = home_url( add_query_arg( array(), $wp->request ) );
|
615 |
$redirect_to = urlencode( $current_page );
|
616 |
|
617 |
+
$url = add_query_arg( 'redirect_to', $redirect_to, $wpmem->user_pages['login'] );
|
618 |
|
619 |
wp_redirect( $url );
|
620 |
exit();
|
inc/dialogs.php
CHANGED
@@ -34,21 +34,24 @@ if ( ! function_exists( 'wpmem_inc_loginfailed' ) ):
|
|
34 |
*
|
35 |
* @since 1.8
|
36 |
*
|
37 |
-
* @
|
|
|
38 |
*/
|
39 |
function wpmem_inc_loginfailed() {
|
|
|
|
|
40 |
|
41 |
// Defaults.
|
42 |
$defaults = array(
|
43 |
'div_before' => '<div align="center" id="wpmem_msg">',
|
44 |
'div_after' => '</div>',
|
45 |
'heading_before' => '<h2>',
|
46 |
-
'heading' =>
|
47 |
'heading_after' => '</h2>',
|
48 |
'p_before' => '<p>',
|
49 |
-
'message' =>
|
50 |
'p_after' => '</p>',
|
51 |
-
'link' => '<a href="' . $_SERVER['REQUEST_URI'] . '">' .
|
52 |
);
|
53 |
|
54 |
/**
|
@@ -72,7 +75,7 @@ function wpmem_inc_loginfailed() {
|
|
72 |
/**
|
73 |
* Filter the login failed dialog.
|
74 |
*
|
75 |
-
* @since
|
76 |
*
|
77 |
* @param string $str The login failed dialog.
|
78 |
*/
|
@@ -91,11 +94,14 @@ if ( ! function_exists( 'wpmem_inc_regmessage' ) ):
|
|
91 |
*
|
92 |
* @since 1.8
|
93 |
*
|
|
|
94 |
* @param string $toggle Error message toggle to look for specific error messages.
|
95 |
* @param string $msg A message that has no toggle that is passed directly to the function.
|
96 |
* @return string $str The final HTML for the message.
|
97 |
*/
|
98 |
function wpmem_inc_regmessage( $toggle, $msg = '' ) {
|
|
|
|
|
99 |
|
100 |
// defaults
|
101 |
$defaults = array(
|
@@ -128,8 +134,12 @@ function wpmem_inc_regmessage( $toggle, $msg = '' ) {
|
|
128 |
$dialogs = get_option( 'wpmembers_dialogs' );
|
129 |
|
130 |
for ( $r = 0; $r < count( $defaults['toggles'] ); $r++ ) {
|
131 |
-
if ( $toggle == $defaults['toggles'][$r] ) {
|
132 |
-
|
|
|
|
|
|
|
|
|
133 |
break;
|
134 |
}
|
135 |
}
|
@@ -153,11 +163,13 @@ function wpmem_inc_regmessage( $toggle, $msg = '' ) {
|
|
153 |
/**
|
154 |
* Filter the message.
|
155 |
*
|
156 |
-
* @since
|
|
|
157 |
*
|
158 |
-
* @param string $str
|
|
|
159 |
*/
|
160 |
-
return apply_filters( 'wpmem_msg_dialog', $str );
|
161 |
|
162 |
}
|
163 |
endif;
|
@@ -171,36 +183,37 @@ if ( ! function_exists( 'wpmem_inc_memberlinks' ) ):
|
|
171 |
*
|
172 |
* @since 2.0
|
173 |
*
|
|
|
|
|
174 |
* @param string $page
|
175 |
* @return string $str
|
176 |
*/
|
177 |
-
function wpmem_inc_memberlinks( $page = '
|
178 |
|
179 |
global $user_login, $wpmem;
|
180 |
|
181 |
-
$link = wpmem_chk_qstr();
|
182 |
-
|
183 |
/**
|
184 |
* Filter the log out link.
|
185 |
*
|
186 |
* @since 2.8.3
|
187 |
*
|
188 |
-
* @param string
|
189 |
*/
|
190 |
-
$logout = apply_filters( 'wpmem_logout_link',
|
191 |
|
192 |
switch ( $page ) {
|
193 |
|
194 |
-
case '
|
195 |
|
196 |
$arr = array(
|
197 |
'before_wrapper' => '',
|
198 |
'wrapper_before' => '<ul>',
|
199 |
'wrapper_after' => '</ul>',
|
200 |
'rows' => array(
|
201 |
-
'<li><a href="' .
|
202 |
-
'<li><a href="' .
|
203 |
),
|
|
|
204 |
);
|
205 |
|
206 |
if ( defined( 'WPMEM_EXP_MODULE' ) && $wpmem->use_exp == 1 && function_exists( 'wpmem_user_page_detail' ) ) {
|
@@ -211,6 +224,7 @@ function wpmem_inc_memberlinks( $page = 'members' ) {
|
|
211 |
* Filter the member links array.
|
212 |
*
|
213 |
* @since 3.0.9
|
|
|
214 |
*
|
215 |
* @param array $arr {
|
216 |
* The components of the links.
|
@@ -219,9 +233,10 @@ function wpmem_inc_memberlinks( $page = 'members' ) {
|
|
219 |
* @type string $wrapper_before The wrapper opening tag (default: <ul>).
|
220 |
* @type string $wrapper_after The wrapper closing tag (default: </ul>).
|
221 |
* @type array $rows Row items HTML.
|
|
|
222 |
* }
|
223 |
*/
|
224 |
-
$arr = apply_filters(
|
225 |
|
226 |
$str = $arr['before_wrapper'];
|
227 |
$str.= $arr['wrapper_before'];
|
@@ -229,6 +244,7 @@ function wpmem_inc_memberlinks( $page = 'members' ) {
|
|
229 |
$str.= $row;
|
230 |
}
|
231 |
$str.= $arr['wrapper_after'];
|
|
|
232 |
|
233 |
/**
|
234 |
* Filter the links displayed on the User Profile page (logged in state).
|
@@ -237,25 +253,27 @@ function wpmem_inc_memberlinks( $page = 'members' ) {
|
|
237 |
*
|
238 |
* @param string $str The default links.
|
239 |
*/
|
240 |
-
$str = apply_filters(
|
241 |
break;
|
242 |
|
243 |
case 'register':
|
244 |
|
245 |
$arr = array(
|
246 |
-
'before_wrapper' => '<p>' . sprintf(
|
247 |
'wrapper_before' => '<ul>',
|
248 |
'wrapper_after' => '</ul>',
|
249 |
'rows' => array(
|
250 |
-
'<li><a href="' . $logout . '">' .
|
251 |
-
'<li><a href="' . get_option('home') . '">' .
|
252 |
),
|
|
|
253 |
);
|
254 |
|
255 |
/**
|
256 |
* Filter the register links array.
|
257 |
*
|
258 |
* @since 3.0.9
|
|
|
259 |
*
|
260 |
* @param array $arr {
|
261 |
* The components of the links.
|
@@ -264,9 +282,10 @@ function wpmem_inc_memberlinks( $page = 'members' ) {
|
|
264 |
* @type string $wrapper_before The wrapper opening tag (default: <ul>).
|
265 |
* @type string $wrapper_after The wrapper closing tag (default: </ul>).
|
266 |
* @type array $rows Row items HTML.
|
|
|
267 |
* }
|
268 |
*/
|
269 |
-
$arr = apply_filters(
|
270 |
|
271 |
$str = $arr['before_wrapper'];
|
272 |
$str.= $arr['wrapper_before'];
|
@@ -274,6 +293,7 @@ function wpmem_inc_memberlinks( $page = 'members' ) {
|
|
274 |
$str.= $row;
|
275 |
}
|
276 |
$str.= $arr['wrapper_after'];
|
|
|
277 |
|
278 |
/**
|
279 |
* Filter the links displayed on the Register page (logged in state).
|
@@ -282,7 +302,7 @@ function wpmem_inc_memberlinks( $page = 'members' ) {
|
|
282 |
*
|
283 |
* @param string $str The default links.
|
284 |
*/
|
285 |
-
$str = apply_filters(
|
286 |
break;
|
287 |
|
288 |
case 'login':
|
@@ -291,8 +311,8 @@ function wpmem_inc_memberlinks( $page = 'members' ) {
|
|
291 |
'wrapper_before' => '<p>',
|
292 |
'wrapper_after' => '</p>',
|
293 |
'user_login' => $user_login,
|
294 |
-
'welcome' =>
|
295 |
-
'logout_text' =>
|
296 |
'logout_link' => '<a href="' . $logout . '">%s</a>',
|
297 |
'separator' => '<br />',
|
298 |
);
|
@@ -303,7 +323,7 @@ function wpmem_inc_memberlinks( $page = 'members' ) {
|
|
303 |
*
|
304 |
* @param array $args.
|
305 |
*/
|
306 |
-
$args = apply_filters(
|
307 |
|
308 |
// Assemble the message string.
|
309 |
$str = $args['wrapper_before']
|
@@ -319,7 +339,7 @@ function wpmem_inc_memberlinks( $page = 'members' ) {
|
|
319 |
*
|
320 |
* @param string $str The default links.
|
321 |
*/
|
322 |
-
$str = apply_filters(
|
323 |
break;
|
324 |
|
325 |
case 'status':
|
@@ -327,8 +347,8 @@ function wpmem_inc_memberlinks( $page = 'members' ) {
|
|
327 |
'wrapper_before' => '<p>',
|
328 |
'wrapper_after' => '</p>',
|
329 |
'user_login' => $user_login,
|
330 |
-
'welcome' =>
|
331 |
-
'logout_text' =>
|
332 |
'logout_link' => '<a href="' . $logout . '">%s</a>',
|
333 |
'separator' => ' | ',
|
334 |
);
|
@@ -365,18 +385,21 @@ if ( ! function_exists( 'wpmem_page_pwd_reset' ) ):
|
|
365 |
*
|
366 |
* @since 2.7.6
|
367 |
*
|
|
|
368 |
* @param string $wpmem_regchk
|
369 |
* @param string $content
|
370 |
* @return string $content
|
371 |
*/
|
372 |
function wpmem_page_pwd_reset( $wpmem_regchk, $content ) {
|
|
|
|
|
373 |
|
374 |
if ( is_user_logged_in() ) {
|
375 |
|
376 |
switch ( $wpmem_regchk ) {
|
377 |
|
378 |
case "pwdchangempty":
|
379 |
-
$content = wpmem_inc_regmessage( $wpmem_regchk,
|
380 |
$content = $content . wpmem_inc_changepassword();
|
381 |
break;
|
382 |
|
@@ -395,24 +418,33 @@ function wpmem_page_pwd_reset( $wpmem_regchk, $content ) {
|
|
395 |
}
|
396 |
|
397 |
} else {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
398 |
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
|
|
|
|
416 |
}
|
417 |
|
418 |
}
|
@@ -429,13 +461,16 @@ if ( ! function_exists( 'wpmem_page_user_edit' ) ):
|
|
429 |
*
|
430 |
* @since 2.7.6
|
431 |
*
|
|
|
|
|
|
|
432 |
* @param string $wpmem_regchk
|
433 |
* @param string $content
|
434 |
* @return string $content
|
435 |
*/
|
436 |
function wpmem_page_user_edit( $wpmem_regchk, $content ) {
|
437 |
|
438 |
-
global $wpmem_a, $wpmem_themsg;
|
439 |
/**
|
440 |
* Filter the default User Edit heading for shortcode.
|
441 |
*
|
@@ -443,7 +478,7 @@ function wpmem_page_user_edit( $wpmem_regchk, $content ) {
|
|
443 |
*
|
444 |
* @param string The default edit mode heading.
|
445 |
*/
|
446 |
-
$heading = apply_filters( 'wpmem_user_edit_heading',
|
447 |
|
448 |
if ( $wpmem_a == "update") { $content.= wpmem_inc_regmessage( $wpmem_regchk, $wpmem_themsg ); }
|
449 |
$content = $content . wpmem_inc_registration( 'edit', $heading );
|
@@ -472,7 +507,7 @@ function wpmem_page_forgot_username( $wpmem_regchk, $content ) {
|
|
472 |
switch( $wpmem->regchk ) {
|
473 |
|
474 |
case "usernamefailed":
|
475 |
-
$msg =
|
476 |
$content = $content
|
477 |
. wpmem_inc_regmessage( 'usernamefailed', $msg )
|
478 |
. wpmem_inc_forgotusername();
|
@@ -481,7 +516,7 @@ function wpmem_page_forgot_username( $wpmem_regchk, $content ) {
|
|
481 |
|
482 |
case "usernamesuccess":
|
483 |
$email = ( isset( $_POST['user_email'] ) ) ? $_POST['user_email'] : '';
|
484 |
-
$msg = sprintf(
|
485 |
$content = $content . wpmem_inc_regmessage( 'usernamesuccess', $msg );
|
486 |
$wpmem->regchk = ''; // Clear regchk.
|
487 |
break;
|
@@ -505,14 +540,17 @@ function wpmem_page_forgot_username( $wpmem_regchk, $content ) {
|
|
505 |
*
|
506 |
* @since 3.0.8
|
507 |
*
|
508 |
-
* @
|
|
|
509 |
*/
|
510 |
function wpmem_inc_forgotusername() {
|
|
|
|
|
511 |
|
512 |
// create the default inputs
|
513 |
$default_inputs = array(
|
514 |
array(
|
515 |
-
'name' =>
|
516 |
'type' => 'text',
|
517 |
'tag' => 'user_email',
|
518 |
'class' => 'username',
|
@@ -530,9 +568,9 @@ function wpmem_inc_forgotusername() {
|
|
530 |
$default_inputs = apply_filters( 'wpmem_inc_forgotusername_inputs', $default_inputs );
|
531 |
|
532 |
$defaults = array(
|
533 |
-
'heading' =>
|
534 |
'action' => 'getusername',
|
535 |
-
'button_text' =>
|
536 |
'inputs' => $default_inputs,
|
537 |
);
|
538 |
|
34 |
*
|
35 |
* @since 1.8
|
36 |
*
|
37 |
+
* @global object $wpmem The WP_Members object.
|
38 |
+
* @return string $str The generated html for the login failed message.
|
39 |
*/
|
40 |
function wpmem_inc_loginfailed() {
|
41 |
+
|
42 |
+
global $wpmem;
|
43 |
|
44 |
// Defaults.
|
45 |
$defaults = array(
|
46 |
'div_before' => '<div align="center" id="wpmem_msg">',
|
47 |
'div_after' => '</div>',
|
48 |
'heading_before' => '<h2>',
|
49 |
+
'heading' => $wpmem->get_text( 'login_failed_heading' ),
|
50 |
'heading_after' => '</h2>',
|
51 |
'p_before' => '<p>',
|
52 |
+
'message' => $wpmem->get_text( 'login_failed' ),
|
53 |
'p_after' => '</p>',
|
54 |
+
'link' => '<a href="' . $_SERVER['REQUEST_URI'] . '">' . $wpmem->get_text( 'login_failed_link' ) . '</a>',
|
55 |
);
|
56 |
|
57 |
/**
|
75 |
/**
|
76 |
* Filter the login failed dialog.
|
77 |
*
|
78 |
+
* @since 2.7.3
|
79 |
*
|
80 |
* @param string $str The login failed dialog.
|
81 |
*/
|
94 |
*
|
95 |
* @since 1.8
|
96 |
*
|
97 |
+
* @global object $wpmem
|
98 |
* @param string $toggle Error message toggle to look for specific error messages.
|
99 |
* @param string $msg A message that has no toggle that is passed directly to the function.
|
100 |
* @return string $str The final HTML for the message.
|
101 |
*/
|
102 |
function wpmem_inc_regmessage( $toggle, $msg = '' ) {
|
103 |
+
|
104 |
+
global $wpmem;
|
105 |
|
106 |
// defaults
|
107 |
$defaults = array(
|
134 |
$dialogs = get_option( 'wpmembers_dialogs' );
|
135 |
|
136 |
for ( $r = 0; $r < count( $defaults['toggles'] ); $r++ ) {
|
137 |
+
if ( $toggle == $defaults['toggles'][ $r ] ) {
|
138 |
+
if ( $dialogs[ $r+1 ] == $wpmem->get_text( $toggle ) ) {
|
139 |
+
$msg = $wpmem->get_text( $toggle );
|
140 |
+
} else {
|
141 |
+
$msg = __( stripslashes( $dialogs[ $r+1 ] ), 'wp-members' );
|
142 |
+
}
|
143 |
break;
|
144 |
}
|
145 |
}
|
163 |
/**
|
164 |
* Filter the message.
|
165 |
*
|
166 |
+
* @since 2.7.4
|
167 |
+
* @since 3.1.0 Added $toggle.
|
168 |
*
|
169 |
+
* @param string $str The message.
|
170 |
+
* @param string $toggle The toggle of the message being displayed.
|
171 |
*/
|
172 |
+
return apply_filters( 'wpmem_msg_dialog', $str, $toggle );
|
173 |
|
174 |
}
|
175 |
endif;
|
183 |
*
|
184 |
* @since 2.0
|
185 |
*
|
186 |
+
* @gloabl $user_login
|
187 |
+
* @global object $wpmem
|
188 |
* @param string $page
|
189 |
* @return string $str
|
190 |
*/
|
191 |
+
function wpmem_inc_memberlinks( $page = 'member' ) {
|
192 |
|
193 |
global $user_login, $wpmem;
|
194 |
|
|
|
|
|
195 |
/**
|
196 |
* Filter the log out link.
|
197 |
*
|
198 |
* @since 2.8.3
|
199 |
*
|
200 |
+
* @param string The default logout link.
|
201 |
*/
|
202 |
+
$logout = apply_filters( 'wpmem_logout_link', add_query_arg( 'a', 'logout' ) );
|
203 |
|
204 |
switch ( $page ) {
|
205 |
|
206 |
+
case 'member':
|
207 |
|
208 |
$arr = array(
|
209 |
'before_wrapper' => '',
|
210 |
'wrapper_before' => '<ul>',
|
211 |
'wrapper_after' => '</ul>',
|
212 |
'rows' => array(
|
213 |
+
'<li><a href="' . add_query_arg( 'a', 'edit' ) . '">' . $wpmem->get_text( 'profile_edit' ) . '</a></li>',
|
214 |
+
'<li><a href="' . add_query_arg( 'a', 'pwdchange' ) . '">' . $wpmem->get_text( 'profile_password' ) . '</a></li>',
|
215 |
),
|
216 |
+
'after_wrapper' => '',
|
217 |
);
|
218 |
|
219 |
if ( defined( 'WPMEM_EXP_MODULE' ) && $wpmem->use_exp == 1 && function_exists( 'wpmem_user_page_detail' ) ) {
|
224 |
* Filter the member links array.
|
225 |
*
|
226 |
* @since 3.0.9
|
227 |
+
* @since 3.1.0 Added after_wrapper
|
228 |
*
|
229 |
* @param array $arr {
|
230 |
* The components of the links.
|
233 |
* @type string $wrapper_before The wrapper opening tag (default: <ul>).
|
234 |
* @type string $wrapper_after The wrapper closing tag (default: </ul>).
|
235 |
* @type array $rows Row items HTML.
|
236 |
+
* @type string $after_wrapper Anything that comes after the wrapper.
|
237 |
* }
|
238 |
*/
|
239 |
+
$arr = apply_filters( "wpmem_{$page}_links_args", $arr );
|
240 |
|
241 |
$str = $arr['before_wrapper'];
|
242 |
$str.= $arr['wrapper_before'];
|
244 |
$str.= $row;
|
245 |
}
|
246 |
$str.= $arr['wrapper_after'];
|
247 |
+
$str.= $arr['after_wrapper'];
|
248 |
|
249 |
/**
|
250 |
* Filter the links displayed on the User Profile page (logged in state).
|
253 |
*
|
254 |
* @param string $str The default links.
|
255 |
*/
|
256 |
+
$str = apply_filters( "wpmem_{$page}_links", $str );
|
257 |
break;
|
258 |
|
259 |
case 'register':
|
260 |
|
261 |
$arr = array(
|
262 |
+
'before_wrapper' => '<p>' . sprintf( $wpmem->get_text( 'register_status' ), $user_login ) . '</p>',
|
263 |
'wrapper_before' => '<ul>',
|
264 |
'wrapper_after' => '</ul>',
|
265 |
'rows' => array(
|
266 |
+
'<li><a href="' . $logout . '">' . $wpmem->get_text( 'register_logout' ) . '</a></li>',
|
267 |
+
'<li><a href="' . get_option('home') . '">' . $wpmem->get_text( 'register_continue' ) . '</a></li>',
|
268 |
),
|
269 |
+
'after_wrapper' => '',
|
270 |
);
|
271 |
|
272 |
/**
|
273 |
* Filter the register links array.
|
274 |
*
|
275 |
* @since 3.0.9
|
276 |
+
* @since 3.1.0 Added after_wrapper
|
277 |
*
|
278 |
* @param array $arr {
|
279 |
* The components of the links.
|
282 |
* @type string $wrapper_before The wrapper opening tag (default: <ul>).
|
283 |
* @type string $wrapper_after The wrapper closing tag (default: </ul>).
|
284 |
* @type array $rows Row items HTML.
|
285 |
+
* @type string $after_wrapper Anything that comes after the wrapper.
|
286 |
* }
|
287 |
*/
|
288 |
+
$arr = apply_filters( "wpmem_{$page}_links_args", $arr );
|
289 |
|
290 |
$str = $arr['before_wrapper'];
|
291 |
$str.= $arr['wrapper_before'];
|
293 |
$str.= $row;
|
294 |
}
|
295 |
$str.= $arr['wrapper_after'];
|
296 |
+
$str.= $arr['after_wrapper'];
|
297 |
|
298 |
/**
|
299 |
* Filter the links displayed on the Register page (logged in state).
|
302 |
*
|
303 |
* @param string $str The default links.
|
304 |
*/
|
305 |
+
$str = apply_filters( "wpmem_{$page}_links", $str );
|
306 |
break;
|
307 |
|
308 |
case 'login':
|
311 |
'wrapper_before' => '<p>',
|
312 |
'wrapper_after' => '</p>',
|
313 |
'user_login' => $user_login,
|
314 |
+
'welcome' => $wpmem->get_text( 'login_welcome' ),
|
315 |
+
'logout_text' => $wpmem->get_text( 'login_logout' ),
|
316 |
'logout_link' => '<a href="' . $logout . '">%s</a>',
|
317 |
'separator' => '<br />',
|
318 |
);
|
323 |
*
|
324 |
* @param array $args.
|
325 |
*/
|
326 |
+
$args = apply_filters( "wpmem_{$page}_links_args", $args );
|
327 |
|
328 |
// Assemble the message string.
|
329 |
$str = $args['wrapper_before']
|
339 |
*
|
340 |
* @param string $str The default links.
|
341 |
*/
|
342 |
+
$str = apply_filters( "wpmem_{$page}_links", $str );
|
343 |
break;
|
344 |
|
345 |
case 'status':
|
347 |
'wrapper_before' => '<p>',
|
348 |
'wrapper_after' => '</p>',
|
349 |
'user_login' => $user_login,
|
350 |
+
'welcome' => $wpmem->get_text( 'status_welcome' ),
|
351 |
+
'logout_text' => $wpmem->get_text( 'status_logout' ),
|
352 |
'logout_link' => '<a href="' . $logout . '">%s</a>',
|
353 |
'separator' => ' | ',
|
354 |
);
|
385 |
*
|
386 |
* @since 2.7.6
|
387 |
*
|
388 |
+
* @global object $wpmem
|
389 |
* @param string $wpmem_regchk
|
390 |
* @param string $content
|
391 |
* @return string $content
|
392 |
*/
|
393 |
function wpmem_page_pwd_reset( $wpmem_regchk, $content ) {
|
394 |
+
|
395 |
+
global $wpmem;
|
396 |
|
397 |
if ( is_user_logged_in() ) {
|
398 |
|
399 |
switch ( $wpmem_regchk ) {
|
400 |
|
401 |
case "pwdchangempty":
|
402 |
+
$content = wpmem_inc_regmessage( $wpmem_regchk, $wpmem->get_text( 'pwdchangempty' ) );
|
403 |
$content = $content . wpmem_inc_changepassword();
|
404 |
break;
|
405 |
|
418 |
}
|
419 |
|
420 |
} else {
|
421 |
+
|
422 |
+
// If the password shortcode page is set as User Profile page.
|
423 |
+
if ( 'getusername' == $wpmem->action ) {
|
424 |
+
|
425 |
+
return wpmem_page_forgot_username( $wpmem_regchk, $content );
|
426 |
+
|
427 |
+
} else {
|
428 |
|
429 |
+
switch( $wpmem_regchk ) {
|
430 |
+
|
431 |
+
case "pwdreseterr":
|
432 |
+
$content = $content
|
433 |
+
. wpmem_inc_regmessage( $wpmem_regchk )
|
434 |
+
. wpmem_inc_resetpassword();
|
435 |
+
$wpmem_regchk = ''; // Clear regchk.
|
436 |
+
break;
|
437 |
+
|
438 |
+
case "pwdresetsuccess":
|
439 |
+
$content = $content . wpmem_inc_regmessage( $wpmem_regchk );
|
440 |
+
$wpmem_regchk = ''; // Clear regchk.
|
441 |
+
break;
|
442 |
+
|
443 |
+
default:
|
444 |
+
$content = $content . wpmem_inc_resetpassword();
|
445 |
+
break;
|
446 |
+
}
|
447 |
+
|
448 |
}
|
449 |
|
450 |
}
|
461 |
*
|
462 |
* @since 2.7.6
|
463 |
*
|
464 |
+
* @global object $wpmem
|
465 |
+
* @global string $wpmem_a
|
466 |
+
* @global string $wpmem_themsg
|
467 |
* @param string $wpmem_regchk
|
468 |
* @param string $content
|
469 |
* @return string $content
|
470 |
*/
|
471 |
function wpmem_page_user_edit( $wpmem_regchk, $content ) {
|
472 |
|
473 |
+
global $wpmem, $wpmem_a, $wpmem_themsg;
|
474 |
/**
|
475 |
* Filter the default User Edit heading for shortcode.
|
476 |
*
|
478 |
*
|
479 |
* @param string The default edit mode heading.
|
480 |
*/
|
481 |
+
$heading = apply_filters( 'wpmem_user_edit_heading', $wpmem->get_text( 'profile_heading' ) );
|
482 |
|
483 |
if ( $wpmem_a == "update") { $content.= wpmem_inc_regmessage( $wpmem_regchk, $wpmem_themsg ); }
|
484 |
$content = $content . wpmem_inc_registration( 'edit', $heading );
|
507 |
switch( $wpmem->regchk ) {
|
508 |
|
509 |
case "usernamefailed":
|
510 |
+
$msg = $wpmem->get_text( 'usernamefailed' );
|
511 |
$content = $content
|
512 |
. wpmem_inc_regmessage( 'usernamefailed', $msg )
|
513 |
. wpmem_inc_forgotusername();
|
516 |
|
517 |
case "usernamesuccess":
|
518 |
$email = ( isset( $_POST['user_email'] ) ) ? $_POST['user_email'] : '';
|
519 |
+
$msg = sprintf( $wpmem->get_text( 'usernamesuccess' ), $email );
|
520 |
$content = $content . wpmem_inc_regmessage( 'usernamesuccess', $msg );
|
521 |
$wpmem->regchk = ''; // Clear regchk.
|
522 |
break;
|
540 |
*
|
541 |
* @since 3.0.8
|
542 |
*
|
543 |
+
* @global object $wpmem The WP_Members object class.
|
544 |
+
* @return string $str The generated html for the forgot username form.
|
545 |
*/
|
546 |
function wpmem_inc_forgotusername() {
|
547 |
+
|
548 |
+
global $wpmem;
|
549 |
|
550 |
// create the default inputs
|
551 |
$default_inputs = array(
|
552 |
array(
|
553 |
+
'name' => $wpmem->get_text( 'username_email' ),
|
554 |
'type' => 'text',
|
555 |
'tag' => 'user_email',
|
556 |
'class' => 'username',
|
568 |
$default_inputs = apply_filters( 'wpmem_inc_forgotusername_inputs', $default_inputs );
|
569 |
|
570 |
$defaults = array(
|
571 |
+
'heading' => $wpmem->get_text( 'username_heading' ),
|
572 |
'action' => 'getusername',
|
573 |
+
'button_text' => $wpmem->get_text( 'username_button' ),
|
574 |
'inputs' => $default_inputs,
|
575 |
);
|
576 |
|
inc/email.php
CHANGED
@@ -28,22 +28,21 @@ if ( ! function_exists( 'wpmem_inc_regemail' ) ):
|
|
28 |
*
|
29 |
* @since 1.8
|
30 |
*
|
31 |
-
* @uses wp_mail
|
32 |
-
*
|
33 |
* @global object $wpmem The WP_Members object.
|
34 |
* @global string $wpmem_mail_from The email from address.
|
35 |
* @global string $wpmem_mail_from_name The email from name.
|
36 |
-
* @param
|
37 |
-
* @param
|
38 |
-
* @param
|
39 |
-
* @param
|
40 |
-
* @param
|
|
|
41 |
*/
|
42 |
-
function wpmem_inc_regemail( $user_id, $password, $toggle, $wpmem_fields = null, $field_data = null ) {
|
43 |
|
44 |
global $wpmem;
|
45 |
|
46 |
-
|
47 |
* Determine which email is being sent.
|
48 |
*
|
49 |
* Stored option is an array with keys 'body' and 'subj'.
|
@@ -79,6 +78,12 @@ function wpmem_inc_regemail( $user_id, $password, $toggle, $wpmem_fields = null,
|
|
79 |
$arr = get_option( 'wpmembers_email_getuser' );
|
80 |
$arr['toggle'] = 'getuser';
|
81 |
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
82 |
|
83 |
}
|
84 |
|
@@ -92,17 +97,17 @@ function wpmem_inc_regemail( $user_id, $password, $toggle, $wpmem_fields = null,
|
|
92 |
$arr['blogname'] = wp_specialchars_decode( get_option ( 'blogname' ), ENT_QUOTES );
|
93 |
$arr['exp_type'] = ( defined( 'WPMEM_EXP_MODULE' ) && $wpmem->use_exp == 1 ) ? get_user_meta( $user_id, 'exp_type', true ) : '';
|
94 |
$arr['exp_date'] = ( defined( 'WPMEM_EXP_MODULE' ) && $wpmem->use_exp == 1 ) ? get_user_meta( $user_id, 'expires', true ) : '';
|
95 |
-
$arr['wpmem_msurl'] = $wpmem->user_pages['profile'];
|
|
|
|
|
96 |
$arr['reg_link'] = esc_url( get_user_meta( $user_id, 'wpmem_reg_url', true ) );
|
97 |
$arr['do_shortcodes'] = true;
|
98 |
$arr['add_footer'] = true;
|
|
|
99 |
$arr['disable'] = false;
|
100 |
|
101 |
// Apply filters (if set) for the sending email address.
|
102 |
-
|
103 |
-
add_filter( 'wp_mail_from', 'wpmem_mail_from' );
|
104 |
-
add_filter( 'wp_mail_from_name', 'wpmem_mail_from_name' );
|
105 |
-
$default_header = ( $wpmem_mail_from && $wpmem_mail_from_name ) ? 'From: ' . $wpmem_mail_from_name . ' <' . $wpmem_mail_from . '>' : '';
|
106 |
|
107 |
/**
|
108 |
* Filters the email headers.
|
@@ -116,27 +121,46 @@ function wpmem_inc_regemail( $user_id, $password, $toggle, $wpmem_fields = null,
|
|
116 |
|
117 |
// Handle backward compatibility for customizations that may call the email function directly.
|
118 |
if ( ! $wpmem_fields ) {
|
119 |
-
$wpmem_fields = $wpmem->fields;
|
120 |
}
|
121 |
|
122 |
/**
|
123 |
* Filter the email.
|
124 |
*
|
125 |
-
* This
|
126 |
-
*
|
127 |
-
*
|
128 |
-
* an array of the WP-Members fields, and an array of the posted registration
|
129 |
* data from the register function.
|
130 |
*
|
131 |
* @since 2.9.7
|
|
|
|
|
|
|
|
|
132 |
*
|
133 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
134 |
* @param array $wpmem_fields An array of the WP-Members fields.
|
135 |
* @param array $field_data An array of the posted registration data.
|
136 |
*/
|
137 |
$arr = apply_filters( 'wpmem_email_filter', $arr, $wpmem_fields, $field_data );
|
138 |
|
139 |
-
//If emails are not disabled, continue the email process.
|
140 |
if ( ! $arr['disable'] ) {
|
141 |
|
142 |
// Legacy email filters applied.
|
@@ -193,41 +217,50 @@ function wpmem_inc_regemail( $user_id, $password, $toggle, $wpmem_fields = null,
|
|
193 |
}
|
194 |
|
195 |
// Get the email footer if needed.
|
196 |
-
$foot = ( $arr['add_footer'] ) ?
|
197 |
|
198 |
// If doing shortcode replacements.
|
199 |
if ( $arr['do_shortcodes'] ) {
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
'[
|
204 |
-
'
|
205 |
-
'[
|
206 |
-
'[
|
207 |
-
'[
|
208 |
-
'[
|
209 |
-
'[
|
210 |
-
'
|
211 |
-
'
|
212 |
-
|
213 |
-
|
214 |
-
// Replacement values for default shortcodes.
|
215 |
-
$replace = array(
|
216 |
-
$arr['blogname'],
|
217 |
-
$arr['user_login'],
|
218 |
-
$password,
|
219 |
-
$arr['user_email'],
|
220 |
-
$arr['reg_link'],
|
221 |
-
$arr['wpmem_msurl'],
|
222 |
-
$arr['wpmem_msurl'],
|
223 |
-
$arr['exp_type'],
|
224 |
-
$arr['exp_date'],
|
225 |
);
|
226 |
|
227 |
-
//
|
228 |
foreach ( $wpmem_fields as $field ) {
|
229 |
-
$
|
230 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
231 |
}
|
232 |
|
233 |
// Do replacements for subject, body, and footer shortcodes.
|
@@ -238,6 +271,10 @@ function wpmem_inc_regemail( $user_id, $password, $toggle, $wpmem_fields = null,
|
|
238 |
|
239 |
// Append footer if needed.
|
240 |
$arr['body'] = ( $arr['add_footer'] ) ? $arr['body'] . "\r\n" . $foot : $arr['body'];
|
|
|
|
|
|
|
|
|
241 |
|
242 |
// Send the message.
|
243 |
wp_mail( $arr['user_email'], stripslashes( $arr['subj'] ), stripslashes( $arr['body'] ), $arr['headers'] );
|
@@ -256,14 +293,12 @@ if ( ! function_exists( 'wpmem_notify_admin' ) ):
|
|
256 |
*
|
257 |
* @since 2.3
|
258 |
*
|
259 |
-
* @uses wp_mail
|
260 |
-
*
|
261 |
* @global object $wpmem The WP_Members object.
|
262 |
* @global string $wpmem_mail_from The email from address.
|
263 |
* @global string $wpmem_mail_from_name The email from name.
|
264 |
-
* @param
|
265 |
-
* @param
|
266 |
-
* @param
|
267 |
*/
|
268 |
function wpmem_notify_admin( $user_id, $wpmem_fields, $field_data = null ) {
|
269 |
|
@@ -295,28 +330,30 @@ function wpmem_notify_admin( $user_id, $wpmem_fields, $field_data = null ) {
|
|
295 |
$arr['blogname'] = wp_specialchars_decode( get_option ( 'blogname' ), ENT_QUOTES );
|
296 |
$arr['user_ip'] = ( is_array( $field_data ) ) ? $field_data['wpmem_reg_ip'] : get_user_meta( $user_id, 'wpmem_reg_ip', true );
|
297 |
$arr['reg_link'] = esc_url( get_user_meta( $user_id, 'wpmem_reg_url', true ) );
|
298 |
-
$arr['act_link'] =
|
299 |
$arr['exp_type'] = ( defined( 'WPMEM_EXP_MODULE' ) && $wpmem->use_exp == 1 ) ? get_user_meta( $user_id, 'exp_type', true ) : '';
|
300 |
$arr['exp_date'] = ( defined( 'WPMEM_EXP_MODULE' ) && $wpmem->use_exp == 1 ) ? get_user_meta( $user_id, 'expires', true ) : '';
|
301 |
$arr['do_shortcodes'] = true;
|
302 |
$arr['add_footer'] = true;
|
|
|
303 |
$arr['disable'] = false;
|
304 |
|
305 |
// Builds an array of the user data fields.
|
306 |
$field_arr = array();
|
307 |
foreach ( $wpmem_fields as $meta ) {
|
308 |
if ( $meta[4] == 'y' ) {
|
309 |
-
$name = $meta[1];
|
310 |
if ( ! in_array( $meta[2], wpmem_get_excluded_meta( 'email' ) ) ) {
|
311 |
if ( ( $meta[2] != 'user_email' ) && ( $meta[2] != 'password' ) ) {
|
312 |
if ( $meta[2] == 'user_url' ) {
|
313 |
$val = esc_url( $user->user_url );
|
314 |
} elseif ( in_array( $meta[2], $wp_user_fields ) ) {
|
315 |
$val = esc_html( $user->$meta[2] );
|
|
|
|
|
316 |
} else {
|
317 |
$val = ( is_array( $field_data ) ) ? esc_html( $field_data[ $meta[2] ] ) : esc_html( get_user_meta( $user_id, $meta[2], true ) );
|
318 |
}
|
319 |
-
$field_arr[ $
|
320 |
}
|
321 |
}
|
322 |
}
|
@@ -324,10 +361,7 @@ function wpmem_notify_admin( $user_id, $wpmem_fields, $field_data = null ) {
|
|
324 |
$arr['field_arr'] = $field_arr;
|
325 |
|
326 |
// Apply filters (if set) for the sending email address.
|
327 |
-
|
328 |
-
add_filter( 'wp_mail_from', 'wpmem_mail_from' );
|
329 |
-
add_filter( 'wp_mail_from_name', 'wpmem_mail_from_name' );
|
330 |
-
$default_header = ( $wpmem_mail_from && $wpmem_mail_from_name ) ? 'From: ' . $wpmem_mail_from_name . ' <' . $wpmem_mail_from . '>' : '';
|
331 |
|
332 |
/** This filter is documented in email.php */
|
333 |
$arr['headers'] = apply_filters( 'wpmem_email_headers', $default_header, 'admin' );
|
@@ -373,36 +407,49 @@ function wpmem_notify_admin( $user_id, $wpmem_fields, $field_data = null ) {
|
|
373 |
}
|
374 |
|
375 |
// Get the email footer if needed.
|
376 |
-
$foot = ( $arr['add_footer'] ) ?
|
377 |
|
378 |
// If doing shortcode replacements.
|
379 |
if ( $arr['do_shortcodes'] ) {
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
'[
|
384 |
-
'[
|
385 |
-
'[
|
386 |
-
'[
|
387 |
-
'
|
388 |
-
'
|
389 |
-
'
|
390 |
-
'
|
391 |
-
'
|
392 |
-
);
|
393 |
-
|
394 |
-
//
|
395 |
-
$
|
396 |
-
$
|
397 |
-
$
|
398 |
-
$
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
406 |
|
407 |
// Create the custom field shortcodes.
|
408 |
foreach ( $wpmem_fields as $field ) {
|
@@ -427,6 +474,10 @@ function wpmem_notify_admin( $user_id, $wpmem_fields, $field_data = null ) {
|
|
427 |
* @param string $arr['body'] The admin notification email body.
|
428 |
*/
|
429 |
$arr['body'] = apply_filters( 'wpmem_email_notify', $arr['body'] );
|
|
|
|
|
|
|
|
|
430 |
|
431 |
// Send the message.
|
432 |
wp_mail( $arr['admin_email'], stripslashes( $arr['subj'] ), stripslashes( $arr['body'] ), $arr['headers'] );
|
@@ -439,14 +490,15 @@ endif;
|
|
439 |
* Filters the wp_mail from address (if set).
|
440 |
*
|
441 |
* @since 2.7
|
|
|
442 |
*
|
|
|
443 |
* @param string $email
|
444 |
-
* @return string $email
|
445 |
*/
|
446 |
function wpmem_mail_from( $email ) {
|
447 |
-
global $
|
448 |
-
|
449 |
-
return $wpmem_mail_from;
|
450 |
}
|
451 |
|
452 |
|
@@ -454,14 +506,15 @@ function wpmem_mail_from( $email ) {
|
|
454 |
* Filters the wp_mail from name (if set).
|
455 |
*
|
456 |
* @since 2.7
|
|
|
457 |
*
|
|
|
458 |
* @param string $name
|
459 |
-
* @return string $name
|
460 |
*/
|
461 |
function wpmem_mail_from_name( $name ) {
|
462 |
-
global $
|
463 |
-
|
464 |
-
return $wpmem_mail_from_name;
|
465 |
}
|
466 |
|
467 |
// End of file.
|
28 |
*
|
29 |
* @since 1.8
|
30 |
*
|
|
|
|
|
31 |
* @global object $wpmem The WP_Members object.
|
32 |
* @global string $wpmem_mail_from The email from address.
|
33 |
* @global string $wpmem_mail_from_name The email from name.
|
34 |
+
* @param int $user_ID The User's ID.
|
35 |
+
* @param string $password Password from the registration process.
|
36 |
+
* @param string $toggle Toggle indicating the email being sent (newreg|newmod|appmod|repass).
|
37 |
+
* @param array $wpmem_fields Array of the WP-Members fields (defaults to null).
|
38 |
+
* @param array $fields Array of the registration data (defaults to null).
|
39 |
+
* @param array $custom Array of custom email information (defaults to null).
|
40 |
*/
|
41 |
+
function wpmem_inc_regemail( $user_id, $password, $toggle, $wpmem_fields = null, $field_data = null, $custom = null ) {
|
42 |
|
43 |
global $wpmem;
|
44 |
|
45 |
+
/*
|
46 |
* Determine which email is being sent.
|
47 |
*
|
48 |
* Stored option is an array with keys 'body' and 'subj'.
|
78 |
$arr = get_option( 'wpmembers_email_getuser' );
|
79 |
$arr['toggle'] = 'getuser';
|
80 |
break;
|
81 |
+
|
82 |
+
case 5:
|
83 |
+
// This is a custom email.
|
84 |
+
$arr['subj'] = $custom['subj'];
|
85 |
+
$arr['body'] = $custom['body'];
|
86 |
+
$arr['toggle'] = $custom['toggle'];
|
87 |
|
88 |
}
|
89 |
|
97 |
$arr['blogname'] = wp_specialchars_decode( get_option ( 'blogname' ), ENT_QUOTES );
|
98 |
$arr['exp_type'] = ( defined( 'WPMEM_EXP_MODULE' ) && $wpmem->use_exp == 1 ) ? get_user_meta( $user_id, 'exp_type', true ) : '';
|
99 |
$arr['exp_date'] = ( defined( 'WPMEM_EXP_MODULE' ) && $wpmem->use_exp == 1 ) ? get_user_meta( $user_id, 'expires', true ) : '';
|
100 |
+
$arr['wpmem_msurl'] = esc_url( $wpmem->user_pages['profile'] );
|
101 |
+
$arr['wpmem_reg'] = esc_url( $wpmem->user_pages['register'] );
|
102 |
+
$arr['wpmem_login'] = esc_url( $wpmem->user_pages['login'] );
|
103 |
$arr['reg_link'] = esc_url( get_user_meta( $user_id, 'wpmem_reg_url', true ) );
|
104 |
$arr['do_shortcodes'] = true;
|
105 |
$arr['add_footer'] = true;
|
106 |
+
$arr['footer'] = get_option( 'wpmembers_email_footer' );
|
107 |
$arr['disable'] = false;
|
108 |
|
109 |
// Apply filters (if set) for the sending email address.
|
110 |
+
$default_header = ( $wpmem->email['from'] && $wpmem->email['from_name'] ) ? 'From: "' . $wpmem->email['from_name'] . '" <' . $wpmem->email['from'] . '>' : '';
|
|
|
|
|
|
|
111 |
|
112 |
/**
|
113 |
* Filters the email headers.
|
121 |
|
122 |
// Handle backward compatibility for customizations that may call the email function directly.
|
123 |
if ( ! $wpmem_fields ) {
|
124 |
+
$wpmem_fields = $wpmem->fields;
|
125 |
}
|
126 |
|
127 |
/**
|
128 |
* Filter the email.
|
129 |
*
|
130 |
+
* This filter passes the email subject, body, user ID, and several other
|
131 |
+
* settings and parameters for use in the filter function. It also passes an
|
132 |
+
* array of the WP-Members fields, and an array of the posted registration
|
|
|
133 |
* data from the register function.
|
134 |
*
|
135 |
* @since 2.9.7
|
136 |
+
* @since 3.1.0 Added footer content to the array.
|
137 |
+
*
|
138 |
+
* @param array $arr {
|
139 |
+
* An array containing email body, subject, user id, and additional settings.
|
140 |
*
|
141 |
+
* @type string subj
|
142 |
+
* @type string body
|
143 |
+
* @type string toggle
|
144 |
+
* @type int user_id
|
145 |
+
* @type string user_login
|
146 |
+
* @type string user_email
|
147 |
+
* @type string blogname
|
148 |
+
* @type string exp_type
|
149 |
+
* @type string exp_date
|
150 |
+
* @type string wpmem_msurl
|
151 |
+
* @type string reg_link
|
152 |
+
* @type string do_shortcodes
|
153 |
+
* @type bool add_footer
|
154 |
+
* @type string footer
|
155 |
+
* @type bool disable
|
156 |
+
* @type mixed headers
|
157 |
+
* }
|
158 |
* @param array $wpmem_fields An array of the WP-Members fields.
|
159 |
* @param array $field_data An array of the posted registration data.
|
160 |
*/
|
161 |
$arr = apply_filters( 'wpmem_email_filter', $arr, $wpmem_fields, $field_data );
|
162 |
|
163 |
+
// If emails are not disabled, continue the email process.
|
164 |
if ( ! $arr['disable'] ) {
|
165 |
|
166 |
// Legacy email filters applied.
|
217 |
}
|
218 |
|
219 |
// Get the email footer if needed.
|
220 |
+
$foot = ( $arr['add_footer'] ) ? $arr['footer'] : '';
|
221 |
|
222 |
// If doing shortcode replacements.
|
223 |
if ( $arr['do_shortcodes'] ) {
|
224 |
+
|
225 |
+
$shortcodes = array(
|
226 |
+
'blogname' => $arr['blogname'],
|
227 |
+
'username' => $arr['user_login'],
|
228 |
+
'password' => $password,
|
229 |
+
'email' => $arr['user_email'],
|
230 |
+
'reglink' => $arr['reg_link'],
|
231 |
+
'members-area' => $arr['wpmem_msurl'],
|
232 |
+
'user-profile' => $arr['wpmem_msurl'],
|
233 |
+
'exp-type' => $arr['exp_type'],
|
234 |
+
'exp-data' => $arr['exp_date'],
|
235 |
+
'exp-date' => $arr['exp_date'],
|
236 |
+
'login' => $arr['wpmem_login'],
|
237 |
+
'register' => $arr['wpmem_reg'],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
238 |
);
|
239 |
|
240 |
+
// Add custom field shortcodes.
|
241 |
foreach ( $wpmem_fields as $field ) {
|
242 |
+
$key = '[' . $field[2] . ']';
|
243 |
+
$val = ( is_array( $field_data ) && 'y' == $field[4] ) ? $field_data[ $field[2] ] : get_user_meta( $user_id, $field[2], true );
|
244 |
+
$shortcodes[ $key ] = $val;
|
245 |
+
}
|
246 |
+
|
247 |
+
/**
|
248 |
+
* Filter available email shortcodes.
|
249 |
+
*
|
250 |
+
* @since 3.1.0
|
251 |
+
*
|
252 |
+
* @param array $shortcodes
|
253 |
+
* @param string $toggle
|
254 |
+
*/
|
255 |
+
$shortcodes = apply_filters( 'wpmem_email_shortcodes', $shortcodes, $arr['toggle'] );
|
256 |
+
|
257 |
+
$shortcd = array();
|
258 |
+
$replace = array();
|
259 |
+
foreach ( $shortcodes as $key => $val ) {
|
260 |
+
// Shortcodes.
|
261 |
+
$shortcd[] = '[' . $key . ']';
|
262 |
+
// Replacement values.
|
263 |
+
$replace[] = $val;
|
264 |
}
|
265 |
|
266 |
// Do replacements for subject, body, and footer shortcodes.
|
271 |
|
272 |
// Append footer if needed.
|
273 |
$arr['body'] = ( $arr['add_footer'] ) ? $arr['body'] . "\r\n" . $foot : $arr['body'];
|
274 |
+
|
275 |
+
// Apply from and from name email filters.
|
276 |
+
add_filter( 'wp_mail_from', 'wpmem_mail_from' );
|
277 |
+
add_filter( 'wp_mail_from_name', 'wpmem_mail_from_name' );
|
278 |
|
279 |
// Send the message.
|
280 |
wp_mail( $arr['user_email'], stripslashes( $arr['subj'] ), stripslashes( $arr['body'] ), $arr['headers'] );
|
293 |
*
|
294 |
* @since 2.3
|
295 |
*
|
|
|
|
|
296 |
* @global object $wpmem The WP_Members object.
|
297 |
* @global string $wpmem_mail_from The email from address.
|
298 |
* @global string $wpmem_mail_from_name The email from name.
|
299 |
+
* @param int $user_ID The User's ID.
|
300 |
+
* @param array $wpmem_fields Array of the WP-Members fields (defaults to null).
|
301 |
+
* @param array $fields Array of the registration data (defaults to null).
|
302 |
*/
|
303 |
function wpmem_notify_admin( $user_id, $wpmem_fields, $field_data = null ) {
|
304 |
|
330 |
$arr['blogname'] = wp_specialchars_decode( get_option ( 'blogname' ), ENT_QUOTES );
|
331 |
$arr['user_ip'] = ( is_array( $field_data ) ) ? $field_data['wpmem_reg_ip'] : get_user_meta( $user_id, 'wpmem_reg_ip', true );
|
332 |
$arr['reg_link'] = esc_url( get_user_meta( $user_id, 'wpmem_reg_url', true ) );
|
333 |
+
$arr['act_link'] = esc_url( add_query_arg( 'user_id', $user_id, get_admin_url( '', 'user-edit.php' ) ) );
|
334 |
$arr['exp_type'] = ( defined( 'WPMEM_EXP_MODULE' ) && $wpmem->use_exp == 1 ) ? get_user_meta( $user_id, 'exp_type', true ) : '';
|
335 |
$arr['exp_date'] = ( defined( 'WPMEM_EXP_MODULE' ) && $wpmem->use_exp == 1 ) ? get_user_meta( $user_id, 'expires', true ) : '';
|
336 |
$arr['do_shortcodes'] = true;
|
337 |
$arr['add_footer'] = true;
|
338 |
+
$arr['footer'] = get_option( 'wpmembers_email_footer' );
|
339 |
$arr['disable'] = false;
|
340 |
|
341 |
// Builds an array of the user data fields.
|
342 |
$field_arr = array();
|
343 |
foreach ( $wpmem_fields as $meta ) {
|
344 |
if ( $meta[4] == 'y' ) {
|
|
|
345 |
if ( ! in_array( $meta[2], wpmem_get_excluded_meta( 'email' ) ) ) {
|
346 |
if ( ( $meta[2] != 'user_email' ) && ( $meta[2] != 'password' ) ) {
|
347 |
if ( $meta[2] == 'user_url' ) {
|
348 |
$val = esc_url( $user->user_url );
|
349 |
} elseif ( in_array( $meta[2], $wp_user_fields ) ) {
|
350 |
$val = esc_html( $user->$meta[2] );
|
351 |
+
} elseif ( 'file' == $meta[3] || 'image' == $meta[3] ) {
|
352 |
+
$val = wp_get_attachment_url( get_user_meta( $user_id, $meta[2], true ) );
|
353 |
} else {
|
354 |
$val = ( is_array( $field_data ) ) ? esc_html( $field_data[ $meta[2] ] ) : esc_html( get_user_meta( $user_id, $meta[2], true ) );
|
355 |
}
|
356 |
+
$field_arr[ $meta[1] ] = $val;
|
357 |
}
|
358 |
}
|
359 |
}
|
361 |
$arr['field_arr'] = $field_arr;
|
362 |
|
363 |
// Apply filters (if set) for the sending email address.
|
364 |
+
$default_header = ( $wpmem->email['from'] && $wpmem->email['from_name'] ) ? 'From: "' . $wpmem->email['from_name'] . '" <' . $wpmem->email['from'] . '>' : '';
|
|
|
|
|
|
|
365 |
|
366 |
/** This filter is documented in email.php */
|
367 |
$arr['headers'] = apply_filters( 'wpmem_email_headers', $default_header, 'admin' );
|
407 |
}
|
408 |
|
409 |
// Get the email footer if needed.
|
410 |
+
$foot = ( $arr['add_footer'] ) ? $arr['footer'] : '';
|
411 |
|
412 |
// If doing shortcode replacements.
|
413 |
if ( $arr['do_shortcodes'] ) {
|
414 |
+
|
415 |
+
$shortcodes = array(
|
416 |
+
'blogname' => $arr['blogname'],
|
417 |
+
'username' => $arr['user_login'],
|
418 |
+
'email' => $arr['user_email'],
|
419 |
+
'reglink' => $arr['reg_link'],
|
420 |
+
'exp-type' => $arr['exp_type'],
|
421 |
+
'exp-data' => $arr['exp_date'],
|
422 |
+
'exp-date' => $arr['exp_date'],
|
423 |
+
'user-ip' => $arr['user_ip'],
|
424 |
+
'activate-user' => $arr['act_link'],
|
425 |
+
'fields' => $field_str,
|
426 |
+
);
|
427 |
+
|
428 |
+
// Add custom field shortcodes.
|
429 |
+
foreach ( $wpmem_fields as $field ) {
|
430 |
+
$key = '[' . $field[2] . ']';
|
431 |
+
$val = ( is_array( $field_data ) && 'y' == $field[4] ) ? $field_data[ $field[2] ] : get_user_meta( $user_id, $field[2], true );
|
432 |
+
$shortcodes[ $key ] = $val;
|
433 |
+
}
|
434 |
+
|
435 |
+
/**
|
436 |
+
* Filter available email shortcodes.
|
437 |
+
*
|
438 |
+
* @since 3.1.0
|
439 |
+
*
|
440 |
+
* @param array $shortcodes
|
441 |
+
* @param string $toggle
|
442 |
+
*/
|
443 |
+
$shortcodes = apply_filters( 'wpmem_email_shortcodes', $shortcodes, 'notify' );
|
444 |
+
|
445 |
+
$shortcd = array();
|
446 |
+
$replace = array();
|
447 |
+
foreach ( $shortcodes as $key => $val ) {
|
448 |
+
// Shortcodes.
|
449 |
+
$shortcd[] = '[' . $key . ']';
|
450 |
+
// Replacement values.
|
451 |
+
$replace[] = $val;
|
452 |
+
}
|
453 |
|
454 |
// Create the custom field shortcodes.
|
455 |
foreach ( $wpmem_fields as $field ) {
|
474 |
* @param string $arr['body'] The admin notification email body.
|
475 |
*/
|
476 |
$arr['body'] = apply_filters( 'wpmem_email_notify', $arr['body'] );
|
477 |
+
|
478 |
+
// Apply from and from name email filters.
|
479 |
+
add_filter( 'wp_mail_from', 'wpmem_mail_from' );
|
480 |
+
add_filter( 'wp_mail_from_name', 'wpmem_mail_from_name' );
|
481 |
|
482 |
// Send the message.
|
483 |
wp_mail( $arr['admin_email'], stripslashes( $arr['subj'] ), stripslashes( $arr['body'] ), $arr['headers'] );
|
490 |
* Filters the wp_mail from address (if set).
|
491 |
*
|
492 |
* @since 2.7
|
493 |
+
* @since 3.1 Converted to use email var in object.
|
494 |
*
|
495 |
+
* @global object $wpmem
|
496 |
* @param string $email
|
497 |
+
* @return string $wpmem_mail_from|$email
|
498 |
*/
|
499 |
function wpmem_mail_from( $email ) {
|
500 |
+
global $wpmem;
|
501 |
+
return ( $wpmem->email['from'] ) ? $wpmem->email['from'] : $email;
|
|
|
502 |
}
|
503 |
|
504 |
|
506 |
* Filters the wp_mail from name (if set).
|
507 |
*
|
508 |
* @since 2.7
|
509 |
+
* @since 3.1 Converted to use email var in object.
|
510 |
*
|
511 |
+
* @global object $wpmem
|
512 |
* @param string $name
|
513 |
+
* @return string $wpmem_mail_from_name|$name
|
514 |
*/
|
515 |
function wpmem_mail_from_name( $name ) {
|
516 |
+
global $wpmem;
|
517 |
+
return ( $wpmem->email['from_name'] ) ? stripslashes( $wpmem->email['from_name'] ) : stripslashes( $name );
|
|
|
518 |
}
|
519 |
|
520 |
// End of file.
|
inc/forms.php
CHANGED
@@ -72,14 +72,14 @@ function wpmem_inc_login( $page = "page", $redirect_to = null, $show = 'show' )
|
|
72 |
// Create the default inputs.
|
73 |
$default_inputs = array(
|
74 |
array(
|
75 |
-
'name' =>
|
76 |
'type' => 'text',
|
77 |
'tag' => 'log',
|
78 |
'class' => 'username',
|
79 |
'div' => 'div_text',
|
80 |
),
|
81 |
array(
|
82 |
-
'name' =>
|
83 |
'type' => 'password',
|
84 |
'tag' => 'pwd',
|
85 |
'class' => 'password',
|
@@ -97,9 +97,9 @@ function wpmem_inc_login( $page = "page", $redirect_to = null, $show = 'show' )
|
|
97 |
$default_inputs = apply_filters( 'wpmem_inc_login_inputs', $default_inputs );
|
98 |
|
99 |
$defaults = array(
|
100 |
-
'heading' =>
|
101 |
'action' => 'login',
|
102 |
-
'button_text' =>
|
103 |
'inputs' => $default_inputs,
|
104 |
'redirect_to' => $redirect_to,
|
105 |
);
|
@@ -130,21 +130,24 @@ if ( ! function_exists( 'wpmem_inc_changepassword' ) ):
|
|
130 |
*
|
131 |
* @since 2.0.0
|
132 |
*
|
133 |
-
* @
|
|
|
134 |
*/
|
135 |
function wpmem_inc_changepassword() {
|
|
|
|
|
136 |
|
137 |
// create the default inputs
|
138 |
$default_inputs = array(
|
139 |
array(
|
140 |
-
'name' =>
|
141 |
'type' => 'password',
|
142 |
'tag' => 'pass1',
|
143 |
'class' => 'password',
|
144 |
'div' => 'div_text',
|
145 |
),
|
146 |
array(
|
147 |
-
'name' =>
|
148 |
'type' => 'password',
|
149 |
'tag' => 'pass2',
|
150 |
'class' => 'password',
|
@@ -162,9 +165,9 @@ function wpmem_inc_changepassword() {
|
|
162 |
$default_inputs = apply_filters( 'wpmem_inc_changepassword_inputs', $default_inputs );
|
163 |
|
164 |
$defaults = array(
|
165 |
-
'heading' =>
|
166 |
'action' => 'pwdchange',
|
167 |
-
'button_text' =>
|
168 |
'inputs' => $default_inputs,
|
169 |
);
|
170 |
|
@@ -194,21 +197,24 @@ if ( ! function_exists( 'wpmem_inc_resetpassword' ) ):
|
|
194 |
*
|
195 |
* @since 2.1.0
|
196 |
*
|
197 |
-
* @
|
|
|
198 |
*/
|
199 |
function wpmem_inc_resetpassword() {
|
200 |
|
|
|
|
|
201 |
// Create the default inputs.
|
202 |
$default_inputs = array(
|
203 |
array(
|
204 |
-
'name' =>
|
205 |
'type' => 'text',
|
206 |
'tag' => 'user',
|
207 |
'class' => 'username',
|
208 |
'div' => 'div_text',
|
209 |
),
|
210 |
array(
|
211 |
-
'name' =>
|
212 |
'type' => 'text',
|
213 |
'tag' => 'email',
|
214 |
'class' => 'password',
|
@@ -226,9 +232,9 @@ function wpmem_inc_resetpassword() {
|
|
226 |
$default_inputs = apply_filters( 'wpmem_inc_resetpassword_inputs', $default_inputs );
|
227 |
|
228 |
$defaults = array(
|
229 |
-
'heading' =>
|
230 |
'action' => 'pwdreset',
|
231 |
-
'button_text' =>
|
232 |
'inputs' => $default_inputs,
|
233 |
);
|
234 |
|
@@ -328,8 +334,8 @@ function wpmem_login_form( $page, $arr ) {
|
|
328 |
*
|
329 |
* @since 2.9.0
|
330 |
*
|
331 |
-
* @param array
|
332 |
-
* @param string $arr['action'] The action being performed by the form. login|pwdreset|pwdchange.
|
333 |
*/
|
334 |
$args = apply_filters( 'wpmem_login_form_args', '', $arr['action'] );
|
335 |
|
@@ -361,8 +367,8 @@ function wpmem_login_form( $page, $arr ) {
|
|
361 |
*
|
362 |
* @since 2.9.0
|
363 |
*
|
364 |
-
* @param array $rows
|
365 |
-
* @param string $arr['action'] The action being performed by the form. login|pwdreset|pwdchange.
|
366 |
*/
|
367 |
$rows = apply_filters( 'wpmem_login_form_rows', $rows, $arr['action'] );
|
368 |
|
@@ -385,14 +391,14 @@ function wpmem_login_form( $page, $arr ) {
|
|
385 |
*
|
386 |
* @since 2.9.0
|
387 |
*
|
388 |
-
* @param string $hidden
|
389 |
-
* @param string $arr['action'] The action being performed by the form. login|pwdreset|pwdchange.
|
390 |
*/
|
391 |
$form = $form . apply_filters( 'wpmem_login_hidden_fields', $hidden, $arr['action'] );
|
392 |
|
393 |
// Build the buttons, filter, and add to the form.
|
394 |
if ( $arr['action'] == 'login' ) {
|
395 |
-
$args['remember_check'] = ( $args['remember_check'] ) ? $args['t'] . wpmem_create_formfield( 'rememberme', 'checkbox', 'forever' ) . ' ' .
|
396 |
$buttons = $args['remember_check'] . $args['t'] . '<input type="submit" name="Submit" value="' . $arr['button_text'] . '" class="' . $args['button_class'] . '" />' . $args['n'];
|
397 |
} else {
|
398 |
$buttons = '<input type="submit" name="Submit" value="' . $arr['button_text'] . '" class="' . $args['button_class'] . '" />' . $args['n'];
|
@@ -405,8 +411,8 @@ function wpmem_login_form( $page, $arr ) {
|
|
405 |
*
|
406 |
* @since 2.9.0
|
407 |
*
|
408 |
-
* @param string $buttons
|
409 |
-
* @param string $arr['action'] The action being performed by the form. login|pwdreset|pwdchange.
|
410 |
*/
|
411 |
$form = $form . apply_filters( 'wpmem_login_form_buttons', $args['buttons_before'] . $args['n'] . $buttons . $args['buttons_after'] . $args['n'], $arr['action'] );
|
412 |
|
@@ -419,8 +425,8 @@ function wpmem_login_form( $page, $arr ) {
|
|
419 |
*
|
420 |
* @param string The forgot password link.
|
421 |
*/
|
422 |
-
$link = apply_filters( 'wpmem_forgot_link',
|
423 |
-
$str =
|
424 |
/**
|
425 |
* Filters the forgot password HTML.
|
426 |
*
|
@@ -444,7 +450,7 @@ function wpmem_login_form( $page, $arr ) {
|
|
444 |
* @param string The registration page link.
|
445 |
*/
|
446 |
$link = apply_filters( 'wpmem_reg_link', $wpmem->user_pages['register'] );
|
447 |
-
$str =
|
448 |
/**
|
449 |
* Filters the register link HTML.
|
450 |
*
|
@@ -467,8 +473,8 @@ function wpmem_login_form( $page, $arr ) {
|
|
467 |
*
|
468 |
* @param string The forgot username link.
|
469 |
*/
|
470 |
-
$link = apply_filters( 'wpmem_username_link',
|
471 |
-
$str =
|
472 |
/**
|
473 |
* Filters the forgot username link HTML.
|
474 |
*
|
@@ -507,8 +513,8 @@ function wpmem_login_form( $page, $arr ) {
|
|
507 |
*
|
508 |
* @since 2.7.4
|
509 |
*
|
510 |
-
* @param string $form
|
511 |
-
* @param string $arr['action'] The action being performed by the form. login|pwdreset|pwdchange.
|
512 |
*/
|
513 |
$form = apply_filters( 'wpmem_login_form', $form, $arr['action'] );
|
514 |
|
@@ -520,8 +526,8 @@ function wpmem_login_form( $page, $arr ) {
|
|
520 |
*
|
521 |
* @since 2.7.4
|
522 |
*
|
523 |
-
* @param string $str
|
524 |
-
* @param string $arr['action'] The action being performed by the form. login|pwdreset|pwdchange.
|
525 |
*/
|
526 |
$form = apply_filters( 'wpmem_login_form_before', '', $arr['action'] ) . $form;
|
527 |
|
@@ -538,10 +544,11 @@ if ( ! function_exists( 'wpmem_inc_registration' ) ):
|
|
538 |
*
|
539 |
* @since 2.5.1
|
540 |
*
|
541 |
-
* @
|
542 |
-
* @param string $heading (optional) The heading text for the form, null (default) for new registration.
|
543 |
* @global string $wpmem_regchk Used to determine if the form is in an error state.
|
544 |
* @global array $userdata Used to get the user's registration data if they are logged in (user profile edit).
|
|
|
|
|
545 |
* @return string $form The HTML for the entire form as a string.
|
546 |
*/
|
547 |
function wpmem_inc_registration( $toggle = 'new', $heading = '', $redirect_to = null ) {
|
@@ -572,16 +579,16 @@ function wpmem_inc_registration( $toggle = 'new', $heading = '', $redirect_to =
|
|
572 |
'button_class' => 'buttons',
|
573 |
|
574 |
// Required field tags and text.
|
575 |
-
'req_mark' => '
|
576 |
-
'req_label' =>
|
577 |
'req_label_before' => '<div class="req-text">',
|
578 |
'req_label_after' => '</div>',
|
579 |
|
580 |
// Buttons.
|
581 |
'show_clear_form' => false,
|
582 |
-
'clear_form' =>
|
583 |
-
'submit_register' =>
|
584 |
-
'submit_update' =>
|
585 |
|
586 |
// Other.
|
587 |
'strip_breaks' => true,
|
@@ -612,15 +619,22 @@ function wpmem_inc_registration( $toggle = 'new', $heading = '', $redirect_to =
|
|
612 |
if ( $toggle == 'edit' ) {
|
613 |
// This is the User Profile edit - username is not editable.
|
614 |
$val = $userdata->user_login;
|
615 |
-
$label = '<label for="
|
616 |
$input = '<p class="noinput">' . $val . '</p>';
|
617 |
$field_before = ( $args['wrap_inputs'] ) ? '<div class="div_text">' : '';
|
618 |
$field_after = ( $args['wrap_inputs'] ) ? '</div>' : '';
|
619 |
} else {
|
620 |
// This is a new registration.
|
621 |
-
$val = ( isset( $_POST['
|
622 |
-
$label = '<label for="
|
623 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
624 |
|
625 |
}
|
626 |
$field_before = ( $args['wrap_inputs'] ) ? '<div class="div_text">' : '';
|
@@ -632,7 +646,7 @@ function wpmem_inc_registration( $toggle = 'new', $heading = '', $redirect_to =
|
|
632 |
'meta' => 'username',
|
633 |
'type' => 'text',
|
634 |
'value' => $val,
|
635 |
-
'label_text' =>
|
636 |
'row_before' => $args['row_before'],
|
637 |
'label' => $label,
|
638 |
'field_before' => $field_before,
|
@@ -656,6 +670,8 @@ function wpmem_inc_registration( $toggle = 'new', $heading = '', $redirect_to =
|
|
656 |
*/
|
657 |
$wpmem_fields = apply_filters( 'wpmem_register_fields_arr', $wpmem->fields, $toggle );
|
658 |
|
|
|
|
|
659 |
// Loop through the remaining fields.
|
660 |
foreach ( $wpmem_fields as $field ) {
|
661 |
|
@@ -672,13 +688,26 @@ function wpmem_inc_registration( $toggle = 'new', $heading = '', $redirect_to =
|
|
672 |
$hidden_tos = wpmem_create_formfield( $field[2], 'hidden', get_user_meta( $userdata->ID, 'tos', true ) );
|
673 |
}
|
674 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
675 |
// If the field is set to display and we aren't skipping, construct the row.
|
676 |
if ( $field[4] == 'y' && $do_row == true ) {
|
677 |
|
678 |
// Label for all but TOS.
|
679 |
if ( $field[2] != 'tos' ) {
|
680 |
|
681 |
-
$class = ( $field[3] == 'password' ) ? 'text' : $field[3];
|
682 |
|
683 |
$label = '<label for="' . $field[2] . '" class="' . $class . '">' . __( $field[1], 'wp-members' );
|
684 |
$label = ( $field[5] == 'y' ) ? $label . $args['req_mark'] : $label;
|
@@ -713,9 +742,11 @@ function wpmem_inc_registration( $toggle = 'new', $heading = '', $redirect_to =
|
|
713 |
}
|
714 |
|
715 |
} else {
|
716 |
-
|
717 |
-
|
718 |
-
|
|
|
|
|
719 |
}
|
720 |
|
721 |
// Does the tos field.
|
@@ -734,7 +765,7 @@ function wpmem_inc_registration( $toggle = 'new', $heading = '', $redirect_to =
|
|
734 |
$link = do_shortcode( $tos_content );
|
735 |
$tos_pop = '<a href="' . $link . '" target="_blank">';
|
736 |
} else {
|
737 |
-
$tos_pop = "<a href=\"#\" onClick=\"window.open('" .
|
738 |
}
|
739 |
|
740 |
/**
|
@@ -745,7 +776,7 @@ function wpmem_inc_registration( $toggle = 'new', $heading = '', $redirect_to =
|
|
745 |
* @param string The link text.
|
746 |
* @param string $toggle Toggle new registration or profile update. new|edit.
|
747 |
*/
|
748 |
-
$input.= apply_filters( 'wpmem_tos_link_txt', sprintf(
|
749 |
|
750 |
// In previous versions, the div class would end up being the same as the row before.
|
751 |
$field_before = ( $args['wrap_inputs'] ) ? '<div class="div_text">' : '';
|
@@ -762,15 +793,40 @@ function wpmem_inc_registration( $toggle = 'new', $heading = '', $redirect_to =
|
|
762 |
}
|
763 |
|
764 |
// For dropdown select.
|
765 |
-
if ( $field[3] == 'select' ) {
|
766 |
$valtochk = $val;
|
767 |
$val = $field[7];
|
768 |
}
|
769 |
|
770 |
if ( ! isset( $valtochk ) ) { $valtochk = ''; }
|
771 |
|
772 |
-
|
773 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
774 |
|
775 |
// Determine input wrappers.
|
776 |
$field_before = ( $args['wrap_inputs'] ) ? '<div class="div_' . $class . '">' : '';
|
@@ -781,11 +837,19 @@ function wpmem_inc_registration( $toggle = 'new', $heading = '', $redirect_to =
|
|
781 |
|
782 |
// If the row is set to display, add the row to the form array.
|
783 |
if ( $field[4] == 'y' ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
784 |
$rows[$field[2]] = array(
|
785 |
'order' => $field[0],
|
786 |
'meta' => $field[2],
|
787 |
'type' => $field[3],
|
788 |
'value' => $val,
|
|
|
789 |
'label_text' => __( $field[1], 'wp-members' ),
|
790 |
'row_before' => $args['row_before'],
|
791 |
'label' => $label,
|
@@ -805,12 +869,13 @@ function wpmem_inc_registration( $toggle = 'new', $heading = '', $redirect_to =
|
|
805 |
'meta' => '',
|
806 |
'type' => 'text',
|
807 |
'value' => '',
|
|
|
808 |
'label_text' => $row['label_text'],
|
809 |
'row_before' => $args['row_before'],
|
810 |
'label' => $row['label'],
|
811 |
-
'field_before' =>
|
812 |
'field' => $row['field'],
|
813 |
-
'field_after' =>
|
814 |
'row_after' => $args['row_after'],
|
815 |
);
|
816 |
}
|
@@ -831,6 +896,7 @@ function wpmem_inc_registration( $toggle = 'new', $heading = '', $redirect_to =
|
|
831 |
* @type string meta Field meta tag (not used for display).
|
832 |
* @type string type Input field type (not used for display).
|
833 |
* @type string value Input field value (not used for display).
|
|
|
834 |
* @type string label_text Raw text for the label (not used for display).
|
835 |
* @type string row_before Opening wrapper tag around the row.
|
836 |
* @type string label Label tag.
|
@@ -879,10 +945,10 @@ function wpmem_inc_registration( $toggle = 'new', $heading = '', $redirect_to =
|
|
879 |
// Create hidden fields.
|
880 |
$var = ( $toggle == 'edit' ) ? 'update' : 'register';
|
881 |
$redirect_to = ( isset( $_REQUEST['redirect_to'] ) ) ? esc_url( $_REQUEST['redirect_to'] ) : ( ( $redirect_to ) ? $redirect_to : get_permalink() );
|
882 |
-
$hidden
|
883 |
-
$hidden .= '<input name="
|
884 |
if ( $redirect_to != get_permalink() ) {
|
885 |
-
$hidden.= '<input name="
|
886 |
}
|
887 |
$hidden = ( isset( $hidden_tos ) ) ? $hidden . $hidden_tos . $args['n'] : $hidden;
|
888 |
|
@@ -931,7 +997,7 @@ function wpmem_inc_registration( $toggle = 'new', $heading = '', $redirect_to =
|
|
931 |
* @param string $str
|
932 |
* @param string $toggle Toggle new registration or profile update. new|edit.
|
933 |
*/
|
934 |
-
$heading = ( !$heading ) ? apply_filters( 'wpmem_register_heading',
|
935 |
$form = $args['heading_before'] . $heading . $args['heading_after'] . $args['n'] . $form;
|
936 |
|
937 |
// Apply fieldset wrapper.
|
@@ -945,7 +1011,7 @@ function wpmem_inc_registration( $toggle = 'new', $heading = '', $redirect_to =
|
|
945 |
|
946 |
// Apply form wrapper.
|
947 |
$enctype = ( $enctype == 'multipart/form-data' ) ? ' enctype="multipart/form-data"' : '';
|
948 |
-
$post_to =
|
949 |
$form = '<form name="form" method="post"' . $enctype . ' action="' . $post_to . '" id="' . $args['form_id'] . '" class="' . $args['form_class'] . '">' . $args['n'] . $form . $args['n'] . '</form>';
|
950 |
|
951 |
// Apply anchor.
|
@@ -974,6 +1040,7 @@ function wpmem_inc_registration( $toggle = 'new', $heading = '', $redirect_to =
|
|
974 |
* @type string meta Field meta tag (not used for display).
|
975 |
* @type string type Input field type (not used for display).
|
976 |
* @type string value Input field value (not used for display).
|
|
|
977 |
* @type string label_text Raw text for the label (not used for display).
|
978 |
* @type string row_before Opening wrapper tag around the row.
|
979 |
* @type string label Label tag.
|
@@ -1084,6 +1151,7 @@ function wpmem_inc_attribution() {
|
|
1084 |
*
|
1085 |
* @since 2.9.5
|
1086 |
*
|
|
|
1087 |
* @return array {
|
1088 |
* HTML Form elements for Really Simple CAPTCHA.
|
1089 |
*
|
@@ -1093,6 +1161,8 @@ function wpmem_inc_attribution() {
|
|
1093 |
* }
|
1094 |
*/
|
1095 |
function wpmem_build_rs_captcha() {
|
|
|
|
|
1096 |
|
1097 |
if ( defined( 'REALLYSIMPLECAPTCHA_VERSION' ) ) {
|
1098 |
// setup defaults
|
@@ -1146,8 +1216,8 @@ function wpmem_build_rs_captcha() {
|
|
1146 |
$pre = $wpmem_captcha_prefix;
|
1147 |
|
1148 |
return array(
|
1149 |
-
'label_text' =>
|
1150 |
-
'label' => '<label class="text" for="captcha">' .
|
1151 |
'field' => '<input id="captcha_code" name="captcha_code" size="'.$size.'" type="text" />
|
1152 |
<input id="captcha_prefix" name="captcha_prefix" type="hidden" value="' . $pre . '" />
|
1153 |
<img src="'.$src.'" alt="captcha" width="'.$img_w.'" height="'.$img_h.'" />'
|
72 |
// Create the default inputs.
|
73 |
$default_inputs = array(
|
74 |
array(
|
75 |
+
'name' => $wpmem->get_text( 'login_username' ),
|
76 |
'type' => 'text',
|
77 |
'tag' => 'log',
|
78 |
'class' => 'username',
|
79 |
'div' => 'div_text',
|
80 |
),
|
81 |
array(
|
82 |
+
'name' => $wpmem->get_text( 'login_password' ),
|
83 |
'type' => 'password',
|
84 |
'tag' => 'pwd',
|
85 |
'class' => 'password',
|
97 |
$default_inputs = apply_filters( 'wpmem_inc_login_inputs', $default_inputs );
|
98 |
|
99 |
$defaults = array(
|
100 |
+
'heading' => $wpmem->get_text( 'login_heading' ),
|
101 |
'action' => 'login',
|
102 |
+
'button_text' => $wpmem->get_text( 'login_button' ),
|
103 |
'inputs' => $default_inputs,
|
104 |
'redirect_to' => $redirect_to,
|
105 |
);
|
130 |
*
|
131 |
* @since 2.0.0
|
132 |
*
|
133 |
+
* @global object $wpmem The WP_Members object.
|
134 |
+
* @return string $str The generated html for the change password form.
|
135 |
*/
|
136 |
function wpmem_inc_changepassword() {
|
137 |
+
|
138 |
+
global $wpmem;
|
139 |
|
140 |
// create the default inputs
|
141 |
$default_inputs = array(
|
142 |
array(
|
143 |
+
'name' => $wpmem->get_text( 'pwdchg_password1' ),
|
144 |
'type' => 'password',
|
145 |
'tag' => 'pass1',
|
146 |
'class' => 'password',
|
147 |
'div' => 'div_text',
|
148 |
),
|
149 |
array(
|
150 |
+
'name' => $wpmem->get_text( 'pwdchg_password2' ),
|
151 |
'type' => 'password',
|
152 |
'tag' => 'pass2',
|
153 |
'class' => 'password',
|
165 |
$default_inputs = apply_filters( 'wpmem_inc_changepassword_inputs', $default_inputs );
|
166 |
|
167 |
$defaults = array(
|
168 |
+
'heading' => $wpmem->get_text( 'pwdchg_heading' ),
|
169 |
'action' => 'pwdchange',
|
170 |
+
'button_text' => $wpmem->get_text( 'pwdchg_button' ),
|
171 |
'inputs' => $default_inputs,
|
172 |
);
|
173 |
|
197 |
*
|
198 |
* @since 2.1.0
|
199 |
*
|
200 |
+
* @global object $wpmem The WP_Members object.
|
201 |
+
* @return string $str The generated html fo the reset password form.
|
202 |
*/
|
203 |
function wpmem_inc_resetpassword() {
|
204 |
|
205 |
+
global $wpmem;
|
206 |
+
|
207 |
// Create the default inputs.
|
208 |
$default_inputs = array(
|
209 |
array(
|
210 |
+
'name' => $wpmem->get_text( 'pwdreset_username' ),
|
211 |
'type' => 'text',
|
212 |
'tag' => 'user',
|
213 |
'class' => 'username',
|
214 |
'div' => 'div_text',
|
215 |
),
|
216 |
array(
|
217 |
+
'name' => $wpmem->get_text( 'pwdreset_email' ),
|
218 |
'type' => 'text',
|
219 |
'tag' => 'email',
|
220 |
'class' => 'password',
|
232 |
$default_inputs = apply_filters( 'wpmem_inc_resetpassword_inputs', $default_inputs );
|
233 |
|
234 |
$defaults = array(
|
235 |
+
'heading' => $wpmem->get_text( 'pwdreset_heading' ),
|
236 |
'action' => 'pwdreset',
|
237 |
+
'button_text' => $wpmem->get_text( 'pwdreset_button' ),
|
238 |
'inputs' => $default_inputs,
|
239 |
);
|
240 |
|
334 |
*
|
335 |
* @since 2.9.0
|
336 |
*
|
337 |
+
* @param array An array of arguments to merge with defaults. Default null.
|
338 |
+
* @param string $arr['action'] The action being performed by the form. login|pwdreset|pwdchange|getusername.
|
339 |
*/
|
340 |
$args = apply_filters( 'wpmem_login_form_args', '', $arr['action'] );
|
341 |
|
367 |
*
|
368 |
* @since 2.9.0
|
369 |
*
|
370 |
+
* @param array $rows An array containing the form rows.
|
371 |
+
* @param string $arr['action'] The action being performed by the form. login|pwdreset|pwdchange|getusername.
|
372 |
*/
|
373 |
$rows = apply_filters( 'wpmem_login_form_rows', $rows, $arr['action'] );
|
374 |
|
391 |
*
|
392 |
* @since 2.9.0
|
393 |
*
|
394 |
+
* @param string $hidden The generated HTML of hidden fields.
|
395 |
+
* @param string $arr['action'] The action being performed by the form. login|pwdreset|pwdchange|getusername.
|
396 |
*/
|
397 |
$form = $form . apply_filters( 'wpmem_login_hidden_fields', $hidden, $arr['action'] );
|
398 |
|
399 |
// Build the buttons, filter, and add to the form.
|
400 |
if ( $arr['action'] == 'login' ) {
|
401 |
+
$args['remember_check'] = ( $args['remember_check'] ) ? $args['t'] . wpmem_create_formfield( 'rememberme', 'checkbox', 'forever' ) . ' ' . $wpmem->get_text( 'remember_me' ) . ' ' . $args['n'] : '';
|
402 |
$buttons = $args['remember_check'] . $args['t'] . '<input type="submit" name="Submit" value="' . $arr['button_text'] . '" class="' . $args['button_class'] . '" />' . $args['n'];
|
403 |
} else {
|
404 |
$buttons = '<input type="submit" name="Submit" value="' . $arr['button_text'] . '" class="' . $args['button_class'] . '" />' . $args['n'];
|
411 |
*
|
412 |
* @since 2.9.0
|
413 |
*
|
414 |
+
* @param string $buttons The generated HTML of the form buttons.
|
415 |
+
* @param string $arr['action'] The action being performed by the form. login|pwdreset|pwdchange|getusername.
|
416 |
*/
|
417 |
$form = $form . apply_filters( 'wpmem_login_form_buttons', $args['buttons_before'] . $args['n'] . $buttons . $args['buttons_after'] . $args['n'], $arr['action'] );
|
418 |
|
425 |
*
|
426 |
* @param string The forgot password link.
|
427 |
*/
|
428 |
+
$link = apply_filters( 'wpmem_forgot_link', add_query_arg( 'a', 'pwdreset', $wpmem->user_pages['profile'] ) );
|
429 |
+
$str = $wpmem->get_text( 'forgot_link_before' ) . '<a href="' . $link . '">' . $wpmem->get_text( 'forgot_link' ) . '</a>';
|
430 |
/**
|
431 |
* Filters the forgot password HTML.
|
432 |
*
|
450 |
* @param string The registration page link.
|
451 |
*/
|
452 |
$link = apply_filters( 'wpmem_reg_link', $wpmem->user_pages['register'] );
|
453 |
+
$str = $wpmem->get_text( 'register_link_before' ) . '<a href="' . $link . '">' . $wpmem->get_text( 'register_link' ) . '</a>';
|
454 |
/**
|
455 |
* Filters the register link HTML.
|
456 |
*
|
473 |
*
|
474 |
* @param string The forgot username link.
|
475 |
*/
|
476 |
+
$link = apply_filters( 'wpmem_username_link', add_query_arg( 'a', 'getusername', $wpmem->user_pages['profile'] ) );
|
477 |
+
$str = $wpmem->get_text( 'username_link_before' ) . '<a href="' . $link . '">' . $wpmem->get_text( 'username_link' ) . '</a>';
|
478 |
/**
|
479 |
* Filters the forgot username link HTML.
|
480 |
*
|
513 |
*
|
514 |
* @since 2.7.4
|
515 |
*
|
516 |
+
* @param string $form The HTML of the final generated form.
|
517 |
+
* @param string $arr['action'] The action being performed by the form. login|pwdreset|pwdchange|getusername.
|
518 |
*/
|
519 |
$form = apply_filters( 'wpmem_login_form', $form, $arr['action'] );
|
520 |
|
526 |
*
|
527 |
* @since 2.7.4
|
528 |
*
|
529 |
+
* @param string $str The HTML to add before the form. Default null.
|
530 |
+
* @param string $arr['action'] The action being performed by the form. login|pwdreset|pwdchange|getusername.
|
531 |
*/
|
532 |
$form = apply_filters( 'wpmem_login_form_before', '', $arr['action'] ) . $form;
|
533 |
|
544 |
*
|
545 |
* @since 2.5.1
|
546 |
*
|
547 |
+
* @global object $wpmem The WP_Members object.
|
|
|
548 |
* @global string $wpmem_regchk Used to determine if the form is in an error state.
|
549 |
* @global array $userdata Used to get the user's registration data if they are logged in (user profile edit).
|
550 |
+
* @param string $toggle (optional) Toggles between new registration ('new') and user profile edit ('edit').
|
551 |
+
* @param string $heading (optional) The heading text for the form, null (default) for new registration.
|
552 |
* @return string $form The HTML for the entire form as a string.
|
553 |
*/
|
554 |
function wpmem_inc_registration( $toggle = 'new', $heading = '', $redirect_to = null ) {
|
579 |
'button_class' => 'buttons',
|
580 |
|
581 |
// Required field tags and text.
|
582 |
+
'req_mark' => $wpmem->get_text( 'register_req_mark' ),
|
583 |
+
'req_label' => $wpmem->get_text( 'register_required' ),
|
584 |
'req_label_before' => '<div class="req-text">',
|
585 |
'req_label_after' => '</div>',
|
586 |
|
587 |
// Buttons.
|
588 |
'show_clear_form' => false,
|
589 |
+
'clear_form' => $wpmem->get_text( 'register_clear' ),
|
590 |
+
'submit_register' => $wpmem->get_text( 'register_submit' ),
|
591 |
+
'submit_update' => $wpmem->get_text( 'profile_submit' ),
|
592 |
|
593 |
// Other.
|
594 |
'strip_breaks' => true,
|
619 |
if ( $toggle == 'edit' ) {
|
620 |
// This is the User Profile edit - username is not editable.
|
621 |
$val = $userdata->user_login;
|
622 |
+
$label = '<label for="user_login" class="text">' . $wpmem->get_text( 'profile_username' ) . '</label>';
|
623 |
$input = '<p class="noinput">' . $val . '</p>';
|
624 |
$field_before = ( $args['wrap_inputs'] ) ? '<div class="div_text">' : '';
|
625 |
$field_after = ( $args['wrap_inputs'] ) ? '</div>' : '';
|
626 |
} else {
|
627 |
// This is a new registration.
|
628 |
+
$val = ( isset( $_POST['user_login'] ) ) ? stripslashes( $_POST['user_login'] ) : '';
|
629 |
+
$label = '<label for="user_login" class="text">' . $wpmem->get_text( 'register_username' ) . $args['req_mark'] . '</label>';
|
630 |
+
//$input = wpmem_create_formfield( 'log', 'text', $val, '', 'username' );
|
631 |
+
$input = $wpmem->forms->create_form_field( array(
|
632 |
+
'name' => 'user_login',
|
633 |
+
'type' => 'text',
|
634 |
+
'value' => $val,
|
635 |
+
'valtochk' => '',
|
636 |
+
'required' => true,
|
637 |
+
) );
|
638 |
|
639 |
}
|
640 |
$field_before = ( $args['wrap_inputs'] ) ? '<div class="div_text">' : '';
|
646 |
'meta' => 'username',
|
647 |
'type' => 'text',
|
648 |
'value' => $val,
|
649 |
+
'label_text' => $wpmem->get_text( 'register_username' ),
|
650 |
'row_before' => $args['row_before'],
|
651 |
'label' => $label,
|
652 |
'field_before' => $field_before,
|
670 |
*/
|
671 |
$wpmem_fields = apply_filters( 'wpmem_register_fields_arr', $wpmem->fields, $toggle );
|
672 |
|
673 |
+
$hidden = '';
|
674 |
+
|
675 |
// Loop through the remaining fields.
|
676 |
foreach ( $wpmem_fields as $field ) {
|
677 |
|
688 |
$hidden_tos = wpmem_create_formfield( $field[2], 'hidden', get_user_meta( $userdata->ID, 'tos', true ) );
|
689 |
}
|
690 |
|
691 |
+
// Handle hidden fields
|
692 |
+
if ( 'hidden' == $field[3] ) {
|
693 |
+
$do_row = false;
|
694 |
+
$hidden.= $wpmem->forms->create_form_field( array(
|
695 |
+
'name' => $field[2],
|
696 |
+
'type' => $field[3],
|
697 |
+
'value' => $val,
|
698 |
+
'valtochk' => $valtochk,
|
699 |
+
//'class' => ( $class ) ? $class : 'textbox',
|
700 |
+
'required' => ( 'y' == $field[5] ) ? true : false,
|
701 |
+
) );
|
702 |
+
}
|
703 |
+
|
704 |
// If the field is set to display and we aren't skipping, construct the row.
|
705 |
if ( $field[4] == 'y' && $do_row == true ) {
|
706 |
|
707 |
// Label for all but TOS.
|
708 |
if ( $field[2] != 'tos' ) {
|
709 |
|
710 |
+
$class = ( $field[3] == 'password' || $field[3] == 'email' || $field[3] == 'url' ) ? 'text' : $field[3];
|
711 |
|
712 |
$label = '<label for="' . $field[2] . '" class="' . $class . '">' . __( $field[1], 'wp-members' );
|
713 |
$label = ( $field[5] == 'y' ) ? $label . $args['req_mark'] : $label;
|
742 |
}
|
743 |
|
744 |
} else {
|
745 |
+
if ( 'file' == $field[3] ) {
|
746 |
+
$val = ( isset( $_FILES[ $field[2] ]['name'] ) ) ? $_FILES[ $field[2] ]['name'] : '' ;
|
747 |
+
} else {
|
748 |
+
$val = ( isset( $_POST[ $field[2] ] ) ) ? $_POST[ $field[2] ] : '';
|
749 |
+
}
|
750 |
}
|
751 |
|
752 |
// Does the tos field.
|
765 |
$link = do_shortcode( $tos_content );
|
766 |
$tos_pop = '<a href="' . $link . '" target="_blank">';
|
767 |
} else {
|
768 |
+
$tos_pop = "<a href=\"#\" onClick=\"window.open('" . WPMEM_DIR . "/wp-members-tos.php','mywindow');\">";
|
769 |
}
|
770 |
|
771 |
/**
|
776 |
* @param string The link text.
|
777 |
* @param string $toggle Toggle new registration or profile update. new|edit.
|
778 |
*/
|
779 |
+
$input.= apply_filters( 'wpmem_tos_link_txt', sprintf( $wpmem->get_text( 'register_tos' ), $tos_pop, '</a>' ), $toggle );
|
780 |
|
781 |
// In previous versions, the div class would end up being the same as the row before.
|
782 |
$field_before = ( $args['wrap_inputs'] ) ? '<div class="div_text">' : '';
|
793 |
}
|
794 |
|
795 |
// For dropdown select.
|
796 |
+
if ( $field[3] == 'select' || $field[3] == 'radio' || $field[3] == 'multiselect' || $field[3] == 'multicheckbox' ) {
|
797 |
$valtochk = $val;
|
798 |
$val = $field[7];
|
799 |
}
|
800 |
|
801 |
if ( ! isset( $valtochk ) ) { $valtochk = ''; }
|
802 |
|
803 |
+
if ( 'edit' == $toggle && ( 'file' == $field[3] || 'image' == $field[3] ) ) {
|
804 |
+
|
805 |
+
$attachment_url = wp_get_attachment_url( $val );
|
806 |
+
$empty_file = '<span class="description">' . __( 'None' ) . '</span>';
|
807 |
+
if ( 'file' == $field[3] ) {
|
808 |
+
$input = ( $attachment_url ) ? '<a href="' . $attachment_url . '">' . get_the_title( $val ) . '</a>' : $empty_file;
|
809 |
+
} else {
|
810 |
+
$input = ( $attachment_url ) ? '<img src="' . $attachment_url . '">' : $empty_file;
|
811 |
+
}
|
812 |
+
// @todo - come up with a way to handle file updates - user profile form does not support multitype
|
813 |
+
$input.= '<br />' . $wpmem->get_text( 'profile_upload' ) . '<br />';
|
814 |
+
$input.= wpmem_create_formfield( $field[2], $field[3], $val, $valtochk );
|
815 |
+
|
816 |
+
} else {
|
817 |
+
|
818 |
+
// For all other input types.
|
819 |
+
//$input = wpmem_create_formfield( $field[2], $field[3], $val, $valtochk );
|
820 |
+
$input = $wpmem->forms->create_form_field( array(
|
821 |
+
'name' => $field[2],
|
822 |
+
'type' => $field[3],
|
823 |
+
'value' => $val,
|
824 |
+
'valtochk' => $valtochk,
|
825 |
+
//'class' => ( $class ) ? $class : 'textbox',
|
826 |
+
'required' => ( 'y' == $field[5] ) ? true : false,
|
827 |
+
) );
|
828 |
+
|
829 |
+
}
|
830 |
|
831 |
// Determine input wrappers.
|
832 |
$field_before = ( $args['wrap_inputs'] ) ? '<div class="div_' . $class . '">' : '';
|
837 |
|
838 |
// If the row is set to display, add the row to the form array.
|
839 |
if ( $field[4] == 'y' ) {
|
840 |
+
|
841 |
+
$values = '';
|
842 |
+
if ( 'multicheckbox' == $field[3] || 'select' == $field[3] || 'multiselect' == $field[3] || 'radio' == $field[3] ) {
|
843 |
+
$values = $val;
|
844 |
+
$val = $valtochk;
|
845 |
+
}
|
846 |
+
|
847 |
$rows[$field[2]] = array(
|
848 |
'order' => $field[0],
|
849 |
'meta' => $field[2],
|
850 |
'type' => $field[3],
|
851 |
'value' => $val,
|
852 |
+
'values' => $values,
|
853 |
'label_text' => __( $field[1], 'wp-members' ),
|
854 |
'row_before' => $args['row_before'],
|
855 |
'label' => $label,
|
869 |
'meta' => '',
|
870 |
'type' => 'text',
|
871 |
'value' => '',
|
872 |
+
'values' => '',
|
873 |
'label_text' => $row['label_text'],
|
874 |
'row_before' => $args['row_before'],
|
875 |
'label' => $row['label'],
|
876 |
+
'field_before' => $field_before,
|
877 |
'field' => $row['field'],
|
878 |
+
'field_after' => $field_after,
|
879 |
'row_after' => $args['row_after'],
|
880 |
);
|
881 |
}
|
896 |
* @type string meta Field meta tag (not used for display).
|
897 |
* @type string type Input field type (not used for display).
|
898 |
* @type string value Input field value (not used for display).
|
899 |
+
* @type string values Possible field values (dropdown, multiple select/check, radio).
|
900 |
* @type string label_text Raw text for the label (not used for display).
|
901 |
* @type string row_before Opening wrapper tag around the row.
|
902 |
* @type string label Label tag.
|
945 |
// Create hidden fields.
|
946 |
$var = ( $toggle == 'edit' ) ? 'update' : 'register';
|
947 |
$redirect_to = ( isset( $_REQUEST['redirect_to'] ) ) ? esc_url( $_REQUEST['redirect_to'] ) : ( ( $redirect_to ) ? $redirect_to : get_permalink() );
|
948 |
+
$hidden .= '<input name="a" type="hidden" value="' . $var . '" />' . $args['n'];
|
949 |
+
$hidden .= '<input name="wpmem_reg_page" type="hidden" value="' . get_permalink() . '" />' . $args['n'];
|
950 |
if ( $redirect_to != get_permalink() ) {
|
951 |
+
$hidden .= '<input name="redirect_to" type="hidden" value="' . $redirect_to . '" />' . $args['n'];
|
952 |
}
|
953 |
$hidden = ( isset( $hidden_tos ) ) ? $hidden . $hidden_tos . $args['n'] : $hidden;
|
954 |
|
997 |
* @param string $str
|
998 |
* @param string $toggle Toggle new registration or profile update. new|edit.
|
999 |
*/
|
1000 |
+
$heading = ( !$heading ) ? apply_filters( 'wpmem_register_heading', $wpmem->get_text( 'register_heading' ), $toggle ) : $heading;
|
1001 |
$form = $args['heading_before'] . $heading . $args['heading_after'] . $args['n'] . $form;
|
1002 |
|
1003 |
// Apply fieldset wrapper.
|
1011 |
|
1012 |
// Apply form wrapper.
|
1013 |
$enctype = ( $enctype == 'multipart/form-data' ) ? ' enctype="multipart/form-data"' : '';
|
1014 |
+
$post_to = get_permalink();
|
1015 |
$form = '<form name="form" method="post"' . $enctype . ' action="' . $post_to . '" id="' . $args['form_id'] . '" class="' . $args['form_class'] . '">' . $args['n'] . $form . $args['n'] . '</form>';
|
1016 |
|
1017 |
// Apply anchor.
|
1040 |
* @type string meta Field meta tag (not used for display).
|
1041 |
* @type string type Input field type (not used for display).
|
1042 |
* @type string value Input field value (not used for display).
|
1043 |
+
* @type string values The possible values for the field (dropdown, multiple select/checkbox, radio group).
|
1044 |
* @type string label_text Raw text for the label (not used for display).
|
1045 |
* @type string row_before Opening wrapper tag around the row.
|
1046 |
* @type string label Label tag.
|
1151 |
*
|
1152 |
* @since 2.9.5
|
1153 |
*
|
1154 |
+
* @global object $wpmem The WP_Members object.
|
1155 |
* @return array {
|
1156 |
* HTML Form elements for Really Simple CAPTCHA.
|
1157 |
*
|
1161 |
* }
|
1162 |
*/
|
1163 |
function wpmem_build_rs_captcha() {
|
1164 |
+
|
1165 |
+
global $wpmem;
|
1166 |
|
1167 |
if ( defined( 'REALLYSIMPLECAPTCHA_VERSION' ) ) {
|
1168 |
// setup defaults
|
1216 |
$pre = $wpmem_captcha_prefix;
|
1217 |
|
1218 |
return array(
|
1219 |
+
'label_text' => $wpmem->get_text( 'register_rscaptcha' ),
|
1220 |
+
'label' => '<label class="text" for="captcha">' . $wpmem->get_text( 'register_rscaptcha' ) . '</label>',
|
1221 |
'field' => '<input id="captcha_code" name="captcha_code" size="'.$size.'" type="text" />
|
1222 |
<input id="captcha_prefix" name="captcha_prefix" type="hidden" value="' . $pre . '" />
|
1223 |
<img src="'.$src.'" alt="captcha" width="'.$img_w.'" height="'.$img_h.'" />'
|
inc/register.php
CHANGED
@@ -49,7 +49,7 @@ function wpmem_registration( $toggle ) {
|
|
49 |
|
50 |
// Is this a registration or a user profile update?
|
51 |
if ( $toggle == 'register' ) {
|
52 |
-
$fields['username'] = ( isset( $_POST['
|
53 |
}
|
54 |
|
55 |
// Add the user email to the $fields array for _data hooks.
|
@@ -59,17 +59,40 @@ function wpmem_registration( $toggle ) {
|
|
59 |
$wpmem_fields = $wpmem->fields; // get_option( 'wpmembers_fields' );
|
60 |
foreach ( $wpmem_fields as $meta ) {
|
61 |
if ( $meta[4] == 'y' ) {
|
62 |
-
if ( $meta[2] != 'password' ) {
|
63 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
64 |
} else {
|
65 |
// We do have password as part of the registration form.
|
66 |
-
|
|
|
|
|
|
|
|
|
|
|
67 |
}
|
68 |
}
|
69 |
}
|
70 |
|
71 |
/**
|
72 |
-
* Filter the submitted form
|
73 |
*
|
74 |
* @since 2.8.2
|
75 |
*
|
@@ -83,9 +106,18 @@ function wpmem_registration( $toggle ) {
|
|
83 |
foreach ( $wpmem_fields_rev as $meta ) {
|
84 |
$pass_arr = array( 'password', 'confirm_password', 'password_confirm' );
|
85 |
$pass_chk = ( $toggle == 'update' && in_array( $meta[2], $pass_arr ) ) ? true : false;
|
|
|
86 |
if ( $meta[5] == 'y' && $pass_chk == false ) {
|
87 |
-
if (
|
88 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
89 |
}
|
90 |
}
|
91 |
}
|
@@ -106,9 +138,9 @@ function wpmem_registration( $toggle ) {
|
|
106 |
// Validate username and email fields.
|
107 |
$wpmem_themsg = ( email_exists( $fields['user_email'] ) ) ? "email" : $wpmem_themsg;
|
108 |
$wpmem_themsg = ( username_exists( $fields['username'] ) ) ? "user" : $wpmem_themsg;
|
109 |
-
$wpmem_themsg = ( ! is_email( $fields['user_email']) ) ?
|
110 |
-
$wpmem_themsg = ( ! validate_username( $fields['username'] ) ) ?
|
111 |
-
$wpmem_themsg = ( ! $fields['username'] ) ?
|
112 |
|
113 |
// If there is an error from username, email, or required field validation, stop registration and return the error.
|
114 |
if ( $wpmem_themsg ) {
|
@@ -119,10 +151,10 @@ function wpmem_registration( $toggle ) {
|
|
119 |
|
120 |
// If form contains password and email confirmation, validate that they match.
|
121 |
if ( array_key_exists( 'confirm_password', $fields ) && $fields['confirm_password'] != $fields ['password'] ) {
|
122 |
-
$wpmem_themsg =
|
123 |
}
|
124 |
if ( array_key_exists( 'confirm_email', $fields ) && $fields['confirm_email'] != $fields ['user_email'] ) {
|
125 |
-
$wpmem_themsg =
|
126 |
}
|
127 |
|
128 |
// Get the captcha settings (api keys).
|
@@ -134,7 +166,7 @@ function wpmem_registration( $toggle ) {
|
|
134 |
// If there is no api key, the captcha never displayed to the end user.
|
135 |
if ( $wpmem_captcha['recaptcha']['public'] && $wpmem_captcha['recaptcha']['private'] ) {
|
136 |
if ( ! $_POST["recaptcha_response_field"] ) { // validate for empty captcha field
|
137 |
-
$wpmem_themsg =
|
138 |
return "empty"; exit();
|
139 |
}
|
140 |
}
|
@@ -200,7 +232,7 @@ function wpmem_registration( $toggle ) {
|
|
200 |
|
201 |
// If there is no captcha value, return error.
|
202 |
if ( ! $captcha ) {
|
203 |
-
$wpmem_themsg =
|
204 |
return "empty"; exit();
|
205 |
}
|
206 |
|
@@ -215,7 +247,7 @@ function wpmem_registration( $toggle ) {
|
|
215 |
|
216 |
// If captcha validation was unsuccessful.
|
217 |
if ( $response['success'] == false ) {
|
218 |
-
$wpmem_themsg =
|
219 |
return "empty"; exit();
|
220 |
}
|
221 |
}
|
@@ -224,7 +256,7 @@ function wpmem_registration( $toggle ) {
|
|
224 |
$fields['password'] = ( ! isset( $_POST['password'] ) ) ? wp_generate_password() : $_POST['password'];
|
225 |
|
226 |
// Add for _data hooks
|
227 |
-
$fields['user_registered'] =
|
228 |
$fields['user_role'] = get_option( 'default_role' );
|
229 |
$fields['wpmem_reg_ip'] = $_SERVER['REMOTE_ADDR'];
|
230 |
$fields['wpmem_reg_url'] = ( isset( $_REQUEST['wpmem_reg_page'] ) ) ? $_REQUEST['wpmem_reg_page'] : $_REQUEST['redirect_to'];
|
@@ -312,7 +344,25 @@ function wpmem_registration( $toggle ) {
|
|
312 |
update_user_meta( $fields['ID'], 'wpmem_reg_url', $fields['wpmem_reg_url'] );
|
313 |
|
314 |
// Set user expiration, if used.
|
315 |
-
if ( $wpmem->use_exp == 1 && $wpmem->mod_reg != 1 ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
316 |
|
317 |
/**
|
318 |
* Fires after user insertion but before email.
|
@@ -335,13 +385,19 @@ function wpmem_registration( $toggle ) {
|
|
335 |
if ( $wpmem->notify == 1 ) {
|
336 |
wpmem_notify_admin( $fields['ID'], $wpmem_fields, $fields );
|
337 |
}
|
|
|
|
|
|
|
|
|
|
|
338 |
|
339 |
/**
|
340 |
* Fires after registration is complete.
|
341 |
*
|
342 |
* @since 2.7.1
|
|
|
343 |
*/
|
344 |
-
do_action( 'wpmem_register_redirect' );
|
345 |
|
346 |
// successful registration message
|
347 |
return "success"; exit();
|
@@ -358,14 +414,14 @@ function wpmem_registration( $toggle ) {
|
|
358 |
* Doing a check for existing email is not the same as a new reg. check first to
|
359 |
* see if it's different, then check if it is a valid address and it exists.
|
360 |
*/
|
361 |
-
global $current_user;
|
362 |
if ( $fields['user_email'] != $current_user->user_email ) {
|
363 |
if ( email_exists( $fields['user_email'] ) ) {
|
364 |
return "email";
|
365 |
exit();
|
366 |
}
|
367 |
if ( !is_email( $fields['user_email']) ) {
|
368 |
-
$wpmem_themsg =
|
369 |
return "updaterr";
|
370 |
exit();
|
371 |
}
|
@@ -373,7 +429,9 @@ function wpmem_registration( $toggle ) {
|
|
373 |
|
374 |
// If form includes email confirmation, validate that they match.
|
375 |
if ( array_key_exists( 'confirm_email', $fields ) && $fields['confirm_email'] != $fields ['user_email'] ) {
|
376 |
-
$wpmem_themsg =
|
|
|
|
|
377 |
}
|
378 |
|
379 |
// Add the user_ID to the fields array.
|
@@ -396,11 +454,10 @@ function wpmem_registration( $toggle ) {
|
|
396 |
*/
|
397 |
do_action( 'wpmem_pre_update_data', $fields );
|
398 |
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
if ( $wpmem_themsg ){ return $wpmem_themsg; }
|
404 |
|
405 |
// A list of fields that can be updated by wp_update_user.
|
406 |
$native_fields = array(
|
@@ -422,25 +479,44 @@ function wpmem_registration( $toggle ) {
|
|
422 |
foreach ( $wpmem_fields as $meta ) {
|
423 |
// If the field is not excluded, update accordingly.
|
424 |
if ( ! in_array( $meta[2], wpmem_get_excluded_meta( 'update' ) ) ) {
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
442 |
}
|
443 |
-
break;
|
444 |
}
|
445 |
}
|
446 |
}
|
49 |
|
50 |
// Is this a registration or a user profile update?
|
51 |
if ( $toggle == 'register' ) {
|
52 |
+
$fields['username'] = ( isset( $_POST['user_login'] ) ) ? sanitize_user( $_POST['user_login'] ) : '';
|
53 |
}
|
54 |
|
55 |
// Add the user email to the $fields array for _data hooks.
|
59 |
$wpmem_fields = $wpmem->fields; // get_option( 'wpmembers_fields' );
|
60 |
foreach ( $wpmem_fields as $meta ) {
|
61 |
if ( $meta[4] == 'y' ) {
|
62 |
+
if ( $meta[2] != 'password' || $meta[2] != 'confirm_password' ) {
|
63 |
+
if ( isset( $_POST[ $meta[2] ] ) ) {
|
64 |
+
switch ( $meta[3] ) {
|
65 |
+
case 'checkbox':
|
66 |
+
$fields[ $meta[2] ] = $_POST[ $meta[2] ];
|
67 |
+
break;
|
68 |
+
case 'multiselect':
|
69 |
+
case 'multicheckbox':
|
70 |
+
$fields[ $meta[2] ] = ( isset( $_POST[ $meta[2] ] ) ) ? implode( '|', $_POST[ $meta[2] ] ) : '';
|
71 |
+
break;
|
72 |
+
case 'textarea':
|
73 |
+
$fields[ $meta[2] ] = $_POST[ $meta[2] ];
|
74 |
+
break;
|
75 |
+
default:
|
76 |
+
$fields[ $meta[2] ] = sanitize_text_field( $_POST[ $meta[2] ] );
|
77 |
+
break;
|
78 |
+
}
|
79 |
+
} else {
|
80 |
+
$fields[ $meta[2] ] = '';
|
81 |
+
}
|
82 |
} else {
|
83 |
// We do have password as part of the registration form.
|
84 |
+
if ( isset( $_POST['password'] ) ) {
|
85 |
+
$fields['password'] = $_POST['password'];
|
86 |
+
}
|
87 |
+
if ( isset( $_POST['confirm_password'] ) ) {
|
88 |
+
$fields['confirm_password'] = $_POST['confirm_password'];
|
89 |
+
}
|
90 |
}
|
91 |
}
|
92 |
}
|
93 |
|
94 |
/**
|
95 |
+
* Filter the submitted form fields prior to validation.
|
96 |
*
|
97 |
* @since 2.8.2
|
98 |
*
|
106 |
foreach ( $wpmem_fields_rev as $meta ) {
|
107 |
$pass_arr = array( 'password', 'confirm_password', 'password_confirm' );
|
108 |
$pass_chk = ( $toggle == 'update' && in_array( $meta[2], $pass_arr ) ) ? true : false;
|
109 |
+
// Validation if the field is required.
|
110 |
if ( $meta[5] == 'y' && $pass_chk == false ) {
|
111 |
+
if ( 'file' == $meta[3] || 'image' == $meta[3] ) {
|
112 |
+
// If the required field is a file type.
|
113 |
+
if ( empty( $_FILES[ $meta[2] ]['name'] ) ) {
|
114 |
+
$wpmem_themsg = sprintf( $wpmem->get_text( 'reg_empty_field' ), __( $meta[1], 'wp-members' ) );
|
115 |
+
}
|
116 |
+
} else {
|
117 |
+
// If the required field is any other field type.
|
118 |
+
if ( ! $fields[ $meta[2] ] ) {
|
119 |
+
$wpmem_themsg = sprintf( $wpmem->get_text( 'reg_empty_field' ), __( $meta[1], 'wp-members' ) );
|
120 |
+
}
|
121 |
}
|
122 |
}
|
123 |
}
|
138 |
// Validate username and email fields.
|
139 |
$wpmem_themsg = ( email_exists( $fields['user_email'] ) ) ? "email" : $wpmem_themsg;
|
140 |
$wpmem_themsg = ( username_exists( $fields['username'] ) ) ? "user" : $wpmem_themsg;
|
141 |
+
$wpmem_themsg = ( ! is_email( $fields['user_email']) ) ? $wpmem->get_text( 'reg_valid_email' ) : $wpmem_themsg;
|
142 |
+
$wpmem_themsg = ( ! validate_username( $fields['username'] ) ) ? $wpmem->get_text( 'reg_non_alphanumeric' ) : $wpmem_themsg;
|
143 |
+
$wpmem_themsg = ( ! $fields['username'] ) ? $wpmem->get_text( 'reg_empty_username' ) : $wpmem_themsg;
|
144 |
|
145 |
// If there is an error from username, email, or required field validation, stop registration and return the error.
|
146 |
if ( $wpmem_themsg ) {
|
151 |
|
152 |
// If form contains password and email confirmation, validate that they match.
|
153 |
if ( array_key_exists( 'confirm_password', $fields ) && $fields['confirm_password'] != $fields ['password'] ) {
|
154 |
+
$wpmem_themsg = $wpmem->get_text( 'reg_password_match' );
|
155 |
}
|
156 |
if ( array_key_exists( 'confirm_email', $fields ) && $fields['confirm_email'] != $fields ['user_email'] ) {
|
157 |
+
$wpmem_themsg = $wpmem->get_text( 'reg_email_match' );
|
158 |
}
|
159 |
|
160 |
// Get the captcha settings (api keys).
|
166 |
// If there is no api key, the captcha never displayed to the end user.
|
167 |
if ( $wpmem_captcha['recaptcha']['public'] && $wpmem_captcha['recaptcha']['private'] ) {
|
168 |
if ( ! $_POST["recaptcha_response_field"] ) { // validate for empty captcha field
|
169 |
+
$wpmem_themsg = $wpmem->get_text( 'reg_empty_captcha' );
|
170 |
return "empty"; exit();
|
171 |
}
|
172 |
}
|
232 |
|
233 |
// If there is no captcha value, return error.
|
234 |
if ( ! $captcha ) {
|
235 |
+
$wpmem_themsg = $wpmem->get_text( 'reg_empty_captcha' );
|
236 |
return "empty"; exit();
|
237 |
}
|
238 |
|
247 |
|
248 |
// If captcha validation was unsuccessful.
|
249 |
if ( $response['success'] == false ) {
|
250 |
+
$wpmem_themsg = $wpmem->get_text( 'reg_invalid_captcha' );
|
251 |
return "empty"; exit();
|
252 |
}
|
253 |
}
|
256 |
$fields['password'] = ( ! isset( $_POST['password'] ) ) ? wp_generate_password() : $_POST['password'];
|
257 |
|
258 |
// Add for _data hooks
|
259 |
+
$fields['user_registered'] = current_time( 'mysql', 1 );
|
260 |
$fields['user_role'] = get_option( 'default_role' );
|
261 |
$fields['wpmem_reg_ip'] = $_SERVER['REMOTE_ADDR'];
|
262 |
$fields['wpmem_reg_url'] = ( isset( $_REQUEST['wpmem_reg_page'] ) ) ? $_REQUEST['wpmem_reg_page'] : $_REQUEST['redirect_to'];
|
344 |
update_user_meta( $fields['ID'], 'wpmem_reg_url', $fields['wpmem_reg_url'] );
|
345 |
|
346 |
// Set user expiration, if used.
|
347 |
+
if ( $wpmem->use_exp == 1 && $wpmem->mod_reg != 1 ) {
|
348 |
+
wpmem_set_exp( $fields['ID'] );
|
349 |
+
}
|
350 |
+
|
351 |
+
// Handle file uploads, if any.
|
352 |
+
if ( ! empty( $_FILES ) ) {
|
353 |
+
|
354 |
+
foreach ( $wpmem->fields as $file_field ) {
|
355 |
+
|
356 |
+
if ( ( 'file' == $file_field[3] || 'image' == $file_field[3] ) && is_array( $_FILES[ $file_field[2] ] ) ) {
|
357 |
+
|
358 |
+
// Upload the file and save it as an attachment.
|
359 |
+
$file_post_id = $wpmem->forms->do_file_upload( $_FILES[ $file_field[2] ], $fields['ID'] );
|
360 |
+
|
361 |
+
// Save the attachment ID as user meta.
|
362 |
+
update_user_meta( $fields['ID'], $file_field[2], $file_post_id );
|
363 |
+
}
|
364 |
+
}
|
365 |
+
}
|
366 |
|
367 |
/**
|
368 |
* Fires after user insertion but before email.
|
385 |
if ( $wpmem->notify == 1 ) {
|
386 |
wpmem_notify_admin( $fields['ID'], $wpmem_fields, $fields );
|
387 |
}
|
388 |
+
|
389 |
+
if ( isset( $_POST['redirect_to'] ) ) {
|
390 |
+
wp_redirect( $_POST['redirect_to'] );
|
391 |
+
exit();
|
392 |
+
}
|
393 |
|
394 |
/**
|
395 |
* Fires after registration is complete.
|
396 |
*
|
397 |
* @since 2.7.1
|
398 |
+
* @since 3.1.0 Added $fields
|
399 |
*/
|
400 |
+
do_action( 'wpmem_register_redirect', $fields );
|
401 |
|
402 |
// successful registration message
|
403 |
return "success"; exit();
|
414 |
* Doing a check for existing email is not the same as a new reg. check first to
|
415 |
* see if it's different, then check if it is a valid address and it exists.
|
416 |
*/
|
417 |
+
global $current_user; wp_get_current_user();
|
418 |
if ( $fields['user_email'] != $current_user->user_email ) {
|
419 |
if ( email_exists( $fields['user_email'] ) ) {
|
420 |
return "email";
|
421 |
exit();
|
422 |
}
|
423 |
if ( !is_email( $fields['user_email']) ) {
|
424 |
+
$wpmem_themsg = $wpmem->get_text( 'reg_valid_email' );
|
425 |
return "updaterr";
|
426 |
exit();
|
427 |
}
|
429 |
|
430 |
// If form includes email confirmation, validate that they match.
|
431 |
if ( array_key_exists( 'confirm_email', $fields ) && $fields['confirm_email'] != $fields ['user_email'] ) {
|
432 |
+
$wpmem_themsg = $wpmem->get_text( 'reg_email_match' );
|
433 |
+
return "updaterr";
|
434 |
+
exit();
|
435 |
}
|
436 |
|
437 |
// Add the user_ID to the fields array.
|
454 |
*/
|
455 |
do_action( 'wpmem_pre_update_data', $fields );
|
456 |
|
457 |
+
// If the _pre_update_data hook sends back an error message.
|
458 |
+
if ( $wpmem_themsg ){
|
459 |
+
return "updaterr";
|
460 |
+
}
|
|
|
461 |
|
462 |
// A list of fields that can be updated by wp_update_user.
|
463 |
$native_fields = array(
|
479 |
foreach ( $wpmem_fields as $meta ) {
|
480 |
// If the field is not excluded, update accordingly.
|
481 |
if ( ! in_array( $meta[2], wpmem_get_excluded_meta( 'update' ) ) ) {
|
482 |
+
if ( 'file' != $meta[3] && 'image' != $meta[3] ) {
|
483 |
+
switch ( $meta[2] ) {
|
484 |
+
|
485 |
+
// If the field can be updated by wp_update_user.
|
486 |
+
case( in_array( $meta[2], $native_fields ) ):
|
487 |
+
$fields[ $meta[2] ] = ( isset( $fields[ $meta[2] ] ) ) ? $fields[ $meta[2] ] : '';
|
488 |
+
$native_update[ $meta[2] ] = $fields[ $meta[2] ];
|
489 |
+
break;
|
490 |
+
|
491 |
+
// If the field is password.
|
492 |
+
case( 'password' ):
|
493 |
+
// Do nothing.
|
494 |
+
break;
|
495 |
+
|
496 |
+
// Everything else goes into wp_usermeta.
|
497 |
+
default:
|
498 |
+
if ( $meta[4] == 'y' ) {
|
499 |
+
update_user_meta( $user_ID, $meta[2], $fields[ $meta[2] ] );
|
500 |
+
}
|
501 |
+
break;
|
502 |
+
}
|
503 |
+
}
|
504 |
+
}
|
505 |
+
}
|
506 |
+
|
507 |
+
// Handle file uploads, if any.
|
508 |
+
if ( ! empty( $_FILES ) ) {
|
509 |
+
|
510 |
+
foreach ( $wpmem->fields as $file_field ) {
|
511 |
+
|
512 |
+
if ( ( 'file' == $file_field[3] || 'image' == $file_field[3] ) && is_array( $_FILES[ $file_field[2] ] ) ) {
|
513 |
+
if ( ! empty( $_FILES[ $file_field[2] ]['name'] ) ) {
|
514 |
+
// Upload the file and save it as an attachment.
|
515 |
+
$file_post_id = $wpmem->forms->do_file_upload( $_FILES[ $file_field[2] ], $fields['ID'] );
|
516 |
+
|
517 |
+
// Save the attachment ID as user meta.
|
518 |
+
update_user_meta( $fields['ID'], $file_field[2], $file_post_id );
|
519 |
}
|
|
|
520 |
}
|
521 |
}
|
522 |
}
|
inc/shortcodes.php
CHANGED
@@ -107,13 +107,17 @@ function wpmem_sc_forms( $atts, $content = null, $tag = 'wpmem_form' ) {
|
|
107 |
*/
|
108 |
$content = ( $content ) ? $content : wpmem_inc_memberlinks( 'register' );
|
109 |
} else {
|
|
|
|
|
|
|
|
|
110 |
// @todo Can this be moved into another function? Should $wpmem get an error message handler?
|
111 |
if ( $wpmem->regchk == 'captcha' ) {
|
112 |
global $wpmem_captcha_err;
|
113 |
$wpmem_themsg = __( 'There was an error with the CAPTCHA form.' ) . '<br /><br />' . $wpmem_captcha_err;
|
114 |
}
|
115 |
$content = ( $wpmem_themsg || $wpmem->regchk == 'success' ) ? wpmem_inc_regmessage( $wpmem->regchk, $wpmem_themsg ) : '';
|
116 |
-
$content .= ( $wpmem->regchk == 'success' ) ? wpmem_inc_login() : wpmem_inc_registration( 'new', '', $redirect_to );
|
117 |
}
|
118 |
break;
|
119 |
|
@@ -245,36 +249,6 @@ function wpmem_sc_logged_out( $atts, $content = null, $tag ) {
|
|
245 |
}
|
246 |
|
247 |
|
248 |
-
/**
|
249 |
-
* Displays login form when called by shortcode.
|
250 |
-
*
|
251 |
-
* @since 3.0.0
|
252 |
-
*
|
253 |
-
* @global object $wpmem The WP_Members object.
|
254 |
-
*
|
255 |
-
* @param $atts
|
256 |
-
* @param $content
|
257 |
-
* @param $tag
|
258 |
-
* @return $content
|
259 |
-
|
260 |
-
function wpmem_sc_login_form( $atts, $content, $tag ) {
|
261 |
-
|
262 |
-
// Dependencies.
|
263 |
-
global $wpmem;
|
264 |
-
include_once( WPMEM_PATH . 'inc/core.php' );
|
265 |
-
include_once( WPMEM_PATH . 'inc/dialogs.php' );
|
266 |
-
// Defaults.
|
267 |
-
$redirect_to = ( isset( $atts['redirect_to'] ) ) ? $atts['redirect_to'] : null;
|
268 |
-
$texturize = ( isset( $atts['texturize'] ) ) ? $atts['texturize'] : false;
|
269 |
-
|
270 |
-
if ( is_user_logged_in() ) {
|
271 |
-
return ( $content ) ? $content : wpmem_inc_memberlinks( 'login' );
|
272 |
-
} else {
|
273 |
-
return ( $wpmem->regchk == 'loginfailed' ) ? wpmem_inc_loginfailed() : wpmem_inc_login( 'login', $redirect_to, $texturize );
|
274 |
-
}
|
275 |
-
} */
|
276 |
-
|
277 |
-
|
278 |
if ( ! function_exists( 'wpmem_shortcode' ) ):
|
279 |
/**
|
280 |
* Executes various shortcodes.
|
@@ -339,14 +313,6 @@ function wpmem_shortcode( $attr, $content = null, $tag = 'wp-members' ) {
|
|
339 |
return do_shortcode( wpmem_sc_logged_in( $atts, $content, $tag ) );
|
340 |
}
|
341 |
|
342 |
-
// @deprecated 3.0.0
|
343 |
-
// Handles the wpmem_logged_out tag with no attributes & the user is not logged in.
|
344 |
-
/*
|
345 |
-
if ( $tag == 'wpmem_logged_out' && ( ! $attr ) && ! is_user_logged_in() ) {
|
346 |
-
return do_shortcode( $content );
|
347 |
-
}
|
348 |
-
*/
|
349 |
-
|
350 |
// Handles the 'field' attribute.
|
351 |
if ( $atts['field'] || $tag == 'wpmem_field' ) {
|
352 |
if ( $atts['id'] ) {
|
@@ -371,7 +337,7 @@ function wpmem_shortcode( $attr, $content = null, $tag = 'wp-members' ) {
|
|
371 |
|
372 |
// Logout link shortcode.
|
373 |
if ( is_user_logged_in() && $tag == 'wpmem_logout' ) {
|
374 |
-
$link = ( $atts['url'] ) ?
|
375 |
$text = ( $content ) ? $content : __( 'Click here to log out.', 'wp-members' );
|
376 |
return do_shortcode( "<a href=\"$link\">$text</a>" );
|
377 |
}
|
@@ -551,4 +517,17 @@ function wpmem_sc_user_count( $atts, $content = null ) {
|
|
551 |
return ( $do_query ) ? $atts['label'] . $user_meta_query : '';
|
552 |
}
|
553 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
554 |
// End of file.
|
107 |
*/
|
108 |
$content = ( $content ) ? $content : wpmem_inc_memberlinks( 'register' );
|
109 |
} else {
|
110 |
+
if ( $wpmem->regchk == 'loginfailed' ) {
|
111 |
+
$content = wpmem_inc_loginfailed() . wpmem_inc_login( 'login', $redirect_to );
|
112 |
+
break;
|
113 |
+
}
|
114 |
// @todo Can this be moved into another function? Should $wpmem get an error message handler?
|
115 |
if ( $wpmem->regchk == 'captcha' ) {
|
116 |
global $wpmem_captcha_err;
|
117 |
$wpmem_themsg = __( 'There was an error with the CAPTCHA form.' ) . '<br /><br />' . $wpmem_captcha_err;
|
118 |
}
|
119 |
$content = ( $wpmem_themsg || $wpmem->regchk == 'success' ) ? wpmem_inc_regmessage( $wpmem->regchk, $wpmem_themsg ) : '';
|
120 |
+
$content .= ( $wpmem->regchk == 'success' ) ? wpmem_inc_login( 'login', $redirect_to ) : wpmem_inc_registration( 'new', '', $redirect_to );
|
121 |
}
|
122 |
break;
|
123 |
|
249 |
}
|
250 |
|
251 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
252 |
if ( ! function_exists( 'wpmem_shortcode' ) ):
|
253 |
/**
|
254 |
* Executes various shortcodes.
|
313 |
return do_shortcode( wpmem_sc_logged_in( $atts, $content, $tag ) );
|
314 |
}
|
315 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
316 |
// Handles the 'field' attribute.
|
317 |
if ( $atts['field'] || $tag == 'wpmem_field' ) {
|
318 |
if ( $atts['id'] ) {
|
337 |
|
338 |
// Logout link shortcode.
|
339 |
if ( is_user_logged_in() && $tag == 'wpmem_logout' ) {
|
340 |
+
$link = ( $atts['url'] ) ? add_query_arg( 'a', 'logout', $atts['url'] ) : add_query_arg( 'a', 'logout' );
|
341 |
$text = ( $content ) ? $content : __( 'Click here to log out.', 'wp-members' );
|
342 |
return do_shortcode( "<a href=\"$link\">$text</a>" );
|
343 |
}
|
517 |
return ( $do_query ) ? $atts['label'] . $user_meta_query : '';
|
518 |
}
|
519 |
|
520 |
+
|
521 |
+
/**
|
522 |
+
* Creates the user profile dashboard area (to replace page=user-profile shortcode).
|
523 |
+
*
|
524 |
+
* @since 3.1.0
|
525 |
+
*
|
526 |
+
* @return string $content
|
527 |
+
*/
|
528 |
+
function wpmem_sc_user_profile() {
|
529 |
+
$content = wpmem_do_sc_pages( 'user-profile' );
|
530 |
+
return $content;
|
531 |
+
}
|
532 |
+
|
533 |
// End of file.
|
inc/sidebar.php
CHANGED
@@ -27,17 +27,18 @@ if ( ! function_exists( 'wpmem_inc_status' ) ):
|
|
27 |
* @since 1.8
|
28 |
*
|
29 |
* @global $user_login
|
|
|
30 |
* @return string $status
|
31 |
*/
|
32 |
function wpmem_inc_status() {
|
33 |
|
34 |
-
global $user_login;
|
35 |
|
36 |
/** This filter is documented in wp-members/inc/dialogs.php */
|
37 |
$logout = apply_filters( 'wpmem_logout_link', $url . '/?a=logout' );
|
38 |
|
39 |
-
$status = '<p>' . sprintf(
|
40 |
-
. ' | <a href="' . $logout . '">' .
|
41 |
|
42 |
return $status;
|
43 |
}
|
@@ -52,35 +53,35 @@ if ( ! function_exists( 'wpmem_do_sidebar' ) ):
|
|
52 |
* a login form, or the user's login status. Typically used for a sidebar.
|
53 |
* You can call this directly, or with the widget.
|
54 |
*
|
55 |
-
* @since 2.4
|
|
|
|
|
56 |
*
|
57 |
-
* @param string $
|
58 |
* @global string $wpmem_regchk
|
59 |
* @global string $user_login
|
60 |
*/
|
61 |
-
function wpmem_do_sidebar( $
|
62 |
|
63 |
global $wpmem, $wpmem_regchk;
|
64 |
|
65 |
// Used here and in the logout.
|
66 |
$url = get_bloginfo('url');
|
67 |
|
68 |
-
if (
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
$post_to = $_SERVER['REQUEST_URI'];
|
83 |
-
}
|
84 |
}
|
85 |
|
86 |
// Clean whatever the url is.
|
@@ -103,8 +104,8 @@ function wpmem_do_sidebar( $post_to = null ) {
|
|
103 |
'buttons_after' => '</div>',
|
104 |
|
105 |
// Messages.
|
106 |
-
'error_msg' =>
|
107 |
-
'status_msg' =>
|
108 |
|
109 |
// Other.
|
110 |
'strip_breaks' => true,
|
@@ -127,13 +128,13 @@ function wpmem_do_sidebar( $post_to = null ) {
|
|
127 |
|
128 |
$form = '';
|
129 |
|
130 |
-
$label = '<label for="username">' .
|
131 |
$input = '<input type="text" name="log" class="username" id="username" />';
|
132 |
|
133 |
$input = ( $args['wrap_inputs'] ) ? $args['inputs_before'] . $input . $args['inputs_after'] : $input;
|
134 |
$row1 = $label . $args['n'] . $input . $args['n'];
|
135 |
|
136 |
-
$label = '<label for="password">' .
|
137 |
$input = '<input type="password" name="pwd" class="password" id="password" />';
|
138 |
|
139 |
$input = ( $args['wrap_inputs'] ) ? $args['inputs_before'] . $input . $args['inputs_after'] : $input;
|
@@ -142,7 +143,7 @@ function wpmem_do_sidebar( $post_to = null ) {
|
|
142 |
$form = $row1 . $row2;
|
143 |
|
144 |
$hidden = '<input type="hidden" name="rememberme" value="forever" />' . $args['n'] .
|
145 |
-
'<input type="hidden" name="redirect_to" value="' . $post_to . '" />' . $args['n'] .
|
146 |
'<input type="hidden" name="a" value="login" />' . $args['n'] .
|
147 |
'<input type="hidden" name="slog" value="true" />';
|
148 |
/**
|
@@ -154,12 +155,12 @@ function wpmem_do_sidebar( $post_to = null ) {
|
|
154 |
*/
|
155 |
$form = $form . apply_filters( 'wpmem_sb_hidden_fields', $hidden );
|
156 |
|
157 |
-
$buttons = '<input type="submit" name="Submit" class="buttons" value="' .
|
158 |
|
159 |
if ( $wpmem->user_pages['profile'] != null ) {
|
160 |
/** This filter is documented in wp-members/inc/forms.php */
|
161 |
-
$link = apply_filters( 'wpmem_forgot_link',
|
162 |
-
$link_html = ' <a href="' . $link . '">' .
|
163 |
/**
|
164 |
* Filter the sidebar forgot password.
|
165 |
*
|
@@ -175,7 +176,7 @@ function wpmem_do_sidebar( $post_to = null ) {
|
|
175 |
if ( $wpmem->user_pages['register'] != null ) {
|
176 |
/** This filter is documented in wp-members/inc/forms.php */
|
177 |
$link = apply_filters( 'wpmem_reg_link', $wpmem->user_pages['register'] );
|
178 |
-
$link_html = ' <a href="' . $link . '">' .
|
179 |
/**
|
180 |
* Filter the sidebar register link.
|
181 |
*
|
@@ -232,9 +233,30 @@ function wpmem_do_sidebar( $post_to = null ) {
|
|
232 |
|
233 |
/** This filter is documented in wp-members/inc/dialogs.php */
|
234 |
$logout = apply_filters( 'wpmem_logout_link', $url . '/?a=logout' );
|
235 |
-
|
236 |
-
|
237 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
238 |
|
239 |
/**
|
240 |
* Filter the sidebar user login status.
|
27 |
* @since 1.8
|
28 |
*
|
29 |
* @global $user_login
|
30 |
+
* @global object $wpmem
|
31 |
* @return string $status
|
32 |
*/
|
33 |
function wpmem_inc_status() {
|
34 |
|
35 |
+
global $user_login, $wpmem;
|
36 |
|
37 |
/** This filter is documented in wp-members/inc/dialogs.php */
|
38 |
$logout = apply_filters( 'wpmem_logout_link', $url . '/?a=logout' );
|
39 |
|
40 |
+
$status = '<p>' . sprintf( $wpmem->get_text( 'sb_login_status' ), $user_login )
|
41 |
+
. ' | <a href="' . $logout . '">' . $wpmem->get_text( 'sb_logout_link' ) . '</a></p>';
|
42 |
|
43 |
return $status;
|
44 |
}
|
53 |
* a login form, or the user's login status. Typically used for a sidebar.
|
54 |
* You can call this directly, or with the widget.
|
55 |
*
|
56 |
+
* @since 2.4.0
|
57 |
+
* @since 3.0.0 Added $post_to argument.
|
58 |
+
* @since 3.1.0 Changed $post_to to $redirect_to.
|
59 |
*
|
60 |
+
* @param string $redirect_to A URL to redirect to upon login, default null.
|
61 |
* @global string $wpmem_regchk
|
62 |
* @global string $user_login
|
63 |
*/
|
64 |
+
function wpmem_do_sidebar( $redirect_to = null ) {
|
65 |
|
66 |
global $wpmem, $wpmem_regchk;
|
67 |
|
68 |
// Used here and in the logout.
|
69 |
$url = get_bloginfo('url');
|
70 |
|
71 |
+
if ( isset( $_REQUEST['redirect_to'] ) ) {
|
72 |
+
$post_to = $_REQUEST['redirect_to'];
|
73 |
+
} elseif ( is_home() || is_front_page() ) {
|
74 |
+
$post_to = $_SERVER['REQUEST_URI'];
|
75 |
+
} elseif ( is_single() || is_page() ) {
|
76 |
+
$post_to = get_permalink();
|
77 |
+
} elseif ( is_category() ) {
|
78 |
+
global $wp_query;
|
79 |
+
$cat_id = get_query_var( 'cat' );
|
80 |
+
$post_to = get_category_link( $cat_id );
|
81 |
+
} elseif ( is_search() ) {
|
82 |
+
$post_to = add_query_arg( 's', get_search_query(), $url );
|
83 |
+
} else {
|
84 |
+
$post_to = $_SERVER['REQUEST_URI'];
|
|
|
|
|
85 |
}
|
86 |
|
87 |
// Clean whatever the url is.
|
104 |
'buttons_after' => '</div>',
|
105 |
|
106 |
// Messages.
|
107 |
+
'error_msg' => $wpmem->get_text( 'sb_login_failed' ),
|
108 |
+
'status_msg' => $wpmem->get_text( 'sb_not_logged_in' ) . '<br />',
|
109 |
|
110 |
// Other.
|
111 |
'strip_breaks' => true,
|
128 |
|
129 |
$form = '';
|
130 |
|
131 |
+
$label = '<label for="username">' . $wpmem->get_text( 'sb_login_username' ) . '</label>';
|
132 |
$input = '<input type="text" name="log" class="username" id="username" />';
|
133 |
|
134 |
$input = ( $args['wrap_inputs'] ) ? $args['inputs_before'] . $input . $args['inputs_after'] : $input;
|
135 |
$row1 = $label . $args['n'] . $input . $args['n'];
|
136 |
|
137 |
+
$label = '<label for="password">' . $wpmem->get_text( 'sb_login_password' ) . '</label>';
|
138 |
$input = '<input type="password" name="pwd" class="password" id="password" />';
|
139 |
|
140 |
$input = ( $args['wrap_inputs'] ) ? $args['inputs_before'] . $input . $args['inputs_after'] : $input;
|
143 |
$form = $row1 . $row2;
|
144 |
|
145 |
$hidden = '<input type="hidden" name="rememberme" value="forever" />' . $args['n'] .
|
146 |
+
'<input type="hidden" name="redirect_to" value="' . ( ( $redirect_to ) ? $redirect_to : $post_to ) . '" />' . $args['n'] .
|
147 |
'<input type="hidden" name="a" value="login" />' . $args['n'] .
|
148 |
'<input type="hidden" name="slog" value="true" />';
|
149 |
/**
|
155 |
*/
|
156 |
$form = $form . apply_filters( 'wpmem_sb_hidden_fields', $hidden );
|
157 |
|
158 |
+
$buttons = '<input type="submit" name="Submit" class="buttons" value="' . $wpmem->get_text( 'sb_login_button' ) . '" />';
|
159 |
|
160 |
if ( $wpmem->user_pages['profile'] != null ) {
|
161 |
/** This filter is documented in wp-members/inc/forms.php */
|
162 |
+
$link = apply_filters( 'wpmem_forgot_link', add_query_arg( 'a', 'pwdreset', $wpmem->user_pages['profile'] ) );
|
163 |
+
$link_html = ' <a href="' . $link . '">' . $wpmem->get_text( 'sb_login_forgot' ) . '</a> ';
|
164 |
/**
|
165 |
* Filter the sidebar forgot password.
|
166 |
*
|
176 |
if ( $wpmem->user_pages['register'] != null ) {
|
177 |
/** This filter is documented in wp-members/inc/forms.php */
|
178 |
$link = apply_filters( 'wpmem_reg_link', $wpmem->user_pages['register'] );
|
179 |
+
$link_html = ' <a href="' . $link . '">' . $wpmem->get_text( 'sb_login_register' ) . '</a>';
|
180 |
/**
|
181 |
* Filter the sidebar register link.
|
182 |
*
|
233 |
|
234 |
/** This filter is documented in wp-members/inc/dialogs.php */
|
235 |
$logout = apply_filters( 'wpmem_logout_link', $url . '/?a=logout' );
|
236 |
+
|
237 |
+
// Defaults.
|
238 |
+
$defaults = array(
|
239 |
+
'wrapper_before' => '<p>',
|
240 |
+
'status_text' => sprintf( $wpmem->get_text( 'sb_status' ), $user_login ) . '<br />',
|
241 |
+
'link_text' => $wpmem->get_text( 'sb_logout' ),
|
242 |
+
'wrapper_after' => '</p>',
|
243 |
+
);
|
244 |
+
|
245 |
+
/**
|
246 |
+
* Filter sidebar login status arguments.
|
247 |
+
*
|
248 |
+
* @since 3.1.0
|
249 |
+
*
|
250 |
+
* @param null
|
251 |
+
* @return array
|
252 |
+
*/
|
253 |
+
$args = apply_filters( 'wpmem_sidebar_status_args', '' );
|
254 |
+
|
255 |
+
// Merge $args with $defaults.
|
256 |
+
$args = wp_parse_args( $args, $defaults );
|
257 |
+
|
258 |
+
// Generate the message string.
|
259 |
+
$str = $args['wrapper_before'] . $args['status_text'] . "<a href=\"$logout\">" . $args['link_text'] . '</a>' . $args['wrapper_after'];
|
260 |
|
261 |
/**
|
262 |
* Filter the sidebar user login status.
|
inc/users.php
CHANGED
@@ -42,46 +42,99 @@ function wpmem_user_profile() {
|
|
42 |
// Get excluded meta.
|
43 |
$exclude = wpmem_get_excluded_meta( 'user-profile' );
|
44 |
|
|
|
45 |
foreach ( $wpmem_fields as $meta ) {
|
46 |
|
47 |
-
$
|
48 |
-
|
49 |
-
|
50 |
-
$chk_tos = true;
|
51 |
-
if ( $meta[2] == 'tos' && $val == 'agree' ) {
|
52 |
-
$chk_tos = false;
|
53 |
-
echo wpmem_create_formfield( $meta[2], 'hidden', $val );
|
54 |
-
}
|
55 |
-
|
56 |
// Do we exclude the row?
|
57 |
$chk_pass = ( in_array( $meta[2], $exclude ) ) ? false : true;
|
58 |
|
59 |
-
if ( $meta[4] == "y" && $meta[6] == "n" && $
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
// If there are any required fields.
|
61 |
$req = ( $meta[5] == 'y' ) ? ' <span class="description">' . __( '(required)' ) . '</span>' : '';
|
62 |
-
$
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
* @since 2.9.1
|
80 |
-
*
|
81 |
-
* @parma string $show_field The HTML string of the additional field.
|
82 |
-
*/
|
83 |
-
echo apply_filters( 'wpmem_user_profile_field', $show_field );
|
84 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
85 |
} ?>
|
86 |
</table><?php
|
87 |
}
|
@@ -106,7 +159,11 @@ function wpmem_profile_update() {
|
|
106 |
// If this is not an excluded meta field.
|
107 |
if ( ! in_array( $meta[2], $exclude ) ) {
|
108 |
// If the field is user editable.
|
109 |
-
if ( $meta[4] == "y"
|
|
|
|
|
|
|
|
|
110 |
|
111 |
// Check for required fields.
|
112 |
$chk = '';
|
@@ -118,7 +175,11 @@ function wpmem_profile_update() {
|
|
118 |
}
|
119 |
|
120 |
// Check for field value.
|
121 |
-
|
|
|
|
|
|
|
|
|
122 |
|
123 |
if ( $chk == 'ok' ) {
|
124 |
update_user_meta( $user_id, $meta[2], $field_val );
|
42 |
// Get excluded meta.
|
43 |
$exclude = wpmem_get_excluded_meta( 'user-profile' );
|
44 |
|
45 |
+
$rows = array();
|
46 |
foreach ( $wpmem_fields as $meta ) {
|
47 |
|
48 |
+
$valtochk = ''; $values = '';
|
49 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
// Do we exclude the row?
|
51 |
$chk_pass = ( in_array( $meta[2], $exclude ) ) ? false : true;
|
52 |
|
53 |
+
if ( $meta[4] == "y" && $meta[6] == "n" && $chk_pass ) {
|
54 |
+
|
55 |
+
$val = get_user_meta( $user_id, $meta[2], true );
|
56 |
+
|
57 |
+
if ( $meta[3] == 'checkbox' ) {
|
58 |
+
$valtochk = $val;
|
59 |
+
$val = $meta[7];
|
60 |
+
}
|
61 |
+
|
62 |
+
if ( 'multicheckbox' == $meta[3] || 'select' == $meta[3] || 'multiselect' == $meta[3] || 'radio' == $meta[3] ) {
|
63 |
+
$values = $meta[7];
|
64 |
+
$valtochk = $val;
|
65 |
+
}
|
66 |
+
|
67 |
+
// Is this an image or a file?
|
68 |
+
if ( 'file' == $meta[3] || 'image' == $meta[3] ) {
|
69 |
+
$attachment_url = wp_get_attachment_url( $val );
|
70 |
+
$empty_file = '<span class="description">' . __( 'None' ) . '</span>';
|
71 |
+
if ( 'file' == $meta[3] ) {
|
72 |
+
$input = ( 0 < $attachment_url ) ? '<a href="' . $attachment_url . '">' . $attachment_url . '</a>' : $empty_file;
|
73 |
+
} else {
|
74 |
+
$input = ( 0 < $attachment_url ) ? '<img src="' . $attachment_url . '">' : $empty_file;
|
75 |
+
}
|
76 |
+
// @todo - come up with a way to handle file updates - user profile form does not support multitype
|
77 |
+
//$show_field.= '<br /><span class="description">' . __( 'Update this file:' ) . '</span><br />';
|
78 |
+
//$show_field.= wpmem_create_formfield( $meta[2] . '_update_file', $meta[3], $val, $valtochk );
|
79 |
+
} else {
|
80 |
+
if ( $meta[2] == 'tos' && $val == 'agree' ) {
|
81 |
+
$input = wpmem_create_formfield( $meta[2], 'hidden', $val );
|
82 |
+
} elseif ( 'multicheckbox' == $meta[3] || 'select' == $meta[3] || 'multiselect' == $meta[3] || 'radio' == $meta[3] ) {
|
83 |
+
$input = wpmem_create_formfield( $meta[2], $meta[3], $values, $valtochk );
|
84 |
+
} else {
|
85 |
+
$input = wpmem_create_formfield( $meta[2], $meta[3], $val, $valtochk );
|
86 |
+
}
|
87 |
+
}
|
88 |
+
|
89 |
// If there are any required fields.
|
90 |
$req = ( $meta[5] == 'y' ) ? ' <span class="description">' . __( '(required)' ) . '</span>' : '';
|
91 |
+
$label = '<label>' . __( $meta[1], 'wp-members' ) . $req . '</label>';
|
92 |
+
|
93 |
+
// Build the form rows for filtering.
|
94 |
+
$rows[ $meta[2] ] = array(
|
95 |
+
'order' => $meta[0],
|
96 |
+
'meta' => $meta[2],
|
97 |
+
'type' => $meta[3],
|
98 |
+
'value' => $val,
|
99 |
+
'values' => $values,
|
100 |
+
'label_text' => __( $meta[1], 'wp-members' ),
|
101 |
+
'row_before' => '',
|
102 |
+
'label' => $label,
|
103 |
+
'field_before' => '',
|
104 |
+
'field' => $input,
|
105 |
+
'field_after' => '',
|
106 |
+
'row_after' => '',
|
107 |
+
);
|
|
|
|
|
|
|
|
|
|
|
108 |
}
|
109 |
+
}
|
110 |
+
|
111 |
+
/**
|
112 |
+
* Filter for rows
|
113 |
+
*
|
114 |
+
* @since 3.1.0
|
115 |
+
*
|
116 |
+
* @param array $rows
|
117 |
+
* @param string $toggle
|
118 |
+
*/
|
119 |
+
$rows = apply_filters( 'wpmem_register_form_rows_profile', $rows, 'userprofile' );
|
120 |
+
|
121 |
+
foreach ( $rows as $row ) {
|
122 |
+
|
123 |
+
$show_field = '
|
124 |
+
<tr>
|
125 |
+
<th>' . $row['label'] . '</th>
|
126 |
+
<td>' . $row['field'] . '</td>
|
127 |
+
</tr>';
|
128 |
+
|
129 |
+
/**
|
130 |
+
* Filter the field for user profile additional fields.
|
131 |
+
*
|
132 |
+
* @since 2.9.1
|
133 |
+
*
|
134 |
+
* @parma string $show_field The HTML string of the additional field.
|
135 |
+
*/
|
136 |
+
echo apply_filters( 'wpmem_user_profile_field', $show_field );
|
137 |
+
|
138 |
} ?>
|
139 |
</table><?php
|
140 |
}
|
159 |
// If this is not an excluded meta field.
|
160 |
if ( ! in_array( $meta[2], $exclude ) ) {
|
161 |
// If the field is user editable.
|
162 |
+
if ( $meta[4] == "y"
|
163 |
+
&& $meta[6] == "n"
|
164 |
+
&& $meta[3] != 'password'
|
165 |
+
&& $meta[3] != 'file'
|
166 |
+
&& $meta[3] != 'image' ) {
|
167 |
|
168 |
// Check for required fields.
|
169 |
$chk = '';
|
175 |
}
|
176 |
|
177 |
// Check for field value.
|
178 |
+
if ( $meta[3] == 'multiselect' || $meta[3] == 'multicheckbox' ) {
|
179 |
+
$field_val = ( isset( $_POST[ $meta[2] ] ) ) ? implode( '|', $_POST[ $meta[2] ] ) : '';
|
180 |
+
} else {
|
181 |
+
$field_val = ( isset( $_POST[$meta[2]] ) ) ? $_POST[$meta[2]] : '';
|
182 |
+
}
|
183 |
|
184 |
if ( $chk == 'ok' ) {
|
185 |
update_user_meta( $user_id, $meta[2], $field_val );
|
inc/utilities.php
CHANGED
@@ -37,7 +37,9 @@ if ( ! function_exists( 'wpmem_create_formfield' ) ):
|
|
37 |
* Creates various form fields and returns them as a string.
|
38 |
*
|
39 |
* @since 1.8.0
|
|
|
40 |
*
|
|
|
41 |
* @param string $name The name of the field.
|
42 |
* @param string $type The field type.
|
43 |
* @param string $value The default value for the field.
|
@@ -46,55 +48,15 @@ if ( ! function_exists( 'wpmem_create_formfield' ) ):
|
|
46 |
* @return string $str The field returned as a string.
|
47 |
*/
|
48 |
function wpmem_create_formfield( $name, $type, $value, $valtochk=null, $class='textbox' ) {
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
$class = ( $class == 'textbox' ) ? "checkbox" : $class;
|
59 |
-
$str = "<input name=\"$name\" type=\"$type\" id=\"$name\" value=\"$value\"" . wpmem_selected( $value, $valtochk, $type ) . " />";
|
60 |
-
break;
|
61 |
-
|
62 |
-
case "text":
|
63 |
-
$value = stripslashes( esc_attr( $value ) );
|
64 |
-
$str = "<input name=\"$name\" type=\"$type\" id=\"$name\" value=\"$value\" class=\"$class\" />";
|
65 |
-
break;
|
66 |
-
|
67 |
-
case "textarea":
|
68 |
-
$value = stripslashes( esc_textarea( $value ) );
|
69 |
-
$class = ( $class == 'textbox' ) ? "textarea" : $class;
|
70 |
-
$str = "<textarea cols=\"20\" rows=\"5\" name=\"$name\" id=\"$name\" class=\"$class\">$value</textarea>";
|
71 |
-
break;
|
72 |
-
|
73 |
-
case "password":
|
74 |
-
$str = "<input name=\"$name\" type=\"$type\" id=\"$name\" class=\"$class\" />";
|
75 |
-
break;
|
76 |
-
|
77 |
-
case "hidden":
|
78 |
-
$str = "<input name=\"$name\" type=\"$type\" value=\"$value\" />";
|
79 |
-
break;
|
80 |
-
|
81 |
-
case "option":
|
82 |
-
$str = "<option value=\"$value\" " . wpmem_selected( $value, $valtochk, 'select' ) . " >$name</option>";
|
83 |
-
break;
|
84 |
-
|
85 |
-
case "select":
|
86 |
-
$class = ( $class == 'textbox' ) ? "dropdown" : $class;
|
87 |
-
$str = "<select name=\"$name\" id=\"$name\" class=\"$class\">\n";
|
88 |
-
foreach ( $value as $option ) {
|
89 |
-
$pieces = explode( '|', $option );
|
90 |
-
$str = $str . "<option value=\"$pieces[1]\"" . wpmem_selected( $pieces[1], $valtochk, 'select' ) . ">" . __( $pieces[0], 'wp-members' ) . "</option>\n";
|
91 |
-
}
|
92 |
-
$str = $str . "</select>";
|
93 |
-
break;
|
94 |
-
|
95 |
-
}
|
96 |
-
|
97 |
-
return $str;
|
98 |
}
|
99 |
endif;
|
100 |
|
@@ -104,6 +66,7 @@ if ( ! function_exists( 'wpmem_selected' ) ):
|
|
104 |
* Determines if a form field is selected (i.e. lists & checkboxes).
|
105 |
*
|
106 |
* @since 0.1.0
|
|
|
107 |
*
|
108 |
* @param string $value
|
109 |
* @param string $valtochk
|
@@ -168,7 +131,7 @@ if ( ! function_exists( 'wpmem_texturize' ) ):
|
|
168 |
* @return string $new_content
|
169 |
*/
|
170 |
function wpmem_texturize( $content ) {
|
171 |
-
|
172 |
$new_content = '';
|
173 |
$pattern_full = '{(\[wpmem_txt\].*?\[/wpmem_txt\])}is';
|
174 |
$pattern_contents = '{\[wpmem_txt\](.*?)\[/wpmem_txt\]}is';
|
@@ -415,7 +378,6 @@ endif;
|
|
415 |
* @return array Array of fields to be excluded from the registration form.
|
416 |
*/
|
417 |
function wpmem_get_excluded_meta( $tag ) {
|
418 |
-
|
419 |
global $wpmem;
|
420 |
return $wpmem->excluded_fields( $tag );
|
421 |
}
|
@@ -441,7 +403,7 @@ function wpmem_use_ssl() {
|
|
441 |
* @return array An array of WordPress reserved terms.
|
442 |
*/
|
443 |
function wpmem_wp_reserved_terms() {
|
444 |
-
$reserved_terms = array( 'attachment', 'attachment_id', 'author', 'author_name', 'calendar', 'cat', 'category', 'category__and', 'category__in', 'category__not_in', 'category_name', 'comments_per_page', 'comments_popup', 'customize_messenger_channel', 'customized', 'cpage', 'day', 'debug', 'error', 'exact', 'feed', 'fields', 'hour', 'link_category', 'm', 'minute', 'monthnum', 'more', 'name', 'nav_menu', 'nonce', 'nopaging', 'offset', 'order', 'orderby', 'p', 'page', 'page_id', 'paged', 'pagename', 'pb', 'perm', 'post', 'post__in', 'post__not_in', 'post_format', 'post_mime_type', 'post_status', 'post_tag', 'post_type', 'posts', 'posts_per_archive_page', 'posts_per_page', 'preview', 'robots', 's', 'search', 'second', 'sentence', 'showposts', 'static', 'subpost', 'subpost_id', 'tag', 'tag__and', 'tag__in', 'tag__not_in', 'tag_id', 'tag_slug__and', 'tag_slug__in', 'taxonomy', 'tb', 'term', 'theme', 'type', 'w', 'withcomments', 'withoutcomments', 'year' );
|
445 |
|
446 |
/**
|
447 |
* Filter the array of reserved terms.
|
37 |
* Creates various form fields and returns them as a string.
|
38 |
*
|
39 |
* @since 1.8.0
|
40 |
+
* @since 3.1.0 Converted to wrapper for create_form_field() in utlities object.
|
41 |
*
|
42 |
+
* @global object $wpmem The WP_Members object class.
|
43 |
* @param string $name The name of the field.
|
44 |
* @param string $type The field type.
|
45 |
* @param string $value The default value for the field.
|
48 |
* @return string $str The field returned as a string.
|
49 |
*/
|
50 |
function wpmem_create_formfield( $name, $type, $value, $valtochk=null, $class='textbox' ) {
|
51 |
+
global $wpmem;
|
52 |
+
$args = array(
|
53 |
+
'name' => $name,
|
54 |
+
'type' => $type,
|
55 |
+
'value' => $value,
|
56 |
+
'valtochk' => $valtochk,
|
57 |
+
'class' => $class,
|
58 |
+
);
|
59 |
+
return $wpmem->forms->create_form_field( $args );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
}
|
61 |
endif;
|
62 |
|
66 |
* Determines if a form field is selected (i.e. lists & checkboxes).
|
67 |
*
|
68 |
* @since 0.1.0
|
69 |
+
* @deprecated 3.1.0 Use selected() or checked() instead.
|
70 |
*
|
71 |
* @param string $value
|
72 |
* @param string $valtochk
|
131 |
* @return string $new_content
|
132 |
*/
|
133 |
function wpmem_texturize( $content ) {
|
134 |
+
|
135 |
$new_content = '';
|
136 |
$pattern_full = '{(\[wpmem_txt\].*?\[/wpmem_txt\])}is';
|
137 |
$pattern_contents = '{\[wpmem_txt\](.*?)\[/wpmem_txt\]}is';
|
378 |
* @return array Array of fields to be excluded from the registration form.
|
379 |
*/
|
380 |
function wpmem_get_excluded_meta( $tag ) {
|
|
|
381 |
global $wpmem;
|
382 |
return $wpmem->excluded_fields( $tag );
|
383 |
}
|
403 |
* @return array An array of WordPress reserved terms.
|
404 |
*/
|
405 |
function wpmem_wp_reserved_terms() {
|
406 |
+
$reserved_terms = array( 'attachment', 'attachment_id', 'author', 'author_name', 'calendar', 'cat', 'category', 'category__and', 'category__in', 'category__not_in', 'category_name', 'comments_per_page', 'comments_popup', 'customize_messenger_channel', 'customized', 'cpage', 'day', 'debug', 'error', 'exact', 'feed', 'fields', 'hour', 'link_category', 'm', 'minute', 'monthnum', 'more', 'name', 'nav_menu', 'nonce', 'nopaging', 'offset', 'order', 'orderby', 'p', 'page', 'page_id', 'paged', 'pagename', 'pb', 'perm', 'post', 'post__in', 'post__not_in', 'post_format', 'post_mime_type', 'post_status', 'post_tag', 'post_type', 'posts', 'posts_per_archive_page', 'posts_per_page', 'preview', 'robots', 'role', 's', 'search', 'second', 'sentence', 'showposts', 'static', 'subpost', 'subpost_id', 'tag', 'tag__and', 'tag__in', 'tag__not_in', 'tag_id', 'tag_slug__and', 'tag_slug__in', 'taxonomy', 'tb', 'term', 'theme', 'type', 'w', 'withcomments', 'withoutcomments', 'year' );
|
407 |
|
408 |
/**
|
409 |
* Filter the array of reserved terms.
|
inc/wp-registration.php
CHANGED
@@ -55,7 +55,7 @@ function wpmem_do_wp_register_form() {
|
|
55 |
$tos_pop = "<a href=\"#\" onClick=\"window.open('" . WP_PLUGIN_URL . "/wp-members/wp-members-tos.php','mywindow');\">";
|
56 |
}
|
57 |
/** This filter is documented in wp-members/inc/register.php */
|
58 |
-
$tos = apply_filters( 'wpmem_tos_link_txt', sprintf(
|
59 |
|
60 |
}
|
61 |
|
55 |
$tos_pop = "<a href=\"#\" onClick=\"window.open('" . WP_PLUGIN_URL . "/wp-members/wp-members-tos.php','mywindow');\">";
|
56 |
}
|
57 |
/** This filter is documented in wp-members/inc/register.php */
|
58 |
+
$tos = apply_filters( 'wpmem_tos_link_txt', sprintf( $wpmem->get_text( 'register_tos' ), $tos_pop, '</a>' ) );
|
59 |
|
60 |
}
|
61 |
|
readme.txt
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
Contributors: cbutlerjr
|
3 |
Tags: access, authentication, content, login, member, membership, password, protect, register, registration, restriction, subscriber
|
4 |
Requires at least: 3.1
|
5 |
-
Tested up to: 4.
|
6 |
-
Stable tag: 3.0.
|
7 |
License: GPLv2
|
8 |
|
9 |
WP-Members™ is a free membership management framework for WordPress® that restricts content to registered users.
|
@@ -111,8 +111,8 @@ Premium priority support is available at the plugin's site [RocketGeek.com](http
|
|
111 |
|
112 |
== Upgrade Notice ==
|
113 |
|
114 |
-
WP-Members 3.0.
|
115 |
-
WP-Members 3.
|
116 |
|
117 |
== Screenshots ==
|
118 |
|
@@ -135,14 +135,56 @@ WP-Members 3.0.0 is a major version release. Please review the changelog: http:/
|
|
135 |
|
136 |
== Changelog ==
|
137 |
|
138 |
-
= 3.0.
|
139 |
-
|
140 |
-
* Fixes
|
141 |
-
*
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
146 |
|
147 |
= 3.0.9 =
|
148 |
|
@@ -156,6 +198,7 @@ WP-Members 3.0.0 is a major version release. Please review the changelog: http:/
|
|
156 |
* Added new auto excerpt features including new wpmem_auto_excerpt_args filter.
|
157 |
* Added forgot username retrieveal link (included on forgot password reset form).
|
158 |
* Added wpmem_username_link and wpmem_username_link_str for filtering forgot username retrieval link.
|
|
|
159 |
* Fixed handling of post bulk actions to keep current screen (if one is used).
|
160 |
* Fixed handling of updates to the user pages in the options tab.
|
161 |
* Fixed handling of empty post object in is_blocked() function.
|
2 |
Contributors: cbutlerjr
|
3 |
Tags: access, authentication, content, login, member, membership, password, protect, register, registration, restriction, subscriber
|
4 |
Requires at least: 3.1
|
5 |
+
Tested up to: 4.5.2
|
6 |
+
Stable tag: 3.1.0.3
|
7 |
License: GPLv2
|
8 |
|
9 |
WP-Members™ is a free membership management framework for WordPress® that restricts content to registered users.
|
111 |
|
112 |
== Upgrade Notice ==
|
113 |
|
114 |
+
WP-Members 3.1.0.3 fixes a redeclared function (wpmem_update_captcha()) from 3.1.0.
|
115 |
+
WP-Members 3.1.0 is a major verion release, please review the changelog.
|
116 |
|
117 |
== Screenshots ==
|
118 |
|
135 |
|
136 |
== Changelog ==
|
137 |
|
138 |
+
= 3.1.0.3 =
|
139 |
+
|
140 |
+
* Fixes redeclared wpmem_update_captcha function from 3.1.0.
|
141 |
+
* Changed all _update_ functions in install package to _upgrade_.
|
142 |
+
* Fixes an issue with PayPal extension where users may be set to pending if moderated registration is enabled after the user already has an expiration date.
|
143 |
+
* Update wpmem_do_sidebar to use use add_query_arg() if on a search query.
|
144 |
+
* Adds handling of username retrieval to password shortcode if shortcode is set as user profile page setting.
|
145 |
+
|
146 |
+
= 3.1.0.2 =
|
147 |
+
|
148 |
+
* Fixes redeclared wpmem_update_dialogs() function from 3.1.0.
|
149 |
+
|
150 |
+
= 3.1.0.1 =
|
151 |
+
|
152 |
+
* Fixes missing about tab file from 3.1.0.
|
153 |
+
|
154 |
+
= 3.1.0 =
|
155 |
+
|
156 |
+
This package contains several fixes, some new filters, new field types and other functional improvements.
|
157 |
+
|
158 |
+
* Some general code cleanup, reviewing inline documentation and comments.
|
159 |
+
* Fixed issue for sidebar with redirect_to parameter set in widget settings.
|
160 |
+
* Fixed issue for custom error messages and email comparison error for profile update (so that errors show in form update state and not on links page).
|
161 |
+
* Fixed main options tab where checkbox may not display correct setting if unchecked.
|
162 |
+
* Fixed translation issue for required field error where all of the message except the field name was translated.
|
163 |
+
* Fixed issue for register shortcode page where if a user has registered, and is logging in but the login fails, display the login error message.
|
164 |
+
* Fixed register shortcode redirect parameter.
|
165 |
+
* Fixed confirm_password to bypass sanitize_text_field (which breaks password comparison if certain characters are used).
|
166 |
+
* Added logic so that user_pages are not blocked (login, register, user_profile).
|
167 |
+
* Added after_wrapper array value for wpmem_{$page}_links_args filters
|
168 |
+
* Added a new admin api class, utilities object class, and forms object class.
|
169 |
+
* Added user facing strings as an array in the main $wpmem object class.
|
170 |
+
* Added wpmem_default_text_strings filter for user facing text strings.
|
171 |
+
* Added new wpmem_sidebar_status_args filter hook.
|
172 |
+
* Added new container in main object for email from and from name settings.
|
173 |
+
* Added file upload functions.
|
174 |
+
* Added new field types: multiple checkbox, multiple select, radio, file, image, email, url.
|
175 |
+
* Added "values" key to the register form rows array to hold possible values (i.e. select, multiple select, multiple checkbox, and radio group) and the actual value to be in the "value" key.
|
176 |
+
* Added the ability for dropdown/select fields to have a default value other than the first value.
|
177 |
+
* Added filter wpmem_user_upload_dir for filtering the location of user uploaded files.
|
178 |
+
* Added wpmem_register_form_rows_admin and wpmem_register_form_rows_profile filter hooks.
|
179 |
+
* Deprecated use of wpmem_chk_qstr() function, use add_query_arg() instead.
|
180 |
+
* Deprecated use of get_currentuserinfo() (deprecated in WP 4.5), use wp_get_current_user() instead.
|
181 |
+
* Email function updates, added 'footer' as an array value in the main wpmem_email_filter filter.
|
182 |
+
* Changed install to set email/confirm_email and user_url as HTML5 field types "email" and "url" (now supported).
|
183 |
+
* Changed get_action call from init action to template_redirect action.
|
184 |
+
* Changed username in register form from log to user_login to match wp native registration form.
|
185 |
+
* Changed [wp-members page="user-profile"] shortcode to [wpmem_profile] (old shortcode will still work).
|
186 |
+
* Removed redirect parameter from register shortcode in shortcode menu.
|
187 |
+
* Removed kubrick stylesheet from selector (still packaged with download, shows as custom url if used).
|
188 |
|
189 |
= 3.0.9 =
|
190 |
|
198 |
* Added new auto excerpt features including new wpmem_auto_excerpt_args filter.
|
199 |
* Added forgot username retrieveal link (included on forgot password reset form).
|
200 |
* Added wpmem_username_link and wpmem_username_link_str for filtering forgot username retrieval link.
|
201 |
+
* Added new upgrade process to WP_Members object class.
|
202 |
* Fixed handling of post bulk actions to keep current screen (if one is used).
|
203 |
* Fixed handling of updates to the user pages in the options tab.
|
204 |
* Fixed handling of empty post object in is_blocked() function.
|
wp-members-install.php
CHANGED
@@ -17,7 +17,7 @@
|
|
17 |
* - wpmem_do_install
|
18 |
* - wpmem_update_settings
|
19 |
* - wpmem_append_email
|
20 |
-
* -
|
21 |
* - wpmem_update_captcha
|
22 |
*/
|
23 |
|
@@ -81,6 +81,8 @@ function wpmem_do_install() {
|
|
81 |
'style' => plugin_dir_url ( __FILE__ ) . 'css/generic-no-float.css',
|
82 |
'attrib' => 0,
|
83 |
'post_types' => array(),
|
|
|
|
|
84 |
);
|
85 |
|
86 |
// Using update_option to allow for forced update.
|
@@ -111,9 +113,9 @@ function wpmem_do_install() {
|
|
111 |
array( 7, 'Zip', 'zip', 'text', 'y', 'y', 'n' ),
|
112 |
array( 8, 'Country', 'country', 'text', 'y', 'y', 'n' ),
|
113 |
array( 9, 'Day Phone', 'phone1', 'text', 'y', 'y', 'n' ),
|
114 |
-
array( 10, 'Email', 'user_email', '
|
115 |
-
array( 11, 'Confirm Email', 'confirm_email', '
|
116 |
-
array( 12, 'Website', 'user_url', '
|
117 |
array( 13, 'Biographical Info', 'description', 'textarea', 'n', 'n', 'y' ),
|
118 |
array( 14, 'Password', 'password', 'password', 'n', 'n', 'n' ),
|
119 |
array( 15, 'Confirm Password', 'confirm_password', 'password', 'n', 'n', 'n' ),
|
@@ -145,9 +147,9 @@ function wpmem_do_install() {
|
|
145 |
|
146 |
} else {
|
147 |
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
wpmem_append_email();
|
152 |
|
153 |
}
|
@@ -157,11 +159,12 @@ function wpmem_do_install() {
|
|
157 |
/**
|
158 |
* Updates the existing settings if doing an update.
|
159 |
*
|
160 |
-
* @since 3.0
|
|
|
161 |
*
|
162 |
* @return array $wpmem_newsettings
|
163 |
*/
|
164 |
-
function
|
165 |
|
166 |
$wpmem_settings = get_option( 'wpmembers_settings' );
|
167 |
|
@@ -192,6 +195,21 @@ function wpmem_update_settings() {
|
|
192 |
$wpmem_settings['post_types'] = array();
|
193 |
}
|
194 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
195 |
// Version number should be updated no matter what.
|
196 |
$wpmem_settings['version'] = WPMEM_VERSION;
|
197 |
|
@@ -242,29 +260,25 @@ function wpmem_update_settings() {
|
|
242 |
$wpmem_newsettings['autoex']['post'] = array( 'enabled' => 1, 'length' => $autoex['auto_ex_len'] );
|
243 |
$wpmem_newsettings['autoex']['page'] = array( 'enabled' => 1, 'length' => $autoex['auto_ex_len'] );
|
244 |
} else {
|
245 |
-
// If it is not turned on
|
246 |
$wpmem_newsettings['autoex']['post'] = array( 'enabled' => 0, 'length' => '' );
|
247 |
$wpmem_newsettings['autoex']['page'] = array( 'enabled' => 0, 'length' => '' );
|
248 |
}
|
249 |
|
250 |
-
// Add
|
251 |
$wpmem_newsettings['post_types'] = array();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
252 |
|
253 |
// Merge settings.
|
254 |
$wpmem_newsettings = array_merge( $wpmem_settings, $wpmem_newsettings );
|
255 |
|
256 |
update_option( 'wpmembers_settings', $wpmem_newsettings );
|
257 |
-
|
258 |
-
// Final 3.0 will remove the following settings when updating.
|
259 |
-
/*
|
260 |
-
delete_option( 'wpmembers_msurl' );
|
261 |
-
delete_option( 'wpmembers_regurl' );
|
262 |
-
delete_option( 'wpmembers_logurl' );
|
263 |
-
delete_option( 'wpmembers_cssurl' );
|
264 |
-
delete_option( 'wpmembers_style' );
|
265 |
-
delete_option( 'wpmembers_autoex' );
|
266 |
-
delete_option( 'wpmembers_attrib' );
|
267 |
-
*/
|
268 |
|
269 |
return $wpmem_newsettings;
|
270 |
}
|
@@ -435,11 +449,11 @@ username: [username]
|
|
435 |
/**
|
436 |
* Checks the dialogs array for string changes.
|
437 |
*
|
438 |
-
* Was update_dialogs() since 2.9.3, changed to wpmem_update_dialogs() in 3.0.
|
439 |
-
*
|
440 |
* @since 2.9.3
|
|
|
|
|
441 |
*/
|
442 |
-
function
|
443 |
|
444 |
$wpmem_dialogs_arr = get_option( 'wpmembers_dialogs' );
|
445 |
$do_update = false;
|
@@ -468,8 +482,10 @@ function wpmem_update_dialogs() {
|
|
468 |
* Was update_captcha() since 2.9.5, changed to wpmem_update_captcha() in 3.0.
|
469 |
*
|
470 |
* @since 2.9.5
|
|
|
|
|
471 |
*/
|
472 |
-
function
|
473 |
|
474 |
$captcha_settings = get_option( 'wpmembers_captcha' );
|
475 |
|
17 |
* - wpmem_do_install
|
18 |
* - wpmem_update_settings
|
19 |
* - wpmem_append_email
|
20 |
+
* - wpmem_default_dialogs
|
21 |
* - wpmem_update_captcha
|
22 |
*/
|
23 |
|
81 |
'style' => plugin_dir_url ( __FILE__ ) . 'css/generic-no-float.css',
|
82 |
'attrib' => 0,
|
83 |
'post_types' => array(),
|
84 |
+
'form_tags' => array( 'default' => 'Registration Default' ),
|
85 |
+
'email' => array( 'from' => '', 'from_name' => '' ),
|
86 |
);
|
87 |
|
88 |
// Using update_option to allow for forced update.
|
113 |
array( 7, 'Zip', 'zip', 'text', 'y', 'y', 'n' ),
|
114 |
array( 8, 'Country', 'country', 'text', 'y', 'y', 'n' ),
|
115 |
array( 9, 'Day Phone', 'phone1', 'text', 'y', 'y', 'n' ),
|
116 |
+
array( 10, 'Email', 'user_email', 'email', 'y', 'y', 'y' ),
|
117 |
+
array( 11, 'Confirm Email', 'confirm_email', 'email', 'n', 'n', 'n' ),
|
118 |
+
array( 12, 'Website', 'user_url', 'url', 'n', 'n', 'y' ),
|
119 |
array( 13, 'Biographical Info', 'description', 'textarea', 'n', 'n', 'y' ),
|
120 |
array( 14, 'Password', 'password', 'password', 'n', 'n', 'n' ),
|
121 |
array( 15, 'Confirm Password', 'confirm_password', 'password', 'n', 'n', 'n' ),
|
147 |
|
148 |
} else {
|
149 |
|
150 |
+
wpmem_upgrade_settings();
|
151 |
+
wpmem_upgrade_captcha();
|
152 |
+
wpmem_upgrade_dialogs();
|
153 |
wpmem_append_email();
|
154 |
|
155 |
}
|
159 |
/**
|
160 |
* Updates the existing settings if doing an update.
|
161 |
*
|
162 |
+
* @since 3.0.0
|
163 |
+
* @since 3.1.0 Changed from wpmem_update_settings() to wpmem_upgrade_settings().
|
164 |
*
|
165 |
* @return array $wpmem_newsettings
|
166 |
*/
|
167 |
+
function wpmem_upgrade_settings() {
|
168 |
|
169 |
$wpmem_settings = get_option( 'wpmembers_settings' );
|
170 |
|
195 |
$wpmem_settings['post_types'] = array();
|
196 |
}
|
197 |
|
198 |
+
// If form tags is not set, add default.
|
199 |
+
if ( ! isset( $wpmem_settings['form_tags'] ) ) {
|
200 |
+
$wpmem_settings['form_tags'] = array( 'default' => 'Registration Default' );
|
201 |
+
}
|
202 |
+
|
203 |
+
// If email is not set, add it with existing setting or default.
|
204 |
+
if ( ! isset( $wpmem_settings['email'] ) ) {
|
205 |
+
$from = get_option( 'wpmembers_email_wpfrom' );
|
206 |
+
$name = get_option( 'wpmembers_email_wpname' );
|
207 |
+
$wpmem_settings['email'] = array(
|
208 |
+
'from' => ( $from ) ? $from : '',
|
209 |
+
'from_name' => ( $name ) ? $name : '',
|
210 |
+
);
|
211 |
+
}
|
212 |
+
|
213 |
// Version number should be updated no matter what.
|
214 |
$wpmem_settings['version'] = WPMEM_VERSION;
|
215 |
|
260 |
$wpmem_newsettings['autoex']['post'] = array( 'enabled' => 1, 'length' => $autoex['auto_ex_len'] );
|
261 |
$wpmem_newsettings['autoex']['page'] = array( 'enabled' => 1, 'length' => $autoex['auto_ex_len'] );
|
262 |
} else {
|
263 |
+
// If it is not turned on, set it to off in new setting.
|
264 |
$wpmem_newsettings['autoex']['post'] = array( 'enabled' => 0, 'length' => '' );
|
265 |
$wpmem_newsettings['autoex']['page'] = array( 'enabled' => 0, 'length' => '' );
|
266 |
}
|
267 |
|
268 |
+
// Add new settings.
|
269 |
$wpmem_newsettings['post_types'] = array();
|
270 |
+
$wpmem_settings['form_tags'] = array( 'default' => 'Registration Default' );
|
271 |
+
$from = get_option( 'wpmembers_email_wpfrom' );
|
272 |
+
$name = get_option( 'wpmembers_email_wpname' );
|
273 |
+
$wpmem_settings['email'] = array(
|
274 |
+
'from' => ( $from ) ? $from : '',
|
275 |
+
'from_name' => ( $name ) ? $name : '',
|
276 |
+
);
|
277 |
|
278 |
// Merge settings.
|
279 |
$wpmem_newsettings = array_merge( $wpmem_settings, $wpmem_newsettings );
|
280 |
|
281 |
update_option( 'wpmembers_settings', $wpmem_newsettings );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
282 |
|
283 |
return $wpmem_newsettings;
|
284 |
}
|
449 |
/**
|
450 |
* Checks the dialogs array for string changes.
|
451 |
*
|
|
|
|
|
452 |
* @since 2.9.3
|
453 |
+
* @since 3.0.0 Changed from update_dialogs() to wpmem_update_dialogs().
|
454 |
+
* @since 3.1.0 Changed from wpmem_update_dialogs() to wpmem_upgrade_dialogs().
|
455 |
*/
|
456 |
+
function wpmem_upgrade_dialogs() {
|
457 |
|
458 |
$wpmem_dialogs_arr = get_option( 'wpmembers_dialogs' );
|
459 |
$do_update = false;
|
482 |
* Was update_captcha() since 2.9.5, changed to wpmem_update_captcha() in 3.0.
|
483 |
*
|
484 |
* @since 2.9.5
|
485 |
+
* @since 3.0.0 Changed from update_captcha() to wpmem_update_captcha().
|
486 |
+
* @since 3.1.0 Changed from wpmem_update_captcha() to wpmem_upgrade_captcha().
|
487 |
*/
|
488 |
+
function wpmem_upgrade_captcha() {
|
489 |
|
490 |
$captcha_settings = get_option( 'wpmembers_captcha' );
|
491 |
|
wp-members.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: WP-Members
|
4 |
Plugin URI: http://rocketgeek.com
|
5 |
Description: WP access restriction and user registration. For more information on plugin features, refer to <a href="http://rocketgeek.com/plugins/wp-members/users-guide/">the online Users Guide</a>. A <a href="http://rocketgeek.com/plugins/wp-members/quick-start-guide/">Quick Start Guide</a> is also available. WP-Members(tm) is a trademark of butlerblog.com.
|
6 |
-
Version: 3.0.
|
7 |
Author: Chad Butler
|
8 |
Author URI: http://butlerblog.com/
|
9 |
Text Domain: wp-members
|
@@ -62,7 +62,7 @@ License: GPLv2
|
|
62 |
|
63 |
|
64 |
// Initialize constants.
|
65 |
-
define( 'WPMEM_VERSION', '3.0.
|
66 |
define( 'WPMEM_DEBUG', false );
|
67 |
define( 'WPMEM_DIR', plugin_dir_url ( __FILE__ ) );
|
68 |
define( 'WPMEM_PATH', plugin_dir_path( __FILE__ ) );
|
@@ -131,8 +131,16 @@ function wpmem_init() {
|
|
131 |
}
|
132 |
|
133 |
// Preload the expiration module, if available.
|
134 |
-
$
|
135 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
136 |
|
137 |
/**
|
138 |
* Load the WP-Members core functions file.
|
@@ -167,9 +175,14 @@ function wpmem_init() {
|
|
167 |
* current users capabilities.
|
168 |
*
|
169 |
* @since 2.5.2
|
|
|
|
|
|
|
170 |
*/
|
171 |
function wpmem_chk_admin() {
|
172 |
|
|
|
|
|
173 |
/**
|
174 |
* Fires before initialization of admin options.
|
175 |
*
|
@@ -177,66 +190,15 @@ function wpmem_chk_admin() {
|
|
177 |
*/
|
178 |
do_action( 'wpmem_pre_admin_init' );
|
179 |
|
180 |
-
if ( is_multisite() && current_user_can( 'edit_theme_options' ) ) {
|
181 |
-
/**
|
182 |
-
* Load the main admin file.
|
183 |
-
*/
|
184 |
-
require_once( WPMEM_PATH . 'admin/admin.php' );
|
185 |
-
}
|
186 |
-
|
187 |
-
/**
|
188 |
-
* If user has a role that can edit users, load the admin functions,
|
189 |
-
* otherwise, load profile actions for non-admins.
|
190 |
-
*/
|
191 |
-
if ( current_user_can( 'edit_users' ) ) {
|
192 |
-
|
193 |
-
/**
|
194 |
-
* Load the main admin file if not already loaded.
|
195 |
-
*/
|
196 |
-
require_once( WPMEM_PATH . 'admin/admin.php' );
|
197 |
-
|
198 |
-
/**
|
199 |
-
* Load the admin user functions.
|
200 |
-
*/
|
201 |
-
require_once( WPMEM_PATH . 'admin/users.php' );
|
202 |
-
|
203 |
-
/**
|
204 |
-
* Load the admin user profile functions.
|
205 |
-
*/
|
206 |
-
require_once( WPMEM_PATH . 'admin/user-profile.php' );
|
207 |
-
|
208 |
-
} else {
|
209 |
-
|
210 |
-
/**
|
211 |
-
* Load the admin user functions.
|
212 |
-
*/
|
213 |
-
require_once( WPMEM_PATH . 'inc/users.php' );
|
214 |
-
|
215 |
-
// User actions and filters.
|
216 |
-
add_action( 'show_user_profile', 'wpmem_user_profile' );
|
217 |
-
add_action( 'edit_user_profile', 'wpmem_user_profile' );
|
218 |
-
add_action( 'profile_update', 'wpmem_profile_update' );
|
219 |
-
}
|
220 |
-
|
221 |
/**
|
222 |
-
*
|
223 |
-
*
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
require_once( WPMEM_PATH . 'admin/post.php' );
|
231 |
-
|
232 |
-
// Post actions and filters.
|
233 |
-
add_action( 'add_meta_boxes', 'wpmem_block_meta_add' );
|
234 |
-
add_action( 'save_post', 'wpmem_block_meta_save' );
|
235 |
-
add_filter( 'manage_posts_columns', 'wpmem_post_columns' );
|
236 |
-
add_action( 'manage_posts_custom_column', 'wpmem_post_columns_content', 10, 2 );
|
237 |
-
add_filter( 'manage_pages_columns', 'wpmem_post_columns' );
|
238 |
-
add_action( 'manage_pages_custom_column', 'wpmem_post_columns_content', 10, 2 );
|
239 |
-
}
|
240 |
|
241 |
/**
|
242 |
* Fires after initialization of admin options.
|
3 |
Plugin Name: WP-Members
|
4 |
Plugin URI: http://rocketgeek.com
|
5 |
Description: WP access restriction and user registration. For more information on plugin features, refer to <a href="http://rocketgeek.com/plugins/wp-members/users-guide/">the online Users Guide</a>. A <a href="http://rocketgeek.com/plugins/wp-members/quick-start-guide/">Quick Start Guide</a> is also available. WP-Members(tm) is a trademark of butlerblog.com.
|
6 |
+
Version: 3.1.0.3
|
7 |
Author: Chad Butler
|
8 |
Author URI: http://butlerblog.com/
|
9 |
Text Domain: wp-members
|
62 |
|
63 |
|
64 |
// Initialize constants.
|
65 |
+
define( 'WPMEM_VERSION', '3.1.0.3' );
|
66 |
define( 'WPMEM_DEBUG', false );
|
67 |
define( 'WPMEM_DIR', plugin_dir_url ( __FILE__ ) );
|
68 |
define( 'WPMEM_PATH', plugin_dir_path( __FILE__ ) );
|
131 |
}
|
132 |
|
133 |
// Preload the expiration module, if available.
|
134 |
+
$exp_plugin = 'wp-members-expiration/module.php';
|
135 |
+
$exp_active = ( in_array( $exp_plugin, get_option( 'active_plugins' ) ) ) ? true : false;
|
136 |
+
// Check multisite network active
|
137 |
+
if ( is_multisite() ) {
|
138 |
+
if ( ! function_exists( 'is_plugin_active_for_network' ) ) {
|
139 |
+
require_once( ABSPATH . '/wp-admin/includes/plugin.php' );
|
140 |
+
}
|
141 |
+
$exp_active = ( is_plugin_active_for_network( $exp_plugin ) ) ? true : $exp_active;
|
142 |
+
}
|
143 |
+
define( 'WPMEM_EXP_MODULE', $exp_active );
|
144 |
|
145 |
/**
|
146 |
* Load the WP-Members core functions file.
|
175 |
* current users capabilities.
|
176 |
*
|
177 |
* @since 2.5.2
|
178 |
+
* @since 3.1.0 Added admin api object.
|
179 |
+
*
|
180 |
+
* @global object $wpmem WP_Members object class.
|
181 |
*/
|
182 |
function wpmem_chk_admin() {
|
183 |
|
184 |
+
global $wpmem;
|
185 |
+
|
186 |
/**
|
187 |
* Fires before initialization of admin options.
|
188 |
*
|
190 |
*/
|
191 |
do_action( 'wpmem_pre_admin_init' );
|
192 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
193 |
/**
|
194 |
+
* Load the admin api class.
|
195 |
+
*
|
196 |
+
* @since 3.1
|
197 |
+
*/
|
198 |
+
include_once( WPMEM_PATH . 'admin/includes/class-wp-members-admin-api.php' );
|
199 |
+
|
200 |
+
// Initilize the admin api.
|
201 |
+
$wpmem->load_admin_api();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
202 |
|
203 |
/**
|
204 |
* Fires after initialization of admin options.
|