WP-Members Membership Plugin - Version 3.0.9

Version Description

  • Added Custom Post Type support.
  • Added wpmem_member_links_args and wpmem_register_links_args filters.
  • Added $link parameter to wpmem_forgot_link_str and wpmem_reg_link_str filters (gives just the link as an available parameter).
  • Added new wpmem_sb_reg_link_str and wpmem_sb_forgot_link_str filters (same format as above).
  • Added [email] and [user-profile] shortcodes to the new user registration email.
  • Added label_text key to wpmem_register_form_rows filter.
  • Added new auto excerpt settings, can now be set by post type.
  • Added new auto excerpt features including new wpmem_auto_excerpt_args filter.
  • Added forgot username retrieveal link (included on forgot password reset form).
  • Added wpmem_username_link and wpmem_username_link_str for filtering forgot username retrieval link.
  • Fixed handling of post bulk actions to keep current screen (if one is used).
  • Fixed handling of updates to the user pages in the options tab.
  • Fixed handling of empty post object in is_blocked() function.
  • Improved email functions to eliminate get_user_meta() calls when not needed.
Download this release

Release Info

Developer cbutlerjr
Plugin Icon 128x128 WP-Members Membership Plugin
Version 3.0.9
Comparing to
See all releases

Code changes from version 3.0.8 to 3.0.9

admin/admin.php CHANGED
@@ -6,12 +6,12 @@
6
  *
7
  * This file is part of the WP-Members plugin by Chad Butler
8
  * You can find out more about this plugin at http://rocketgeek.com
9
- * Copyright (c) 2006-2015 Chad Butler
10
  * WP-Members(tm) is a trademark of butlerblog.com
11
  *
12
  * @package WP-Members
13
  * @author Chad Butler
14
- * @copyright 2006-2015
15
  *
16
  * Functions included:
17
  * - wpmem_a_do_field_reorder
@@ -270,11 +270,12 @@ function wpmem_admin_action( $action ) {
270
  switch ( $action ) {
271
 
272
  case 'update_settings':
 
273
  /**
274
  * Load Options tab functions.
275
  */
276
  include_once( WPMEM_PATH . 'admin/tab-options.php' );
277
- $did_update = wpmem_update_options();
278
  break;
279
 
280
  case 'update_fields':
6
  *
7
  * This file is part of the WP-Members plugin by Chad Butler
8
  * You can find out more about this plugin at http://rocketgeek.com
9
+ * Copyright (c) 2006-2016 Chad Butler
10
  * WP-Members(tm) is a trademark of butlerblog.com
11
  *
12
  * @package WP-Members
13
  * @author Chad Butler
14
+ * @copyright 2006-2016
15
  *
16
  * Functions included:
17
  * - wpmem_a_do_field_reorder
270
  switch ( $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':
admin/dialogs.php CHANGED
@@ -6,13 +6,12 @@
6
  *
7
  * This file is part of the WP-Members plugin by Chad Butler
8
  * You can find out more about this plugin at http://rocketgeek.com
9
- * Copyright (c) 2006-2015 Chad Butler
10
  * WP-Members(tm) is a trademark of butlerblog.com
11
  *
12
- * @package WordPress
13
- * @subpackage WP-Members
14
  * @author Chad Butler
15
- * @copyright 2006-2015
16
  *
17
  * Functions included:
18
  * - wpmem_a_do_warnings
@@ -227,4 +226,4 @@ function butlerblog_feed_output() {
227
  echo "</div>";
228
  }
229
 
230
- /** End of File **/
6
  *
7
  * This file is part of the WP-Members plugin by Chad Butler
8
  * You can find out more about this plugin at http://rocketgeek.com
9
+ * Copyright (c) 2006-2016 Chad Butler
10
  * WP-Members(tm) is a trademark of butlerblog.com
11
  *
12
+ * @package WP-Members
 
13
  * @author Chad Butler
14
+ * @copyright 2006-2016
15
  *
16
  * Functions included:
17
  * - wpmem_a_do_warnings
226
  echo "</div>";
227
  }
228
 
229
+ // End of file.
admin/post.php CHANGED
@@ -6,13 +6,12 @@
6
  *
7
  * This file is part of the WP-Members plugin by Chad Butler
8
  * You can find out more about this plugin at http://rocketgeek.com
9
- * Copyright (c) 2006-2015 Chad Butler
10
  * WP-Members(tm) is a trademark of butlerblog.com
11
  *
12
- * @package WordPress
13
- * @subpackage WP-Members
14
  * @author Chad Butler
15
- * @copyright 2006-2015
16
  *
17
  * Functions included:
18
  * - wpmem_bulk_posts_action
@@ -41,10 +40,12 @@ add_action( 'load-post-new.php', 'wpmem_load_tinymce' );
41
  * Function to add block/unblock to the bulk dropdown list.
42
  *
43
  * @since 2.9.2
 
 
44
  */
45
- function wpmem_bulk_posts_action() {
46
- // @todo - holding off on CPT support for now.
47
- if ( ( isset( $_GET['post_type'] ) && $_GET['post_type'] == 'page' ) || ! isset( $_GET['post_type'] ) ) { ?>
48
  <script type="text/javascript">
49
  jQuery(document).ready(function() {
50
  jQuery('<option>').val('block').text('<?php _e( 'Block', 'wp-members' ) ?>').appendTo("select[name='action']");
@@ -62,7 +63,7 @@ function wpmem_bulk_posts_action() {
62
  *
63
  * @since 2.9.2
64
  *
65
- * @uses WP_Users_List_Table
66
  */
67
  function wpmem_posts_page_load() {
68
 
@@ -110,6 +111,9 @@ function wpmem_posts_page_load() {
110
  'n' => $x,
111
  'post_type' => $type,
112
  );
 
 
 
113
 
114
  $sendback = add_query_arg( array( $arr ), '', $sendback );
115
 
@@ -134,6 +138,9 @@ function wpmem_posts_page_load() {
134
  * Function to echo admin update message.
135
  *
136
  * @since 2.8.2
 
 
 
137
  */
138
  function wpmem_posts_admin_notices() {
139
 
@@ -149,25 +156,28 @@ function wpmem_posts_admin_notices() {
149
  * Adds the blocking meta boxes for post and page editor screens.
150
  *
151
  * @since 2.8
 
 
 
152
  */
153
  function wpmem_block_meta_add() {
 
 
154
 
155
  // Build an array of post types
156
- // @todo - holding off on CPT support.
157
- // $post_types = get_post_types( array( 'public' => true, '_builtin' => false ), 'names', 'and' );
158
  $post_arr = array(
159
  'post' => 'Posts',
160
  'page' => 'Pages',
161
  );
162
- /* if ( $post_types ) {
163
- foreach ( $post_types as $post_type ) {
164
- $cpt_obj = get_post_type_object( $post_type );
165
- $post_arr[ $cpt_obj->name ] = $cpt_obj->labels->name;
166
  }
167
- } */
168
 
169
  foreach ( $post_arr as $key => $val ) {
170
-
 
171
  /**
172
  * Filter the post meta box title.
173
  *
@@ -175,7 +185,7 @@ function wpmem_block_meta_add() {
175
  *
176
  * @param Post restriction title.
177
  */
178
- $post_title = apply_filters( 'wpmem_admin_' . $key . '_meta_title', __( $val . ' Restriction', 'wp-members' ) );
179
 
180
  add_meta_box( 'wpmem-block-meta-id', $post_title, 'wpmem_block_meta', $key, 'side', 'high' );
181
  }
@@ -187,42 +197,36 @@ function wpmem_block_meta_add() {
187
  *
188
  * @since 2.8
189
  *
190
- * @global $post The WordPress post object.
 
 
191
  */
192
  function wpmem_block_meta() {
193
 
194
- global $post, $wpmem;
195
 
196
  wp_nonce_field( 'wpmem_block_meta_nonce', 'wpmem_block_meta_nonce' );
197
 
198
- $post_type = get_post_type_object( $post->post_type );
199
 
200
  if ( isset( $wpmem->block[ $post->post_type ] ) && $wpmem->block[ $post->post_type ] == 1 ) {
201
  $block = 0;
202
- $notice_text = 'blocked';
203
- $text = 'Unblock';
204
- } else { //} elseif ( $wpmem->block[ $post->post_type ] == 0 ) {
205
  $block = 1;
206
- $notice_text = 'not blocked';
207
- $text = 'Block';
208
  }
209
  $meta = '_wpmem_block';
210
  $admin_url = get_admin_url(); ?>
211
 
212
  <p>
213
- <?php
214
- printf( '%s are %s by default.', $post_type->labels->name, $notice_text );
215
- echo '&nbsp;&nbsp;';
216
- printf( '<a href="%s/options-general.php?page=wpmem-settings">Edit</a>', $admin_url );
217
- ?>
218
  </p>
219
  <p>
220
- <?php if( $block == 1 ) { ?>
221
- <input type="checkbox" id="wpmem_block" name="wpmem_block" value="1" <?php checked( get_post_meta( $post->ID, $meta, true ), '1' ); ?> />
222
- <?php } else { ?>
223
- <input type="checkbox" id="wpmem_block" name="wpmem_block" value="0" <?php checked( get_post_meta( $post->ID, $meta, true ), '0' ); ?> />
224
- <?php } ?>
225
- <label for="wpmem_block"><?php printf( '%s this %s', $text, strtolower( $post_type->labels->singular_name ) ); ?></label>
226
  </p>
227
  <?php
228
  /**
@@ -244,7 +248,8 @@ function wpmem_block_meta() {
244
  *
245
  * @since 2.8
246
  *
247
- * @param int $post_id The post ID
 
248
  */
249
  function wpmem_block_meta_save( $post_id ) {
250
 
@@ -295,15 +300,15 @@ function wpmem_block_meta_save( $post_id ) {
295
  *
296
  * @since 2.8.3
297
  *
298
- * @uses wp_enqueue_style Loads the WP-Members admin stylesheet.
299
- *
300
- * @param arr $columns The array of table columns.
301
  */
302
  function wpmem_post_columns( $columns ) {
303
  global $wpmem;
304
  $post_type = ( isset( $_REQUEST['post_type'] ) ) ? $_REQUEST['post_type'] : 'post';
305
 
306
- if ( $post_type == 'page' || $post_type == 'post' ) { // @todo - holding off on CPT support.
307
  $columns['wpmem_block'] = ( $wpmem->block[ $post_type ] == 1 ) ? __( 'Unblocked?', 'wp-members' ) : __( 'Blocked?', 'wp-members' );
308
  }
309
  return $columns;
@@ -315,8 +320,9 @@ function wpmem_post_columns( $columns ) {
315
  *
316
  * @since 2.8.3
317
  *
318
- * @param $column_name
319
- * @param $post_ID
 
320
  */
321
  function wpmem_post_columns_content( $column_name, $post_ID ) {
322
 
@@ -345,6 +351,8 @@ function wpmem_post_columns_content( $column_name, $post_ID ) {
345
  * Adds shortcode dropdown to post editor tinymce.
346
  *
347
  * @since 3.0
 
 
348
  */
349
  function wpmem_load_tinymce() {
350
  // @todo For now, only load if WP version is high enough.
6
  *
7
  * This file is part of the WP-Members plugin by Chad Butler
8
  * You can find out more about this plugin at http://rocketgeek.com
9
+ * Copyright (c) 2006-2016 Chad Butler
10
  * WP-Members(tm) is a trademark of butlerblog.com
11
  *
12
+ * @package WP-Members
 
13
  * @author Chad Butler
14
+ * @copyright 2006-2016
15
  *
16
  * Functions included:
17
  * - wpmem_bulk_posts_action
40
  * Function to add block/unblock to the bulk dropdown list.
41
  *
42
  * @since 2.9.2
43
+ *
44
+ * @global object $wpmem The WP_Members object.
45
  */
46
+ function wpmem_bulk_posts_action() {
47
+ global $wpmem;
48
+ if ( ( isset( $_GET['post_type'] ) && ( 'page' == $_GET['post_type'] || 'post' == $_GET['post_type'] || array_key_exists( $_GET['post_type'], $wpmem->post_types ) ) ) || ! isset( $_GET['post_type'] ) ) { ?>
49
  <script type="text/javascript">
50
  jQuery(document).ready(function() {
51
  jQuery('<option>').val('block').text('<?php _e( 'Block', 'wp-members' ) ?>').appendTo("select[name='action']");
63
  *
64
  * @since 2.9.2
65
  *
66
+ * @global object $wpmem The WP_Members object.
67
  */
68
  function wpmem_posts_page_load() {
69
 
111
  'n' => $x,
112
  'post_type' => $type,
113
  );
114
+ if ( isset( $_GET['post_status'] ) && 'all' != $_GET['post_status'] ) {
115
+ $arr['post_status'] = $_GET['post_status'];
116
+ }
117
 
118
  $sendback = add_query_arg( array( $arr ), '', $sendback );
119
 
138
  * Function to echo admin update message.
139
  *
140
  * @since 2.8.2
141
+ *
142
+ * @global $pagenow
143
+ * @global $post_type
144
  */
145
  function wpmem_posts_admin_notices() {
146
 
156
  * Adds the blocking meta boxes for post and page editor screens.
157
  *
158
  * @since 2.8
159
+ *
160
+ * @global object $wp_post_types The Post Type object.
161
+ * @global object $wpmem The WP-Members object.
162
  */
163
  function wpmem_block_meta_add() {
164
+
165
+ global $wp_post_types, $wpmem;
166
 
167
  // Build an array of post types
 
 
168
  $post_arr = array(
169
  'post' => 'Posts',
170
  'page' => 'Pages',
171
  );
172
+ if ( isset( $wpmem->post_types ) ) {
173
+ foreach ( $wpmem->post_types as $key => $val ) {
174
+ $post_arr[ $key ] = $val;
 
175
  }
176
+ }
177
 
178
  foreach ( $post_arr as $key => $val ) {
179
+
180
+ $post_type = $wp_post_types[ $key ];
181
  /**
182
  * Filter the post meta box title.
183
  *
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
  }
197
  *
198
  * @since 2.8
199
  *
200
+ * @global object $post The WordPress post object.
201
+ * @global object $wp_post_types The Post Type object.
202
+ * @global object $wpmem The WP-Members object.
203
  */
204
  function wpmem_block_meta() {
205
 
206
+ global $post, $wp_post_types, $wpmem;
207
 
208
  wp_nonce_field( 'wpmem_block_meta_nonce', 'wpmem_block_meta_nonce' );
209
 
210
+ $post_type = $wp_post_types[ $post->post_type ];
211
 
212
  if ( isset( $wpmem->block[ $post->post_type ] ) && $wpmem->block[ $post->post_type ] == 1 ) {
213
  $block = 0;
214
+ $notice_text = sprintf( __( '%s are blocked by default.', 'wp-members' ), $post_type->labels->name );
215
+ $text = sprintf( __( 'Unblock this %s', 'wp-members' ), strtolower( $post_type->labels->singular_name ) );
216
+ } else {
217
  $block = 1;
218
+ $notice_text = sprintf( __( '%s are not blocked by default.', 'wp-members' ), $post_type->labels->name );
219
+ $text = sprintf( __( 'Block this %s', 'wp-members' ), strtolower( $post_type->labels->singular_name ) );
220
  }
221
  $meta = '_wpmem_block';
222
  $admin_url = get_admin_url(); ?>
223
 
224
  <p>
225
+ <?php echo $notice_text . '&nbsp;&nbsp;<a href="' . $admin_url . '/options-general.php?page=wpmem-settings">' . __( 'Edit', 'wp-members' ) . '</a>'; ?>
 
 
 
 
226
  </p>
227
  <p>
228
+ <input type="checkbox" id="wpmem_block" name="wpmem_block" value="<?php echo $block; ?>" <?php checked( get_post_meta( $post->ID, $meta, true ), $block ); ?> />
229
+ <label for="wpmem_block"><?php echo $text; ?></label>
 
 
 
 
230
  </p>
231
  <?php
232
  /**
248
  *
249
  * @since 2.8
250
  *
251
+ * @global object $post
252
+ * @param int $post_id The post ID
253
  */
254
  function wpmem_block_meta_save( $post_id ) {
255
 
300
  *
301
  * @since 2.8.3
302
  *
303
+ * @global object $wpmem The WP-Members Object
304
+ * @param array $columns The array of table columns.
305
+ * @return array $columns
306
  */
307
  function wpmem_post_columns( $columns ) {
308
  global $wpmem;
309
  $post_type = ( isset( $_REQUEST['post_type'] ) ) ? $_REQUEST['post_type'] : 'post';
310
 
311
+ if ( $post_type == 'page' || $post_type == 'post' || array_key_exists( $post_type, $wpmem->post_types ) ) {
312
  $columns['wpmem_block'] = ( $wpmem->block[ $post_type ] == 1 ) ? __( 'Unblocked?', 'wp-members' ) : __( 'Blocked?', 'wp-members' );
313
  }
314
  return $columns;
320
  *
321
  * @since 2.8.3
322
  *
323
+ * @global object $wpmem The WP_Members Object.
324
+ * @param string $column_name
325
+ * @param int $post_ID
326
  */
327
  function wpmem_post_columns_content( $column_name, $post_ID ) {
328
 
351
  * Adds shortcode dropdown to post editor tinymce.
352
  *
353
  * @since 3.0
354
+ *
355
+ * @global object $wpmem_shortcode The WP_Members_TinyMCE_Buttons object.
356
  */
357
  function wpmem_load_tinymce() {
358
  // @todo For now, only load if WP version is high enough.
admin/tab-captcha.php CHANGED
@@ -6,13 +6,13 @@
6
  *
7
  * This file is part of the WP-Members plugin by Chad Butler
8
  * You can find out more about this plugin at http://rocketgeek.com
9
- * Copyright (c) 2006-2015 Chad Butler
10
  * WP-Members(tm) is a trademark of butlerblog.com
11
  *
12
  * @package WordPress
13
  * @subpackage WP-Members
14
  * @author Chad Butler
15
- * @copyright 2006-2015
16
  *
17
  * Functions included:
18
  * - wpmem_a_build_captcha_options
@@ -266,4 +266,4 @@ function wpmem_update_captcha() {
266
  return __( 'CAPTCHA was updated for WP-Members', 'wp-members' );
267
  }
268
 
269
- /** End of File **/
6
  *
7
  * This file is part of the WP-Members plugin by Chad Butler
8
  * You can find out more about this plugin at http://rocketgeek.com
9
+ * Copyright (c) 2006-2016 Chad Butler
10
  * WP-Members(tm) is a trademark of butlerblog.com
11
  *
12
  * @package WordPress
13
  * @subpackage WP-Members
14
  * @author Chad Butler
15
+ * @copyright 2006-2016
16
  *
17
  * Functions included:
18
  * - wpmem_a_build_captcha_options
266
  return __( 'CAPTCHA was updated for WP-Members', 'wp-members' );
267
  }
268
 
269
+ // End of file.
admin/tab-dialogs.php CHANGED
@@ -6,13 +6,12 @@
6
  *
7
  * This file is part of the WP-Members plugin by Chad Butler
8
  * You can find out more about this plugin at http://rocketgeek.com
9
- * Copyright (c) 2006-2015 Chad Butler
10
  * WP-Members(tm) is a trademark of butlerblog.com
11
  *
12
- * @package WordPress
13
- * @subpackage WP-Members
14
  * @author Chad Butler
15
- * @copyright 2006-2015
16
  *
17
  * Functions included:
18
  * - wpmem_a_build_dialogs
@@ -119,4 +118,4 @@ function wpmem_update_dialogs() {
119
  return __( 'WP-Members dialogs were updated', 'wp-members' );
120
  }
121
 
122
- /** End of File **/
6
  *
7
  * This file is part of the WP-Members plugin by Chad Butler
8
  * You can find out more about this plugin at http://rocketgeek.com
9
+ * Copyright (c) 2006-2016 Chad Butler
10
  * WP-Members(tm) is a trademark of butlerblog.com
11
  *
12
+ * @package WP-Members
 
13
  * @author Chad Butler
14
+ * @copyright 2006-2016
15
  *
16
  * Functions included:
17
  * - wpmem_a_build_dialogs
118
  return __( 'WP-Members dialogs were updated', 'wp-members' );
119
  }
120
 
121
+ // End of file.
admin/tab-emails.php CHANGED
@@ -6,13 +6,12 @@
6
  *
7
  * This file is part of the WP-Members plugin by Chad Butler
8
  * You can find out more about this plugin at http://rocketgeek.com
9
- * Copyright (c) 2006-2015 Chad Butler
10
  * WP-Members(tm) is a trademark of butlerblog.com
11
  *
12
- * @package WordPress
13
- * @subpackage WP-Members
14
  * @author Chad Butler
15
- * @copyright 2006-2015
16
  *
17
  * Functions included:
18
  * - wpmem_a_build_emails
@@ -171,4 +170,4 @@ function wpmem_update_emails() {
171
 
172
  }
173
 
174
- /** End of File **/
6
  *
7
  * This file is part of the WP-Members plugin by Chad Butler
8
  * You can find out more about this plugin at http://rocketgeek.com
9
+ * Copyright (c) 2006-2016 Chad Butler
10
  * WP-Members(tm) is a trademark of butlerblog.com
11
  *
12
+ * @package WP-Members
 
13
  * @author Chad Butler
14
+ * @copyright 2006-2016
15
  *
16
  * Functions included:
17
  * - wpmem_a_build_emails
170
 
171
  }
172
 
173
+ // End of file.
admin/tab-fields.php CHANGED
@@ -6,13 +6,12 @@
6
  *
7
  * This file is part of the WP-Members plugin by Chad Butler
8
  * You can find out more about this plugin at http://rocketgeek.com
9
- * Copyright (c) 2006-2015 Chad Butler
10
  * WP-Members(tm) is a trademark of butlerblog.com
11
  *
12
- * @package WordPress
13
- * @subpackage WP-Members
14
  * @author Chad Butler
15
- * @copyright 2006-2015
16
  */
17
 
18
 
@@ -568,4 +567,4 @@ function wpmem_a_field_table( $wpmem_fields ) {
568
  <?php
569
  }
570
 
571
- /** End of File **/
6
  *
7
  * This file is part of the WP-Members plugin by Chad Butler
8
  * You can find out more about this plugin at http://rocketgeek.com
9
+ * Copyright (c) 2006-2016 Chad Butler
10
  * WP-Members(tm) is a trademark of butlerblog.com
11
  *
12
+ * @package WP-Members
 
13
  * @author Chad Butler
14
+ * @copyright 2006-2016
15
  */
16
 
17
 
567
  <?php
568
  }
569
 
570
+ // End of file.
admin/tab-options.php CHANGED
@@ -6,17 +6,18 @@
6
  *
7
  * This file is part of the WP-Members plugin by Chad Butler
8
  * You can find out more about this plugin at http://rocketgeek.com
9
- * Copyright (c) 2006-2015 Chad Butler
10
  * WP-Members(tm) is a trademark of butlerblog.com
11
  *
12
- * @package WordPress
13
- * @subpackage WP-Members
14
  * @author Chad Butler
15
- * @copyright 2006-2015
16
  *
17
  * Functions included:
18
  * - wpmem_a_build_options
 
19
  * - wpmem_update_options
 
20
  * - wpmem_admin_style_list
21
  * - wpmem_admin_page_list
22
  */
@@ -31,6 +32,7 @@ function wpmem_a_build_options() {
31
 
32
  global $wpmem;
33
 
 
34
  $admin_email = apply_filters( 'wpmem_notify_addr', get_option( 'admin_email' ) );
35
  $chg_email = __( sprintf( '%sChange%s or %sFilter%s this address', '<a href="' . site_url( 'wp-admin/options-general.php', 'admin' ) . '">', '</a>', '<a href="http://rocketgeek.com/plugins/wp-members/users-guide/filter-hooks/wpmem_notify_addr/">', '</a>' ), 'wp-members' );
36
  $help_link = __( sprintf( 'See the %sUsers Guide on plugin options%s.', '<a href="http://rocketgeek.com/plugins/wp-members/users-guide/plugin-settings/options/" target="_blank">', '</a>' ), 'wp-members' );
@@ -75,8 +77,9 @@ function wpmem_a_build_options() {
75
  // Content Blocking option group.
76
  $i = 0;
77
  $len = count( $post_arr );
78
- foreach ( $post_arr as $key => $val ) {
79
- if ( $key == 'post' || $key == 'page' ) { // @todo - holding off on CPT support. ?>
 
80
  <li<?php echo ( $i == $len - 1 ) ? ' style="border-bottom:1px solid #eee;"' : ''; ?>>
81
  <label><?php echo ( $i == 0 ) ? 'Content Blocking' : '&nbsp;'; ?></label>
82
  <select name="wpmem_block_<?php echo $key; ?>">
@@ -96,19 +99,32 @@ function wpmem_a_build_options() {
96
  'show_excerpt' => __( 'Show Excerpts', 'wp-members' ),
97
  'show_login' => __( 'Show Login Form', 'wp-members' ),
98
  'show_reg' => __( 'Show Registration Form', 'wp-members' ),
 
99
  );
100
 
101
  foreach ( $option_group_array as $item_key => $item_val ) {
102
  $i = 0;
103
  $len = count( $post_arr );
104
  foreach ( $post_arr as $key => $val ) {
105
- if ( $key == 'post' || $key == 'page' ) { // @todo - holding off on CPT support.
106
- $setting = ( isset( $wpmem->{$item_key}[ $key ] ) ) ? $wpmem->{$item_key}[ $key ] : 0;
107
  ?>
108
  <li<?php echo ( $i == $len - 1 ) ? ' style="border-bottom:1px solid #eee;"' : ''; ?>>
109
  <label><?php echo ( $i == 0 ) ? $item_val : '&nbsp;'; ?></label>
110
- <input name="wpmem_<?php echo $item_key; ?>_<?php echo $key; ?>" type="checkbox" id="" value="1"<?php echo wpmem_selected( 1, $setting ); ?> /> <span><?php echo $val; ?></span>
111
- </li>
 
 
 
 
 
 
 
 
 
 
 
 
 
112
  <?php $i++;
113
  }
114
  }
@@ -152,11 +168,6 @@ function wpmem_a_build_options() {
152
  <input name="attribution" type="checkbox" id="attribution" value="1" <?php if ( $attribution == 1 ) { echo "checked"; }?> />&nbsp;&nbsp;
153
  <span class="description"><?php _e( 'Attribution is appreciated! Display "powered by" link on register form?', 'wp-members' ); ?></span>
154
  </li>
155
- <?php $auto_ex = $wpmem->autoex; ?>
156
- <li>
157
- <label><?php _e( 'Auto Excerpt:', 'wp-members' ); ?></label>
158
- <input type="checkbox" name="wpmem_autoex" value="1" <?php if ( $auto_ex['auto_ex'] == 1 ) { echo "checked"; } ?> />&nbsp;&nbsp;&nbsp;&nbsp;<?php _e( 'Number of words in excerpt:', 'wp-members' ); ?> <input name="wpmem_autoex_len" type="text" size="5" value="<?php if ( $auto_ex['auto_ex_len'] ) { echo $auto_ex['auto_ex_len']; } ?>" />&nbsp;<span class="description"><?php _e( 'Optional', 'wp-members' ); ?>. <?php _e( 'Automatically creates an excerpt', 'wp-members' ); ?></span>
159
- </li>
160
  <li>
161
  <label><?php _e( 'Enable CAPTCHA', 'wp-members' ); ?></label>
162
  <select name="wpmem_settings_captcha">
@@ -225,6 +236,34 @@ function wpmem_a_build_options() {
225
  </form>
226
  </div><!-- .inside -->
227
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
228
  </div><!-- #post-body-content -->
229
  </div><!-- #post-body -->
230
  </div><!-- .metabox-holder -->
@@ -232,15 +271,90 @@ function wpmem_a_build_options() {
232
  }
233
 
234
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
235
  /**
236
  * Updates the plugin options.
237
  *
238
  * @since 2.8.0
239
  *
240
- * @return string The options updated message.
 
241
  */
242
  function wpmem_update_options() {
243
 
 
 
244
  // Check nonce.
245
  check_admin_referer( 'wpmem-update-settings' );
246
 
@@ -273,11 +387,6 @@ function wpmem_update_options() {
273
 
274
  $wpmem_settings_style = ( isset( $_POST['wpmem_settings_style'] ) ) ? $_POST['wpmem_settings_style'] : false;
275
 
276
- $wpmem_autoex = array (
277
- 'auto_ex' => isset( $_POST['wpmem_autoex'] ) ? $_POST['wpmem_autoex'] : 0,
278
- 'auto_ex_len' => isset( $_POST['wpmem_autoex_len'] ) ? $_POST['wpmem_autoex_len'] : '',
279
- );
280
-
281
  $wpmem_newsettings = array(
282
  'version' => WPMEM_VERSION,
283
  'notify' => ( isset( $_POST['wpmem_settings_notify'] ) ) ? $_POST['wpmem_settings_notify'] : 0,
@@ -293,27 +402,32 @@ function wpmem_update_options() {
293
  ),
294
  'cssurl' => ( $cssurl ) ? $cssurl : '',
295
  'style' => $wpmem_settings_style,
296
- 'autoex' => $wpmem_autoex,
297
  'attrib' => ( isset( $_POST['attribution'] ) ) ? $_POST['attribution'] : 0,
298
  );
299
 
300
  // Build an array of post types
301
- $post_types = get_post_types( array( 'public' => true, '_builtin' => false ), 'names', 'and' );
302
  $post_arr = array( 'post', 'page' );
303
- if ( $post_types ) {
304
- foreach ( $post_types as $post_type ) {
305
- $cpt_obj = get_post_type_object( $post_type );
306
- $post_arr[] = $cpt_obj->name;
307
  }
308
  }
309
 
310
  // Get settings for blocking, excerpts, show login, and show registration for posts, pages, and custom post types.
311
- $option_group_array = array( 'block', 'show_excerpt', 'show_login', 'show_reg' );
312
  foreach ( $option_group_array as $option_group_item ) {
313
  $arr = array();
314
  foreach ( $post_arr as $post_type ) {
315
  $post_var = 'wpmem_' . $option_group_item . '_' . $post_type;
316
- $arr[ $post_type ] = ( isset( $_POST[ $post_var ] ) ) ? $_POST[ $post_var ] : 0;
 
 
 
 
 
 
 
317
  }
318
  $wpmem_newsettings[ $option_group_item ] = $arr;
319
  }
@@ -323,7 +437,7 @@ function wpmem_update_options() {
323
  * check to see if the current admin has been
324
  * activated so they don't accidentally lock themselves
325
  * out later.
326
- */
327
  if ( isset( $_POST['wpmem_settings_moderate'] ) == 1 ) {
328
  global $current_user;
329
  get_currentuserinfo();
@@ -331,14 +445,36 @@ function wpmem_update_options() {
331
  update_user_meta( $user_ID, 'active', 1 );
332
  }
333
 
334
- update_option( 'wpmembers_settings', $wpmem_newsettings );
335
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
336
  global $wpmem;
337
- foreach ( $wpmem_newsettings as $key => $val ) {
 
 
 
 
 
338
  $wpmem->$key = $val;
339
  }
340
-
341
- return __( 'WP-Members settings were updated', 'wp-members' );
342
  }
343
 
344
 
@@ -354,6 +490,7 @@ function wpmem_admin_style_list( $style ) {
354
  $list = array(
355
  'No Float' => WPMEM_DIR . 'css/generic-no-float.css',
356
  'Rigid' => WPMEM_DIR . 'css/generic-rigid.css',
 
357
  'Twenty Fifteen' => WPMEM_DIR . 'css/wp-members-2015.css',
358
  'Twenty Fifteen - no float' => WPMEM_DIR . 'css/wp-members-2015-no-float.css',
359
  'Twenty Fourteen' => WPMEM_DIR . 'css/wp-members-2014.css',
@@ -401,7 +538,7 @@ function wpmem_admin_page_list( $val, $show_custom_url = true ) {
401
  echo '<option value=""'; echo ( $selected == 'select a page' ) ? ' selected' : ''; echo '>'; echo esc_attr( __( 'Select a page' ) ); echo '</option>';
402
 
403
  foreach ( $pages as $page ) {
404
- $selected = ( get_page_link( $page->ID ) == $val ) ? true : $selected;
405
  $option = '<option value="' . $page->ID . '"' . wpmem_selected( get_page_link( $page->ID ), $val, 'select' ) . '>';
406
  $option .= $page->post_title;
407
  $option .= '</option>';
@@ -413,4 +550,4 @@ function wpmem_admin_page_list( $val, $show_custom_url = true ) {
413
  }
414
  }
415
 
416
- /** End of File **/
6
  *
7
  * This file is part of the WP-Members plugin by Chad Butler
8
  * You can find out more about this plugin at http://rocketgeek.com
9
+ * Copyright (c) 2006-2016 Chad Butler
10
  * WP-Members(tm) is a trademark of butlerblog.com
11
  *
12
+ * @package WP-Members
 
13
  * @author Chad Butler
14
+ * @copyright 2006-2016
15
  *
16
  * Functions included:
17
  * - wpmem_a_build_options
18
+ * - wpmem_update_cpts
19
  * - wpmem_update_options
20
+ * - wpmem_admin_new_settings
21
  * - wpmem_admin_style_list
22
  * - wpmem_admin_page_list
23
  */
32
 
33
  global $wpmem;
34
 
35
+ /** This filter is documented in wp-members/inc/email.php */
36
  $admin_email = apply_filters( 'wpmem_notify_addr', get_option( 'admin_email' ) );
37
  $chg_email = __( sprintf( '%sChange%s or %sFilter%s this address', '<a href="' . site_url( 'wp-admin/options-general.php', 'admin' ) . '">', '</a>', '<a href="http://rocketgeek.com/plugins/wp-members/users-guide/filter-hooks/wpmem_notify_addr/">', '</a>' ), 'wp-members' );
38
  $help_link = __( sprintf( 'See the %sUsers Guide on plugin options%s.', '<a href="http://rocketgeek.com/plugins/wp-members/users-guide/plugin-settings/options/" target="_blank">', '</a>' ), 'wp-members' );
77
  // Content Blocking option group.
78
  $i = 0;
79
  $len = count( $post_arr );
80
+ foreach ( $post_arr as $key => $val ) {
81
+ if ( $key == 'post' || $key == 'page' || ( isset( $wpmem->post_types ) && array_key_exists( $key, $wpmem->post_types ) ) ) {
82
+ ?>
83
  <li<?php echo ( $i == $len - 1 ) ? ' style="border-bottom:1px solid #eee;"' : ''; ?>>
84
  <label><?php echo ( $i == 0 ) ? 'Content Blocking' : '&nbsp;'; ?></label>
85
  <select name="wpmem_block_<?php echo $key; ?>">
99
  'show_excerpt' => __( 'Show Excerpts', 'wp-members' ),
100
  'show_login' => __( 'Show Login Form', 'wp-members' ),
101
  'show_reg' => __( 'Show Registration Form', 'wp-members' ),
102
+ 'autoex' => __( 'Auto Excerpt:', 'wp-members' ),
103
  );
104
 
105
  foreach ( $option_group_array as $item_key => $item_val ) {
106
  $i = 0;
107
  $len = count( $post_arr );
108
  foreach ( $post_arr as $key => $val ) {
109
+ if ( $key == 'post' || $key == 'page' || ( isset( $wpmem->post_types ) && array_key_exists( $key, $wpmem->post_types ) ) ) {
 
110
  ?>
111
  <li<?php echo ( $i == $len - 1 ) ? ' style="border-bottom:1px solid #eee;"' : ''; ?>>
112
  <label><?php echo ( $i == 0 ) ? $item_val : '&nbsp;'; ?></label>
113
+ <?php if ( 'autoex' == $item_key ) {
114
+ if ( isset( $wpmem->{$item_key}[ $key ] ) && $wpmem->{$item_key}[ $key ]['enabled'] == 1 ) {
115
+ $setting = 1;
116
+ $ex_len = $wpmem->{$item_key}[ $key ]['length'];
117
+ } else {
118
+ $setting = 0;
119
+ $ex_len = '';
120
+ } ?>
121
+ <input name="wpmem_<?php echo $item_key; ?>_<?php echo $key; ?>" type="checkbox" id="" value="1"<?php echo wpmem_selected( 1, $setting ); ?> /> <span><?php echo $val; ?></span>&nbsp;&nbsp;&nbsp;&nbsp;
122
+ <span><?php _e( 'Number of words in excerpt:', 'wp-members' ); ?> </span><input name="wpmem_autoex_<?php echo $key; ?>_len" type="text" size="5" value="<?php echo $ex_len; ?>" />
123
+ <?php } else {
124
+ $setting = ( isset( $wpmem->{$item_key}[ $key ] ) ) ? $wpmem->{$item_key}[ $key ] : 0; ?>
125
+ <input name="wpmem_<?php echo $item_key; ?>_<?php echo $key; ?>" type="checkbox" id="" value="1"<?php echo wpmem_selected( 1, $setting ); ?> /> <span><?php echo $val; ?></span>
126
+ <?php } ?>
127
+ </li>
128
  <?php $i++;
129
  }
130
  }
168
  <input name="attribution" type="checkbox" id="attribution" value="1" <?php if ( $attribution == 1 ) { echo "checked"; }?> />&nbsp;&nbsp;
169
  <span class="description"><?php _e( 'Attribution is appreciated! Display "powered by" link on register form?', 'wp-members' ); ?></span>
170
  </li>
 
 
 
 
 
171
  <li>
172
  <label><?php _e( 'Enable CAPTCHA', 'wp-members' ); ?></label>
173
  <select name="wpmem_settings_captcha">
236
  </form>
237
  </div><!-- .inside -->
238
  </div>
239
+ <?php if ( $post_types ) { ?>
240
+ <div class="postbox">
241
+ <h3><span><?php _e( 'Custom Post Types', 'wp-members' ); ?></span></h3>
242
+ <div class="inside">
243
+ <form name="updatecpts" id="updatecpts" method="post" action="<?php echo $_SERVER['REQUEST_URI']?>">
244
+ <?php wp_nonce_field( 'wpmem-update-cpts' ); ?>
245
+ <table class="form-table">
246
+ <tr>
247
+ <th scope="row">Add to WP-Members Settings</th>
248
+ <td><fieldset><?php
249
+ foreach ( $post_arr as $key => $val ) {
250
+ if ( 'post' != $key && 'page' != $key ) {
251
+ $checked = ( isset( $wpmem->post_types ) && array_key_exists( $key, $wpmem->post_types ) ) ? ' checked' : '';
252
+ echo '<label for="' . $key . '"><input type="checkbox" name="wpmembers_handle_cpts[]" value="' . $key . '"' . $checked . ' />' . $val . '</label><br />';
253
+ }
254
+ }
255
+ ?></fieldset>
256
+ </td>
257
+ </tr>
258
+ <tr>
259
+ <input type="hidden" name="wpmem_admin_a" value="update_cpts" />
260
+ <td colspan="2"><?php submit_button( __( 'Update Settings', 'wp-members' ) ); ?></td>
261
+ </tr>
262
+ </table>
263
+ </form>
264
+ </div>
265
+ </div>
266
+ <?php } ?>
267
  </div><!-- #post-body-content -->
268
  </div><!-- #post-body -->
269
  </div><!-- .metabox-holder -->
271
  }
272
 
273
 
274
+ /**
275
+ * Updates the plugin settings on Custom Post Types to manage.
276
+ *
277
+ * @since 3.0.9
278
+ *
279
+ * @return string The updated message.
280
+ */
281
+ function wpmem_update_cpts() {
282
+
283
+ // Check nonce.
284
+ check_admin_referer( 'wpmem-update-cpts' );
285
+
286
+ // Get the main settings array as it stands.
287
+ $wpmem_newsettings = get_option( 'wpmembers_settings' );
288
+
289
+ // Assemble CPT settings.
290
+ $cpts = array();
291
+
292
+ $post_arr = array();
293
+ $post_types = get_post_types( array( 'public' => true, '_builtin' => false ), 'names', 'and' );
294
+ if ( $post_types ) {
295
+ foreach ( $post_types as $post_type ) {
296
+ $cpt_obj = get_post_type_object( $post_type );
297
+ $post_arr[ $cpt_obj->name ] = $cpt_obj->labels->name;
298
+ }
299
+ }
300
+
301
+ $post_vals = ( isset( $_POST['wpmembers_handle_cpts'] ) ) ? $_POST['wpmembers_handle_cpts'] : false;
302
+ if ( $post_vals ) {
303
+ foreach ( $post_vals as $val ) {
304
+ $cpts[ $val ] = $post_arr[ $val ];
305
+ }
306
+ } else {
307
+ $cpts = array();
308
+ }
309
+ $wpmem_newsettings['post_types'] = $cpts;
310
+
311
+ // Update settings, remove or add CPTs.
312
+ $chk_settings = array( 'block', 'show_excerpt', 'show_login', 'show_reg', 'autoex' );
313
+ foreach ( $chk_settings as $chk ) {
314
+ // Handle removing unmanaged CPTs.
315
+ foreach ( $wpmem_newsettings[ $chk ] as $key => $val ) {
316
+ if ( 'post' != $key && 'page' != $key ) {
317
+ // If the $key is not in managed CPTs, remove it.
318
+ if ( ! array_key_exists( $key, $cpts ) ) {
319
+ unset( $wpmem_newsettings[ $chk ][ $key ] );
320
+ }
321
+ }
322
+ }
323
+ // Handle adding managed CPTs.
324
+ foreach ( $cpts as $key => $val ) {
325
+ if ( ! array_key_exists( $key, $wpmem_newsettings[ $chk ] ) ) {
326
+ if ( 'autoex' == $chk ) {
327
+ // Auto excerpt is an array.
328
+ $wpmem_newsettings[ $chk ][ $key ] = array(
329
+ 'enabled' => 0,
330
+ 'length' => '',
331
+ );
332
+ } else {
333
+ // All other settings are 0|1.
334
+ $wpmem_newsettings[ $chk ][ $key ] = 0;
335
+ }
336
+ }
337
+ }
338
+ }
339
+
340
+ wpmem_admin_new_settings( $wpmem_newsettings );
341
+
342
+ return __( 'Custom Post Type settings were updated', 'wp-members' );
343
+ }
344
+
345
+
346
  /**
347
  * Updates the plugin options.
348
  *
349
  * @since 2.8.0
350
  *
351
+ * @global object $wpmem The WP_Members object.
352
+ * @return string The options updated message.
353
  */
354
  function wpmem_update_options() {
355
 
356
+ global $wpmem;
357
+
358
  // Check nonce.
359
  check_admin_referer( 'wpmem-update-settings' );
360
 
387
 
388
  $wpmem_settings_style = ( isset( $_POST['wpmem_settings_style'] ) ) ? $_POST['wpmem_settings_style'] : false;
389
 
 
 
 
 
 
390
  $wpmem_newsettings = array(
391
  'version' => WPMEM_VERSION,
392
  'notify' => ( isset( $_POST['wpmem_settings_notify'] ) ) ? $_POST['wpmem_settings_notify'] : 0,
402
  ),
403
  'cssurl' => ( $cssurl ) ? $cssurl : '',
404
  'style' => $wpmem_settings_style,
 
405
  'attrib' => ( isset( $_POST['attribution'] ) ) ? $_POST['attribution'] : 0,
406
  );
407
 
408
  // Build an array of post types
 
409
  $post_arr = array( 'post', 'page' );
410
+ if ( isset( $wpmem->post_types ) ) {
411
+ $wpmem_newsettings['post_types'] = $wpmem->post_types;
412
+ foreach ( $wpmem_newsettings['post_types'] as $key => $val ) {
413
+ $post_arr[] = $key;
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 ) {
420
  $arr = array();
421
  foreach ( $post_arr as $post_type ) {
422
  $post_var = 'wpmem_' . $option_group_item . '_' . $post_type;
423
+ if ( $option_group_item == 'autoex' ) {
424
+ // Auto excerpt is an array.
425
+ $arr[ $post_type ]['enabled'] = ( isset( $_POST[ $post_var ] ) ) ? $_POST[ $post_var ] : 0;
426
+ $arr[ $post_type ]['length'] = ( isset( $_POST[ $post_var ] ) ) ? ( ( $_POST[ $post_var . '_len' ] == '' ) ? 0 : $_POST[ $post_var . '_len' ] ) : '';
427
+ } else {
428
+ // All other settings are 0|1.
429
+ $arr[ $post_type ] = ( isset( $_POST[ $post_var ] ) ) ? $_POST[ $post_var ] : 0;
430
+ }
431
  }
432
  $wpmem_newsettings[ $option_group_item ] = $arr;
433
  }
437
  * check to see if the current admin has been
438
  * activated so they don't accidentally lock themselves
439
  * out later.
440
+ */
441
  if ( isset( $_POST['wpmem_settings_moderate'] ) == 1 ) {
442
  global $current_user;
443
  get_currentuserinfo();
445
  update_user_meta( $user_ID, 'active', 1 );
446
  }
447
 
448
+ wpmem_admin_new_settings( $wpmem_newsettings );
449
 
450
+ return __( 'WP-Members settings were updated', 'wp-members' );
451
+ }
452
+
453
+
454
+ /**
455
+ * Puts new settings into the current object.
456
+ *
457
+ * @since 3.0.9
458
+ *
459
+ * @global $wpmem
460
+ * @param $new
461
+ * @return $settings
462
+ */
463
+ function wpmem_admin_new_settings( $new ) {
464
+
465
+ // Update saved settings.
466
+ update_option( 'wpmembers_settings', $new );
467
+
468
+ // Update the current WP_Members object with the new settings.
469
  global $wpmem;
470
+ foreach ( $new as $key => $val ) {
471
+ if ( 'user_pages' == $key ) {
472
+ foreach ( $val as $subkey => $subval ) {
473
+ $val[ $subkey ] = ( is_numeric( $subval ) ) ? get_page_link( $subval ) : $subval;
474
+ }
475
+ }
476
  $wpmem->$key = $val;
477
  }
 
 
478
  }
479
 
480
 
490
  $list = array(
491
  'No Float' => WPMEM_DIR . 'css/generic-no-float.css',
492
  'Rigid' => WPMEM_DIR . 'css/generic-rigid.css',
493
+ 'Twenty Sixteen - no float' => WPMEM_DIR . 'css/wp-members-2016-no-float.css',
494
  'Twenty Fifteen' => WPMEM_DIR . 'css/wp-members-2015.css',
495
  'Twenty Fifteen - no float' => WPMEM_DIR . 'css/wp-members-2015-no-float.css',
496
  'Twenty Fourteen' => WPMEM_DIR . 'css/wp-members-2014.css',
538
  echo '<option value=""'; echo ( $selected == 'select a page' ) ? ' selected' : ''; echo '>'; echo esc_attr( __( 'Select a page' ) ); echo '</option>';
539
 
540
  foreach ( $pages as $page ) {
541
+ $selected = ( get_page_link( $page->ID ) == $val ) ? true : $selected; echo "VAL: " . $val . ' PAGE LINK: ' . get_page_link( $page->ID );
542
  $option = '<option value="' . $page->ID . '"' . wpmem_selected( get_page_link( $page->ID ), $val, 'select' ) . '>';
543
  $option .= $page->post_title;
544
  $option .= '</option>';
550
  }
551
  }
552
 
553
+ // End of file.
admin/user-export.php CHANGED
@@ -6,13 +6,12 @@
6
  *
7
  * This file is part of the WP-Members plugin by Chad Butler
8
  * You can find out more about this plugin at http://rocketgeek.com
9
- * Copyright (c) 2006-2015 Chad Butler
10
  * WP-Members(tm) is a trademark of butlerblog.com
11
  *
12
- * @package WordPress
13
- * @subpackage WP-Members
14
  * @author Chad Butler
15
- * @copyright 2006-2015
16
  */
17
 
18
 
@@ -132,4 +131,4 @@ function wpmem_export_users( $args, $users = null ) {
132
  exit();
133
  }
134
 
135
- /** End of File **/
6
  *
7
  * This file is part of the WP-Members plugin by Chad Butler
8
  * You can find out more about this plugin at http://rocketgeek.com
9
+ * Copyright (c) 2006-2016 Chad Butler
10
  * WP-Members(tm) is a trademark of butlerblog.com
11
  *
12
+ * @package WP-Members
 
13
  * @author Chad Butler
14
+ * @copyright 2006-20165
15
  */
16
 
17
 
131
  exit();
132
  }
133
 
134
+ // End of file.
admin/user-profile.php CHANGED
@@ -6,13 +6,12 @@
6
  *
7
  * This file is part of the WP-Members plugin by Chad Butler
8
  * You can find out more about this plugin at http://rocketgeek.com
9
- * Copyright (c) 2006-2015 Chad Butler
10
  * WP-Members(tm) is a trademark of butlerblog.com
11
  *
12
- * @package WordPress
13
- * @subpackage WP-Members
14
  * @author Chad Butler
15
- * @copyright 2006-2015
16
  *
17
  * Functions included:
18
  * - wpmem_admin_fields
@@ -236,4 +235,4 @@ function wpmem_admin_update() {
236
  return;
237
  }
238
 
239
- /** End of File **/
6
  *
7
  * This file is part of the WP-Members plugin by Chad Butler
8
  * You can find out more about this plugin at http://rocketgeek.com
9
+ * Copyright (c) 2006-2016 Chad Butler
10
  * WP-Members(tm) is a trademark of butlerblog.com
11
  *
12
+ * @package WP-Members
 
13
  * @author Chad Butler
14
+ * @copyright 2006-2016
15
  *
16
  * Functions included:
17
  * - wpmem_admin_fields
235
  return;
236
  }
237
 
238
+ // End of file.
admin/users.php CHANGED
@@ -6,13 +6,12 @@
6
  *
7
  * This file is part of the WP-Members plugin by Chad Butler
8
  * You can find out more about this plugin at http://rocketgeek.com
9
- * Copyright (c) 2006-2015 Chad Butler
10
  * WP-Members(tm) is a trademark of butlerblog.com
11
  *
12
- * @package WordPress
13
- * @subpackage WP-Members
14
  * @author Chad Butler
15
- * @copyright 2006-2015
16
  *
17
  * Functions included:
18
  * - wpmem_bulk_user_action
@@ -538,4 +537,4 @@ function wpmem_set_user_status( $user_id, $status ) {
538
  return;
539
  }
540
 
541
- /** End of File **/
6
  *
7
  * This file is part of the WP-Members plugin by Chad Butler
8
  * You can find out more about this plugin at http://rocketgeek.com
9
+ * Copyright (c) 2006-2016 Chad Butler
10
  * WP-Members(tm) is a trademark of butlerblog.com
11
  *
12
+ * @package WP-Members
 
13
  * @author Chad Butler
14
+ * @copyright 2006-2016
15
  *
16
  * Functions included:
17
  * - wpmem_bulk_user_action
537
  return;
538
  }
539
 
540
+ // End of file.
css/generic-no-float.css CHANGED
@@ -194,6 +194,7 @@ see http://rocketgeek.com/tips-and-tricks/load-a-custom-stylesheet/
194
  line-height: 0px;
195
  }
196
  #wpmem_login .link-text {
 
197
  width: 74%;
198
  text-align:right;
199
  }
@@ -207,7 +208,7 @@ see http://rocketgeek.com/tips-and-tricks/load-a-custom-stylesheet/
207
 
208
  #wpmem_reg .button_div, #wpmem_login .button_div {
209
  width:74%;
210
- height:35px;
211
  padding: 6px 0;
212
  text-align: right;
213
  }
194
  line-height: 0px;
195
  }
196
  #wpmem_login .link-text {
197
+ padding: 4px 0;
198
  width: 74%;
199
  text-align:right;
200
  }
208
 
209
  #wpmem_reg .button_div, #wpmem_login .button_div {
210
  width:74%;
211
+ height:45px;
212
  padding: 6px 0;
213
  text-align: right;
214
  }
inc/class-wp-members.php CHANGED
@@ -31,13 +31,12 @@ class WP_Members {
31
  $settings = apply_filters( 'wpmem_settings', get_option( 'wpmembers_settings' ) );
32
 
33
  // Validate that v3 settings are loaded.
34
- if ( ! isset( $settings['version'] ) ) {
35
- // If settings were not properly built during plugin upgrade.
36
  /**
37
  * Load installation routine.
38
  */
39
  require_once( WPMEM_PATH . 'wp-members-install.php' );
40
- // Update settings for 3.x
41
  $settings = apply_filters( 'wpmem_settings', wpmem_update_settings() );
42
  }
43
 
@@ -266,58 +265,62 @@ class WP_Members {
266
  *
267
  * @since 3.0.0
268
  *
269
- * @global object $post The WordPress Post object.
270
- *
271
- * @return bool $block true|false
272
  */
273
  function is_blocked() {
274
 
275
  global $post;
276
-
277
- // Backward compatibility for old block/unblock meta.
278
- $meta = get_post_meta( $post->ID, '_wpmem_block', true );
279
- if ( ! $meta ) {
280
- // Check for old meta.
281
- $old_block = get_post_meta( $post->ID, 'block', true );
282
- $old_unblock = get_post_meta( $post->ID, 'unblock', true );
283
- $meta = ( $old_block ) ? 1 : ( ( $old_unblock ) ? 0 : $meta );
284
- }
285
-
286
- // Setup defaults.
287
- $defaults = array(
288
- 'post_id' => $post->ID,
289
- 'post_type' => $post->post_type,
290
- 'block' => ( isset( $this->block[ $post->post_type ] ) && $this->block[ $post->post_type ] == 1 ) ? true : false,
291
- 'block_meta' => $meta, // @todo get_post_meta( $post->ID, '_wpmem_block', true ),
292
- 'block_type' => ( $post->post_type == 'post' ) ? $this->block['post'] : ( ( $post->post_type == 'page' ) ? $this->block['page'] : 0 ),
293
- );
294
-
295
- /**
296
- * Filter the block arguments.
297
- *
298
- * @since 2.9.8
299
- *
300
- * @param array $args Null.
301
- * @param array $defaults Although you are not filtering the defaults, knowing what they are can assist developing more powerful functions.
302
- */
303
- $args = apply_filters( 'wpmem_block_args', '', $defaults );
304
-
305
- // Merge $args with defaults.
306
- $args = ( wp_parse_args( $args, $defaults ) );
307
-
308
- if ( is_single() || is_page() ) {
309
- switch( $args['block_type'] ) {
310
- case 1: // If content is blocked by default.
311
- $args['block'] = ( $args['block_meta'] == '0' ) ? false : $args['block'];
312
- break;
313
- case 0 : // If content is unblocked by default.
314
- $args['block'] = ( $args['block_meta'] == '1' ) ? true : $args['block'];
315
- break;
316
  }
317
- } else {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
318
 
319
- $args['block'] = false;
 
 
320
 
 
 
321
  }
322
 
323
  /**
@@ -395,7 +398,7 @@ class WP_Members {
395
  // Shuts down excerpts on multipage posts if not on first page.
396
  $content = '';
397
 
398
- } elseif ( $this->show_excerpt[ $post->post_type ] == 1 ) {
399
 
400
  if ( ! stristr( $content, '<span id="more' ) ) {
401
  $content = wpmem_do_excerpt( $content );
@@ -411,9 +414,9 @@ class WP_Members {
411
 
412
  }
413
 
414
- $content = ( $this->show_login[ $post->post_type ] == 1 ) ? $content . wpmem_inc_login() : $content . wpmem_inc_login( 'page', '', 'hide' );
415
 
416
- $content = ( $this->show_reg[ $post->post_type ] == 1 ) ? $content . wpmem_inc_registration() : $content;
417
  }
418
 
419
  // Protects comments if expiration module is used and user is expired.
31
  $settings = apply_filters( 'wpmem_settings', get_option( 'wpmembers_settings' ) );
32
 
33
  // Validate that v3 settings are loaded.
34
+ if ( ! isset( $settings['version'] ) || $settings['version'] != WPMEM_VERSION ) {
 
35
  /**
36
  * Load installation routine.
37
  */
38
  require_once( WPMEM_PATH . 'wp-members-install.php' );
39
+ // Update settings.
40
  $settings = apply_filters( 'wpmem_settings', wpmem_update_settings() );
41
  }
42
 
265
  *
266
  * @since 3.0.0
267
  *
268
+ * @global object $post The WordPress Post object.
269
+ * @return bool $block true|false
 
270
  */
271
  function is_blocked() {
272
 
273
  global $post;
274
+
275
+ if ( $post ) {
276
+
277
+ // Backward compatibility for old block/unblock meta.
278
+ $meta = get_post_meta( $post->ID, '_wpmem_block', true );
279
+ if ( ! $meta ) {
280
+ // Check for old meta.
281
+ $old_block = get_post_meta( $post->ID, 'block', true );
282
+ $old_unblock = get_post_meta( $post->ID, 'unblock', true );
283
+ $meta = ( $old_block ) ? 1 : ( ( $old_unblock ) ? 0 : $meta );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
284
  }
285
+
286
+ // Setup defaults.
287
+ $defaults = array(
288
+ 'post_id' => $post->ID,
289
+ 'post_type' => $post->post_type,
290
+ 'block' => ( isset( $this->block[ $post->post_type ] ) && $this->block[ $post->post_type ] == 1 ) ? true : false,
291
+ 'block_meta' => $meta, // @todo get_post_meta( $post->ID, '_wpmem_block', true ),
292
+ 'block_type' => ( isset( $this->block[ $post->post_type ] ) ) ? $this->block[ $post->post_type ] : 0,
293
+ );
294
+
295
+ /**
296
+ * Filter the block arguments.
297
+ *
298
+ * @since 2.9.8
299
+ *
300
+ * @param array $args Null.
301
+ * @param array $defaults Although you are not filtering the defaults, knowing what they are can assist developing more powerful functions.
302
+ */
303
+ $args = apply_filters( 'wpmem_block_args', '', $defaults );
304
+
305
+ // Merge $args with defaults.
306
+ $args = ( wp_parse_args( $args, $defaults ) );
307
+
308
+ if ( is_single() || is_page() ) {
309
+ switch( $args['block_type'] ) {
310
+ case 1: // If content is blocked by default.
311
+ $args['block'] = ( $args['block_meta'] == '0' ) ? false : $args['block'];
312
+ break;
313
+ case 0 : // If content is unblocked by default.
314
+ $args['block'] = ( $args['block_meta'] == '1' ) ? true : $args['block'];
315
+ break;
316
+ }
317
 
318
+ } else {
319
+ $args['block'] = false;
320
+ }
321
 
322
+ } else {
323
+ $args = array( 'block' => false );
324
  }
325
 
326
  /**
398
  // Shuts down excerpts on multipage posts if not on first page.
399
  $content = '';
400
 
401
+ } elseif ( isset( $this->show_excerpt[ $post->post_type ] ) && $this->show_excerpt[ $post->post_type ] == 1 ) {
402
 
403
  if ( ! stristr( $content, '<span id="more' ) ) {
404
  $content = wpmem_do_excerpt( $content );
414
 
415
  }
416
 
417
+ $content = ( isset( $this->show_login[ $post->post_type ] ) && $this->show_login[ $post->post_type ] == 1 ) ? $content . wpmem_inc_login() : $content . wpmem_inc_login( 'page', '', 'hide' );
418
 
419
+ $content = ( isset( $this->show_reg[ $post->post_type ] ) && $this->show_reg[ $post->post_type ] == 1 ) ? $content . wpmem_inc_registration() : $content;
420
  }
421
 
422
  // Protects comments if expiration module is used and user is expired.
inc/core.php CHANGED
@@ -7,12 +7,12 @@
7
  *
8
  * This file is part of the WP-Members plugin by Chad Butler
9
  * You can find out more about this plugin at http://rocketgeek.com
10
- * Copyright (c) 2006-2015 Chad Butler
11
  * WP-Members(tm) is a trademark of butlerblog.com
12
  *
13
  * @package WP-Members
14
  * @author Chad Butler
15
- * @copyright 2006-2015
16
  */
17
 
18
 
7
  *
8
  * This file is part of the WP-Members plugin by Chad Butler
9
  * You can find out more about this plugin at http://rocketgeek.com
10
+ * Copyright (c) 2006-2016 Chad Butler
11
  * WP-Members(tm) is a trademark of butlerblog.com
12
  *
13
  * @package WP-Members
14
  * @author Chad Butler
15
+ * @copyright 2006-2016
16
  */
17
 
18
 
inc/dialogs.php CHANGED
@@ -6,13 +6,12 @@
6
  *
7
  * This file is part of the WP-Members plugin by Chad Butler
8
  * You can find out more about this plugin at http://rocketgeek.com
9
- * Copyright (c) 2006-2015 Chad Butler
10
  * WP-Members(tm) is a trademark of butlerblog.com
11
  *
12
- * @package WordPress
13
- * @subpackage WP-Members
14
  * @author Chad Butler
15
- * @copyright 2006-2015
16
  *
17
  * Functions Included:
18
  * - wpmem_inc_loginfailed
@@ -193,10 +192,44 @@ function wpmem_inc_memberlinks( $page = 'members' ) {
193
  switch ( $page ) {
194
 
195
  case 'members':
196
- $str = '<ul><li><a href="' .$link . 'a=edit">' . __( 'Edit My Information', 'wp-members' ) . '</a></li>
197
- <li><a href="' . $link . 'a=pwdchange">' . __( 'Change Password', 'wp-members' ) . '</a></li>';
198
- if ( defined( 'WPMEM_EXP_MODULE' ) && $wpmem->use_exp == 1 && function_exists( 'wpmem_user_page_detail' ) ) { $str .= wpmem_user_page_detail(); }
199
- $str.= '</ul>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
200
  /**
201
  * Filter the links displayed on the User Profile page (logged in state).
202
  *
@@ -208,11 +241,40 @@ function wpmem_inc_memberlinks( $page = 'members' ) {
208
  break;
209
 
210
  case 'register':
211
- $str = '<p>' . sprintf( __( 'You are logged in as %s', 'wp-members' ), $user_login ) . '</p>
212
- <ul>
213
- <li><a href="' . $logout . '">' . __( 'Click to log out.', 'wp-members' ) . '</a></li>
214
- <li><a href="' . get_option('home') . '">' . __( 'Begin using the site.', 'wp-members' ) . '</a></li>
215
- </ul>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
216
  /**
217
  * Filter the links displayed on the Register page (logged in state).
218
  *
6
  *
7
  * This file is part of the WP-Members plugin by Chad Butler
8
  * You can find out more about this plugin at http://rocketgeek.com
9
+ * Copyright (c) 2006-2016 Chad Butler
10
  * WP-Members(tm) is a trademark of butlerblog.com
11
  *
12
+ * @package WP-Members
 
13
  * @author Chad Butler
14
+ * @copyright 2006-2016
15
  *
16
  * Functions Included:
17
  * - wpmem_inc_loginfailed
192
  switch ( $page ) {
193
 
194
  case 'members':
195
+
196
+ $arr = array(
197
+ 'before_wrapper' => '',
198
+ 'wrapper_before' => '<ul>',
199
+ 'wrapper_after' => '</ul>',
200
+ 'rows' => array(
201
+ '<li><a href="' . $link . 'a=edit">' . __( 'Edit My Information', 'wp-members' ) . '</a></li>',
202
+ '<li><a href="' . $link . 'a=pwdchange">' . __( 'Change Password', 'wp-members' ) . '</a></li>',
203
+ ),
204
+ );
205
+
206
+ if ( defined( 'WPMEM_EXP_MODULE' ) && $wpmem->use_exp == 1 && function_exists( 'wpmem_user_page_detail' ) ) {
207
+ $arr['rows'][] = wpmem_user_page_detail();
208
+ }
209
+
210
+ /**
211
+ * Filter the member links array.
212
+ *
213
+ * @since 3.0.9
214
+ *
215
+ * @param array $arr {
216
+ * The components of the links.
217
+ *
218
+ * @type string $before_wrapper Anything that comes before the wrapper.
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( 'wpmem_member_links_args', $arr );
225
+
226
+ $str = $arr['before_wrapper'];
227
+ $str.= $arr['wrapper_before'];
228
+ foreach ( $arr['rows'] as $row ) {
229
+ $str.= $row;
230
+ }
231
+ $str.= $arr['wrapper_after'];
232
+
233
  /**
234
  * Filter the links displayed on the User Profile page (logged in state).
235
  *
241
  break;
242
 
243
  case 'register':
244
+
245
+ $arr = array(
246
+ 'before_wrapper' => '<p>' . sprintf( __( 'You are logged in as %s', 'wp-members' ), $user_login ) . '</p>',
247
+ 'wrapper_before' => '<ul>',
248
+ 'wrapper_after' => '</ul>',
249
+ 'rows' => array(
250
+ '<li><a href="' . $logout . '">' . __( 'Click to log out.', 'wp-members' ) . '</a></li>',
251
+ '<li><a href="' . get_option('home') . '">' . __( 'Begin using the site.', 'wp-members' ) . '</a></li>',
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.
262
+ *
263
+ * @type string $before_wrapper HTML before the wrapper (default: login status).
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( 'wpmem_register_links_args', $arr );
270
+
271
+ $str = $arr['before_wrapper'];
272
+ $str.= $arr['wrapper_before'];
273
+ foreach ( $arr['rows'] as $row ) {
274
+ $str.= $row;
275
+ }
276
+ $str.= $arr['wrapper_after'];
277
+
278
  /**
279
  * Filter the links displayed on the Register page (logged in state).
280
  *
inc/email.php CHANGED
@@ -6,13 +6,13 @@
6
  *
7
  * This file is part of the WP-Members plugin by Chad Butler
8
  * You can find out more about this plugin at http://rocketgeek.com
9
- * Copyright (c) 2006-2015 Chad Butler
10
  * WP-Members(tm) is a trademark of butlerblog.com
11
  *
12
- * @package WordPress
13
- * @subpackage WP-Members
14
  * @author Chad Butler
15
- * @copyright 2006-2015
16
  *
17
  * Functions Included:
18
  * - wpmem_inc_regemail
@@ -30,11 +30,14 @@ if ( ! function_exists( 'wpmem_inc_regemail' ) ):
30
  *
31
  * @uses wp_mail
32
  *
33
- * @param int $user_ID The User's ID.
34
- * @param string $password Password from the registration process.
35
- * @param string $toggle Toggle indicating the email being sent (newreg|newmod|appmod|repass).
36
- * @param array $wpmem_fields Array of the WP-Members fields (defaults to null).
37
- * @param array $fields Array of the registration data (defaults to null).
 
 
 
38
  */
39
  function wpmem_inc_regemail( $user_id, $password, $toggle, $wpmem_fields = null, $field_data = null ) {
40
 
@@ -200,8 +203,10 @@ function wpmem_inc_regemail( $user_id, $password, $toggle, $wpmem_fields = null,
200
  '[blogname]',
201
  '[username]',
202
  '[password]',
 
203
  '[reglink]',
204
  '[members-area]',
 
205
  '[exp-type]',
206
  '[exp-data]',
207
  );
@@ -211,8 +216,10 @@ function wpmem_inc_regemail( $user_id, $password, $toggle, $wpmem_fields = null,
211
  $arr['blogname'],
212
  $arr['user_login'],
213
  $password,
 
214
  $arr['reg_link'],
215
  $arr['wpmem_msurl'],
 
216
  $arr['exp_type'],
217
  $arr['exp_date'],
218
  );
@@ -220,7 +227,7 @@ function wpmem_inc_regemail( $user_id, $password, $toggle, $wpmem_fields = null,
220
  // Setup custom field shortcodes.
221
  foreach ( $wpmem_fields as $field ) {
222
  $shortcd[] = '[' . $field[2] . ']';
223
- $replace[] = get_user_meta( $user_id, $field[2], true );
224
  }
225
 
226
  // Do replacements for subject, body, and footer shortcodes.
@@ -251,9 +258,12 @@ if ( ! function_exists( 'wpmem_notify_admin' ) ):
251
  *
252
  * @uses wp_mail
253
  *
254
- * @param int $user_id
255
- * @param array $wpmem_fields
256
- * @param array $field_data
 
 
 
257
  */
258
  function wpmem_notify_admin( $user_id, $wpmem_fields, $field_data = null ) {
259
 
@@ -283,7 +293,7 @@ function wpmem_notify_admin( $user_id, $wpmem_fields, $field_data = null ) {
283
  $arr['user_login'] = stripslashes( $user->user_login );
284
  $arr['user_email'] = stripslashes( $user->user_email );
285
  $arr['blogname'] = wp_specialchars_decode( get_option ( 'blogname' ), ENT_QUOTES );
286
- $arr['user_ip'] = get_user_meta( $user_id, 'wpmem_reg_ip', true );
287
  $arr['reg_link'] = esc_url( get_user_meta( $user_id, 'wpmem_reg_url', true ) );
288
  $arr['act_link'] = get_bloginfo ( 'wpurl' ) . "/wp-admin/user-edit.php?user_id=".$user_id;
289
  $arr['exp_type'] = ( defined( 'WPMEM_EXP_MODULE' ) && $wpmem->use_exp == 1 ) ? get_user_meta( $user_id, 'exp_type', true ) : '';
@@ -304,7 +314,7 @@ function wpmem_notify_admin( $user_id, $wpmem_fields, $field_data = null ) {
304
  } elseif ( in_array( $meta[2], $wp_user_fields ) ) {
305
  $val = esc_html( $user->$meta[2] );
306
  } else {
307
- $val = esc_html( get_user_meta( $user_id, $meta[2], true ) );
308
  }
309
  $field_arr[ $name ] = $val;
310
  }
@@ -319,19 +329,12 @@ function wpmem_notify_admin( $user_id, $wpmem_fields, $field_data = null ) {
319
  add_filter( 'wp_mail_from_name', 'wpmem_mail_from_name' );
320
  $default_header = ( $wpmem_mail_from && $wpmem_mail_from_name ) ? 'From: ' . $wpmem_mail_from_name . ' <' . $wpmem_mail_from . '>' : '';
321
 
322
- /**
323
- * Filters the email headers.
324
- *
325
- * @since 2.7.4
326
- *
327
- * @param mixed $default_header The email headers (default = null).
328
- * @param string $toggle Toggle to determine what email is being generated (newreg|newmod|appmod|repass|admin).
329
- */
330
  $arr['headers'] = apply_filters( 'wpmem_email_headers', $default_header, 'admin' );
331
 
332
  // Handle backward compatibility for customizations that may call the email function directly.
333
  if ( ! $wpmem_fields ) {
334
- $wpmem_fields = $wpmem->fields; //get_option( 'wpmembers_fields' );
335
  }
336
 
337
  /**
@@ -404,7 +407,7 @@ function wpmem_notify_admin( $user_id, $wpmem_fields, $field_data = null ) {
404
  // Create the custom field shortcodes.
405
  foreach ( $wpmem_fields as $field ) {
406
  $shortcd[] = '[' . $field[2] . ']';
407
- $replace[] = get_user_meta( $user_id, $field[2], true );
408
  }
409
 
410
  // Get the subject, body, and footer shortcodes.
@@ -461,4 +464,4 @@ function wpmem_mail_from_name( $name ) {
461
  return $wpmem_mail_from_name;
462
  }
463
 
464
- /** End of File **/
6
  *
7
  * This file is part of the WP-Members plugin by Chad Butler
8
  * You can find out more about this plugin at http://rocketgeek.com
9
+ * Copyright (c) 2006-2016 Chad Butler
10
  * WP-Members(tm) is a trademark of butlerblog.com
11
  *
12
+ * @package WP-Members
13
+ * @subpackage WP-Members Email Functions
14
  * @author Chad Butler
15
+ * @copyright 2006-2016
16
  *
17
  * Functions Included:
18
  * - wpmem_inc_regemail
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 int $user_ID The User's ID.
37
+ * @param string $password Password from the registration process.
38
+ * @param string $toggle Toggle indicating the email being sent (newreg|newmod|appmod|repass).
39
+ * @param array $wpmem_fields Array of the WP-Members fields (defaults to null).
40
+ * @param array $fields Array of the registration data (defaults to null).
41
  */
42
  function wpmem_inc_regemail( $user_id, $password, $toggle, $wpmem_fields = null, $field_data = null ) {
43
 
203
  '[blogname]',
204
  '[username]',
205
  '[password]',
206
+ '[email]',
207
  '[reglink]',
208
  '[members-area]',
209
+ '[user-profile]',
210
  '[exp-type]',
211
  '[exp-data]',
212
  );
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
  );
227
  // Setup custom field shortcodes.
228
  foreach ( $wpmem_fields as $field ) {
229
  $shortcd[] = '[' . $field[2] . ']';
230
+ $replace[] = ( is_array( $field_data ) && 'y' == $field[4] ) ? $field_data[ $field[2] ] : get_user_meta( $user_id, $field[2], true );
231
  }
232
 
233
  // Do replacements for subject, body, and footer shortcodes.
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 int $user_ID The User's ID.
265
+ * @param array $wpmem_fields Array of the WP-Members fields (defaults to null).
266
+ * @param array $fields Array of the registration data (defaults to null).
267
  */
268
  function wpmem_notify_admin( $user_id, $wpmem_fields, $field_data = null ) {
269
 
293
  $arr['user_login'] = stripslashes( $user->user_login );
294
  $arr['user_email'] = stripslashes( $user->user_email );
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'] = get_bloginfo ( 'wpurl' ) . "/wp-admin/user-edit.php?user_id=".$user_id;
299
  $arr['exp_type'] = ( defined( 'WPMEM_EXP_MODULE' ) && $wpmem->use_exp == 1 ) ? get_user_meta( $user_id, 'exp_type', true ) : '';
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[ $name ] = $val;
320
  }
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' );
334
 
335
  // Handle backward compatibility for customizations that may call the email function directly.
336
  if ( ! $wpmem_fields ) {
337
+ $wpmem_fields = $wpmem->fields;
338
  }
339
 
340
  /**
407
  // Create the custom field shortcodes.
408
  foreach ( $wpmem_fields as $field ) {
409
  $shortcd[] = '[' . $field[2] . ']';
410
+ $replace[] = ( is_array( $field_data ) && 'y' == $field[4] ) ? $field_data[ $field[2] ] : get_user_meta( $user_id, $field[2], true );
411
  }
412
 
413
  // Get the subject, body, and footer shortcodes.
464
  return $wpmem_mail_from_name;
465
  }
466
 
467
+ // End of file.
inc/forms.php CHANGED
@@ -6,13 +6,13 @@
6
  *
7
  * This file is part of the WP-Members plugin by Chad Butler
8
  * You can find out more about this plugin at http://rocketgeek.com
9
- * Copyright (c) 2006-2015 Chad Butler
10
  * WP-Members(tm) is a trademark of butlerblog.com
11
  *
12
- * @package WordPress
13
- * @subpackage WP-Members
14
  * @author Chad Butler
15
- * @copyright 2006-2015
16
  *
17
  * Functions Included:
18
  * - wpmem_inc_login
@@ -22,6 +22,7 @@
22
  * - wpmem_inc_registration
23
  * - wpmem_inc_recaptcha
24
  * - wpmem_inc_attribution
 
25
  */
26
 
27
 
@@ -412,7 +413,7 @@ function wpmem_login_form( $page, $arr ) {
412
  if ( ( $wpmem->user_pages['profile'] != null || $page == 'members' ) && $arr['action'] == 'login' ) {
413
 
414
  /**
415
- * Filter the forgot password link.
416
  *
417
  * @since 2.8.0
418
  *
@@ -420,14 +421,23 @@ function wpmem_login_form( $page, $arr ) {
420
  */
421
  $link = apply_filters( 'wpmem_forgot_link', wpmem_chk_qstr( $wpmem->user_pages['profile'] ) . 'a=pwdreset' );
422
  $str = __( 'Forgot password?', 'wp-members' ) . '&nbsp;<a href="' . $link . '">' . __( 'Click here to reset', 'wp-members' ) . '</a>';
423
- $form = $form . $args['link_before'] . apply_filters( 'wpmem_forgot_link_str', $str ) . $args['link_after'] . $args['n'];
 
 
 
 
 
 
 
 
 
424
 
425
  }
426
 
427
  if ( ( $wpmem->user_pages['register'] != null ) && $arr['action'] == 'login' ) {
428
 
429
  /**
430
- * Filter the link to the registration page.
431
  *
432
  * @since 2.8.0
433
  *
@@ -435,9 +445,41 @@ function wpmem_login_form( $page, $arr ) {
435
  */
436
  $link = apply_filters( 'wpmem_reg_link', $wpmem->user_pages['register'] );
437
  $str = __( 'New User?', 'wp-members' ) . '&nbsp;<a href="' . $link . '">' . __( 'Click here to register', 'wp-members' ) . '</a>';
438
- $form = $form . $args['link_before'] . apply_filters( 'wpmem_reg_link_str', $str ) . $args['link_after'] . $args['n'];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
439
 
440
- }
441
 
442
  // Apply the heading.
443
  $form = $args['heading_before'] . $arr['heading'] . $args['heading_after'] . $args['n'] . $form;
@@ -587,9 +629,10 @@ function wpmem_inc_registration( $toggle = 'new', $heading = '', $redirect_to =
587
  // Add the username row to the array.
588
  $rows['username'] = array(
589
  'order' => 0,
590
- 'meta' => 'username',
591
- 'type' => 'text',
592
- 'value' => $val,
 
593
  'row_before' => $args['row_before'],
594
  'label' => $label,
595
  'field_before' => $field_before,
@@ -740,9 +783,10 @@ function wpmem_inc_registration( $toggle = 'new', $heading = '', $redirect_to =
740
  if ( $field[4] == 'y' ) {
741
  $rows[$field[2]] = array(
742
  'order' => $field[0],
743
- 'meta' => $field[2],
744
- 'type' => $field[3],
745
- 'value' => $val,
 
746
  'row_before' => $args['row_before'],
747
  'label' => $label,
748
  'field_before' => $field_before,
@@ -760,7 +804,8 @@ function wpmem_inc_registration( $toggle = 'new', $heading = '', $redirect_to =
760
  'order' => '',
761
  'meta' => '',
762
  'type' => 'text',
763
- 'value' => '',
 
764
  'row_before' => $args['row_before'],
765
  'label' => $row['label'],
766
  'field_before' => ( $args['wrap_inputs'] ) ? '<div class="div_text">' : '',
@@ -779,7 +824,21 @@ function wpmem_inc_registration( $toggle = 'new', $heading = '', $redirect_to =
779
  *
780
  * @since 2.9.0
781
  *
782
- * @param array $rows An array containing the form rows.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
783
  * @param string $toggle Toggle new registration or profile update. new|edit.
784
  */
785
  $rows = apply_filters( 'wpmem_register_form_rows', $rows, $toggle );
@@ -908,7 +967,21 @@ function wpmem_inc_registration( $toggle = 'new', $heading = '', $redirect_to =
908
  *
909
  * @param string $form The HTML of the final generated form.
910
  * @param string $toggle Toggle new registration or profile update. new|edit.
911
- * @param array $rows The rows array
 
 
 
 
 
 
 
 
 
 
 
 
 
 
912
  * @param string $hidden The HTML string of hidden fields
913
  */
914
  $form = apply_filters( 'wpmem_register_form', $form, $toggle, $rows, $hidden );
@@ -939,12 +1012,13 @@ if ( ! function_exists( 'wpmem_inc_recaptcha' ) ):
939
  * @since 2.6.0
940
  *
941
  * @param array $arr
942
- * @return string $str
943
  */
944
  function wpmem_inc_recaptcha( $arr ) {
945
 
946
  // Determine if reCAPTCHA should be another language.
947
  $allowed_langs = array( 'nl', 'fr', 'de', 'pt', 'ru', 'es', 'tr' );
 
948
  $locale = apply_filters( 'plugin_locale', get_locale(), 'wp-members' );
949
  $compare_lang = strtolower( substr( $locale, -2 ) );
950
  $use_the_lang = ( in_array( $compare_lang, $allowed_langs ) ) ? $compare_lang : false;
@@ -1010,7 +1084,13 @@ function wpmem_inc_attribution() {
1010
  *
1011
  * @since 2.9.5
1012
  *
1013
- * @return array Form elements for Really Simple CAPTCHA.
 
 
 
 
 
 
1014
  */
1015
  function wpmem_build_rs_captcha() {
1016
 
@@ -1066,8 +1146,9 @@ function wpmem_build_rs_captcha() {
1066
  $pre = $wpmem_captcha_prefix;
1067
 
1068
  return array(
1069
- 'label' => '<label class="text" for="captcha">' . __( 'Input the code:', 'wp-members' ) . '</label>',
1070
- 'field' => '<input id="captcha_code" name="captcha_code" size="'.$size.'" type="text" />
 
1071
  <input id="captcha_prefix" name="captcha_prefix" type="hidden" value="' . $pre . '" />
1072
  <img src="'.$src.'" alt="captcha" width="'.$img_w.'" height="'.$img_h.'" />'
1073
  );
6
  *
7
  * This file is part of the WP-Members plugin by Chad Butler
8
  * You can find out more about this plugin at http://rocketgeek.com
9
+ * Copyright (c) 2006-2016 Chad Butler
10
  * WP-Members(tm) is a trademark of butlerblog.com
11
  *
12
+ * @package WP-Members
13
+ * @subpackage WP-Members Form Building Functions
14
  * @author Chad Butler
15
+ * @copyright 2006-2016
16
  *
17
  * Functions Included:
18
  * - wpmem_inc_login
22
  * - wpmem_inc_registration
23
  * - wpmem_inc_recaptcha
24
  * - wpmem_inc_attribution
25
+ * - wpmem_build_rs_captcha
26
  */
27
 
28
 
413
  if ( ( $wpmem->user_pages['profile'] != null || $page == 'members' ) && $arr['action'] == 'login' ) {
414
 
415
  /**
416
+ * Filters the forgot password link.
417
  *
418
  * @since 2.8.0
419
  *
421
  */
422
  $link = apply_filters( 'wpmem_forgot_link', wpmem_chk_qstr( $wpmem->user_pages['profile'] ) . 'a=pwdreset' );
423
  $str = __( 'Forgot password?', 'wp-members' ) . '&nbsp;<a href="' . $link . '">' . __( 'Click here to reset', 'wp-members' ) . '</a>';
424
+ /**
425
+ * Filters the forgot password HTML.
426
+ *
427
+ * @since 2.9.0
428
+ * @since 3.0.9 Added $link parameter.
429
+ *
430
+ * @param string $str The forgot password link HTML.
431
+ * @param string $link The forgot password link.
432
+ */
433
+ $form = $form . $args['link_before'] . apply_filters( 'wpmem_forgot_link_str', $str, $link ) . $args['link_after'] . $args['n'];
434
 
435
  }
436
 
437
  if ( ( $wpmem->user_pages['register'] != null ) && $arr['action'] == 'login' ) {
438
 
439
  /**
440
+ * Filters the link to the registration page.
441
  *
442
  * @since 2.8.0
443
  *
445
  */
446
  $link = apply_filters( 'wpmem_reg_link', $wpmem->user_pages['register'] );
447
  $str = __( 'New User?', 'wp-members' ) . '&nbsp;<a href="' . $link . '">' . __( 'Click here to register', 'wp-members' ) . '</a>';
448
+ /**
449
+ * Filters the register link HTML.
450
+ *
451
+ * @since 2.9.0
452
+ * @since 3.0.9 Added $link parameter.
453
+ *
454
+ * @param string $str The register link HTML.
455
+ * @param string $link The register link.
456
+ */
457
+ $form = $form . $args['link_before'] . apply_filters( 'wpmem_reg_link_str', $str, $link ) . $args['link_after'] . $args['n'];
458
+
459
+ }
460
+
461
+ if ( ( $wpmem->user_pages['profile'] != null || $page == 'members' ) && $arr['action'] == 'pwdreset' ) {
462
+
463
+ /**
464
+ * Filters the forgot username link.
465
+ *
466
+ * @since 3.0.9
467
+ *
468
+ * @param string The forgot username link.
469
+ */
470
+ $link = apply_filters( 'wpmem_username_link', wpmem_chk_qstr( $wpmem->user_pages['profile'] ) . 'a=getusername' );
471
+ $str = __( 'Forgot username?', 'wp-members' ) . '&nbsp;<a href="' . $link . '">' . __( 'Click here', 'wp-members' ) . '</a>';
472
+ /**
473
+ * Filters the forgot username link HTML.
474
+ *
475
+ * @since 3.0.9
476
+ *
477
+ * @param string $str The forgot username link HTML.
478
+ * @param string $link The forgot username link.
479
+ */
480
+ $form = $form . $args['link_before'] . apply_filters( 'wpmem_username_link_str', $str, $link ) . $args['link_after'] . $args['n'];
481
 
482
+ }
483
 
484
  // Apply the heading.
485
  $form = $args['heading_before'] . $arr['heading'] . $args['heading_after'] . $args['n'] . $form;
629
  // Add the username row to the array.
630
  $rows['username'] = array(
631
  'order' => 0,
632
+ 'meta' => 'username',
633
+ 'type' => 'text',
634
+ 'value' => $val,
635
+ 'label_text' => __( 'Choose a Username', 'wp-members' ),
636
  'row_before' => $args['row_before'],
637
  'label' => $label,
638
  'field_before' => $field_before,
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,
792
  'field_before' => $field_before,
804
  'order' => '',
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' => ( $args['wrap_inputs'] ) ? '<div class="div_text">' : '',
824
  *
825
  * @since 2.9.0
826
  *
827
+ * @param array $rows {
828
+ * An array containing the form rows.
829
+ *
830
+ * @type string order Field display order.
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.
837
+ * @type string field_before Opening wrapper tag before the input tag.
838
+ * @type string field The field input tag.
839
+ * @type string field_after Closing wrapper tag around the input tag.
840
+ * @type string row_after Closing wrapper tag around the row.
841
+ * }
842
  * @param string $toggle Toggle new registration or profile update. new|edit.
843
  */
844
  $rows = apply_filters( 'wpmem_register_form_rows', $rows, $toggle );
967
  *
968
  * @param string $form The HTML of the final generated form.
969
  * @param string $toggle Toggle new registration or profile update. new|edit.
970
+ * @param array $rows {
971
+ * An array containing the form rows.
972
+ *
973
+ * @type string order Field display order.
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.
980
+ * @type string field_before Opening wrapper tag before the input tag.
981
+ * @type string field The field input tag.
982
+ * @type string field_after Closing wrapper tag around the input tag.
983
+ * @type string row_after Closing wrapper tag around the row.
984
+ * }
985
  * @param string $hidden The HTML string of hidden fields
986
  */
987
  $form = apply_filters( 'wpmem_register_form', $form, $toggle, $rows, $hidden );
1012
  * @since 2.6.0
1013
  *
1014
  * @param array $arr
1015
+ * @return string $str HTML for reCAPTCHA display.
1016
  */
1017
  function wpmem_inc_recaptcha( $arr ) {
1018
 
1019
  // Determine if reCAPTCHA should be another language.
1020
  $allowed_langs = array( 'nl', 'fr', 'de', 'pt', 'ru', 'es', 'tr' );
1021
+ /** This filter is documented in wp-includes/l10n.php */
1022
  $locale = apply_filters( 'plugin_locale', get_locale(), 'wp-members' );
1023
  $compare_lang = strtolower( substr( $locale, -2 ) );
1024
  $use_the_lang = ( in_array( $compare_lang, $allowed_langs ) ) ? $compare_lang : false;
1084
  *
1085
  * @since 2.9.5
1086
  *
1087
+ * @return array {
1088
+ * HTML Form elements for Really Simple CAPTCHA.
1089
+ *
1090
+ * @type string label_text The raw text used for the label.
1091
+ * @type string label The HTML for the label.
1092
+ * @type string field The input tag and the CAPTCHA image.
1093
+ * }
1094
  */
1095
  function wpmem_build_rs_captcha() {
1096
 
1146
  $pre = $wpmem_captcha_prefix;
1147
 
1148
  return array(
1149
+ 'label_text' => __( 'Input the code:', 'wp-members' ),
1150
+ 'label' => '<label class="text" for="captcha">' . __( 'Input the code:', 'wp-members' ) . '</label>',
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.'" />'
1154
  );
inc/register.php CHANGED
@@ -6,13 +6,13 @@
6
  *
7
  * This file is part of the WP-Members plugin by Chad Butler
8
  * You can find out more about this plugin at http://rocketgeek.com
9
- * Copyright (c) 2006-2015 Chad Butler
10
  * WP-Members(tm) is a trademark of butlerblog.com
11
  *
12
- * @package WordPress
13
- * @subpackage WP-Members
14
  * @author Chad Butler
15
- * @copyright 2006-2015
16
  *
17
  * Functions Included:
18
  * - wpmem_registration
@@ -333,7 +333,7 @@ function wpmem_registration( $toggle ) {
333
 
334
  // Notify admin of new reg, if needed.
335
  if ( $wpmem->notify == 1 ) {
336
- wpmem_notify_admin( $fields['ID'], $wpmem_fields );
337
  }
338
 
339
  /**
@@ -379,14 +379,7 @@ function wpmem_registration( $toggle ) {
379
  // Add the user_ID to the fields array.
380
  $fields['ID'] = $user_ID;
381
 
382
- /**
383
- * Filter registration data after validation before data insertion.
384
- *
385
- * @since 2.8.2
386
- *
387
- * @param array $fields An array of the registration field data.
388
- * @param string $toggle A switch to indicate the action (new|edit).
389
- */
390
  $fields = apply_filters( 'wpmem_register_data', $fields, 'edit' );
391
 
392
  /**
@@ -521,4 +514,4 @@ function wpmem_get_captcha_err( $wpmem_captcha_err ) {
521
  }
522
  endif;
523
 
524
- /** End of File **/
6
  *
7
  * This file is part of the WP-Members plugin by Chad Butler
8
  * You can find out more about this plugin at http://rocketgeek.com
9
+ * Copyright (c) 2006-2016 Chad Butler
10
  * WP-Members(tm) is a trademark of butlerblog.com
11
  *
12
+ * @package WP-Members
13
+ * @subpackage WP-Members Registration Functions
14
  * @author Chad Butler
15
+ * @copyright 2006-2016
16
  *
17
  * Functions Included:
18
  * - wpmem_registration
333
 
334
  // Notify admin of new reg, if needed.
335
  if ( $wpmem->notify == 1 ) {
336
+ wpmem_notify_admin( $fields['ID'], $wpmem_fields, $fields );
337
  }
338
 
339
  /**
379
  // Add the user_ID to the fields array.
380
  $fields['ID'] = $user_ID;
381
 
382
+ /** This filter is documented in register.php */
 
 
 
 
 
 
 
383
  $fields = apply_filters( 'wpmem_register_data', $fields, 'edit' );
384
 
385
  /**
514
  }
515
  endif;
516
 
517
+ // End of file.
inc/shortcodes.php CHANGED
@@ -6,13 +6,13 @@
6
  *
7
  * This file is part of the WP-Members plugin by Chad Butler
8
  * You can find out more about this plugin at http://rocketgeek.com
9
- * Copyright (c) 2006-2015 Chad Butler
10
  * WP-Members(tm) is a trademark of butlerblog.com
11
  *
12
  * @package WP-Members
13
  * @subpackage WP-Members Shortcodes
14
  * @author Chad Butler
15
- * @copyright 2006-2015
16
  *
17
  * Functions Included:
18
  * - wpmem_sc_forms
6
  *
7
  * This file is part of the WP-Members plugin by Chad Butler
8
  * You can find out more about this plugin at http://rocketgeek.com
9
+ * Copyright (c) 2006-2016 Chad Butler
10
  * WP-Members(tm) is a trademark of butlerblog.com
11
  *
12
  * @package WP-Members
13
  * @subpackage WP-Members Shortcodes
14
  * @author Chad Butler
15
+ * @copyright 2006-2016
16
  *
17
  * Functions Included:
18
  * - wpmem_sc_forms
inc/sidebar.php CHANGED
@@ -6,13 +6,12 @@
6
  *
7
  * This file is part of the WP-Members plugin by Chad Butler
8
  * You can find out more about this plugin at http://rocketgeek.com
9
- * Copyright (c) 2006-2015 Chad Butler
10
  * WP-Members(tm) is a trademark of butlerblog.com
11
  *
12
- * @package WordPress
13
- * @subpackage WP-Members
14
  * @author Chad Butler
15
- * @copyright 2006-2015
16
  *
17
  * Functions Included:
18
  * - wpmem_inc_status
@@ -27,20 +26,14 @@ if ( ! function_exists( 'wpmem_inc_status' ) ):
27
  *
28
  * @since 1.8
29
  *
30
- * @global $user_login
31
  * @return string $status
32
  */
33
  function wpmem_inc_status() {
34
 
35
  global $user_login;
36
 
37
- /**
38
- * Filter the logout link.
39
- *
40
- * @since 2.8.3
41
- *
42
- * @param string The logout link.
43
- */
44
  $logout = apply_filters( 'wpmem_logout_link', $url . '/?a=logout' );
45
 
46
  $status = '<p>' . sprintf( __( 'You are logged in as %s', 'wp-members' ), $user_login )
@@ -161,31 +154,38 @@ function wpmem_do_sidebar( $post_to = null ) {
161
  */
162
  $form = $form . apply_filters( 'wpmem_sb_hidden_fields', $hidden );
163
 
164
-
165
  $buttons = '<input type="submit" name="Submit" class="buttons" value="' . __( 'log in', 'wp-members' ) . '" />';
166
 
167
  if ( $wpmem->user_pages['profile'] != null ) {
 
 
 
168
  /**
169
- * Filter the sidebar forgot password link.
170
  *
171
- * @since 2.8.0
172
  *
173
- * @param string The forgot password link.
 
174
  */
175
- $link = apply_filters( 'wpmem_forgot_link', wpmem_chk_qstr( $wpmem->user_pages['profile'] ) . 'a=pwdreset' );
176
- $buttons.= ' <a href="' . $link . '">' . __( 'Forgot?', 'wp-members' ) . '</a>&nbsp;';
177
  }
178
 
179
  if ( $wpmem->user_pages['register'] != null ) {
 
 
 
180
  /**
181
  * Filter the sidebar register link.
182
  *
183
- * @since 2.8.0
184
  *
185
- * @param string The register link.
 
186
  */
187
- $link = apply_filters( 'wpmem_reg_link', $wpmem->user_pages['register'] );
188
- $buttons.= ' <a href="' . $link . '">' . __( 'Register' ) . '</a>';
189
  }
190
 
191
  $form = $form . $args['n'] . $args['buttons_before'] . $buttons . $args['n'] . $args['buttons_after'];
@@ -203,7 +203,7 @@ function wpmem_do_sidebar( $post_to = null ) {
203
  /**
204
  * Filter the sidebar form.
205
  *
206
- * @since ?.?
207
  *
208
  * @param string $form The HTML for the sidebar login form.
209
  */
@@ -216,7 +216,7 @@ function wpmem_do_sidebar( $post_to = null ) {
216
  /**
217
  * Filter the sidebar login failed message.
218
  *
219
- * @since ?.?
220
  *
221
  * @param string $error_msg The error message.
222
  */
@@ -230,13 +230,7 @@ function wpmem_do_sidebar( $post_to = null ) {
230
 
231
  global $user_login;
232
 
233
- /**
234
- * Filter the sidebar logout link.
235
- *
236
- * @since ?.?
237
- *
238
- * @param string The logout link.
239
- */
240
  $logout = apply_filters( 'wpmem_logout_link', $url . '/?a=logout' );
241
 
242
  $str = '<p>' . sprintf( __( 'You are logged in as %s', 'wp-members' ), $user_login ) . '<br />
@@ -245,7 +239,7 @@ function wpmem_do_sidebar( $post_to = null ) {
245
  /**
246
  * Filter the sidebar user login status.
247
  *
248
- * @since ?.?
249
  *
250
  * @param string $str The login status for the user.
251
  */
@@ -256,4 +250,4 @@ function wpmem_do_sidebar( $post_to = null ) {
256
  }
257
  endif;
258
 
259
- /** End of File **/
6
  *
7
  * This file is part of the WP-Members plugin by Chad Butler
8
  * You can find out more about this plugin at http://rocketgeek.com
9
+ * Copyright (c) 2006-2016 Chad Butler
10
  * WP-Members(tm) is a trademark of butlerblog.com
11
  *
12
+ * @package WP-Members
 
13
  * @author Chad Butler
14
+ * @copyright 2006-2016
15
  *
16
  * Functions Included:
17
  * - wpmem_inc_status
26
  *
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( __( 'You are logged in as %s', 'wp-members' ), $user_login )
154
  */
155
  $form = $form . apply_filters( 'wpmem_sb_hidden_fields', $hidden );
156
 
 
157
  $buttons = '<input type="submit" name="Submit" class="buttons" value="' . __( 'log in', 'wp-members' ) . '" />';
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', wpmem_chk_qstr( $wpmem->user_pages['profile'] ) . 'a=pwdreset' );
162
+ $link_html = ' <a href="' . $link . '">' . __( 'Forgot?', 'wp-members' ) . '</a>&nbsp;';
163
  /**
164
+ * Filter the sidebar forgot password.
165
  *
166
+ * @since 3.0.9
167
  *
168
+ * @param string $link_html
169
+ * @param string $link
170
  */
171
+ $link_html = apply_filters( 'wpmem_sb_forgot_link_str', $link_html, $link );
172
+ $buttons.= $link_html;
173
  }
174
 
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 . '">' . __( 'Register' ) . '</a>';
179
  /**
180
  * Filter the sidebar register link.
181
  *
182
+ * @since 3.0.9
183
  *
184
+ * @param string $link_html
185
+ * @param string $link
186
  */
187
+ $link_html = apply_filters( 'wpmem_sb_reg_link_str', $link_html, $link );
188
+ $buttons.= $link_html;
189
  }
190
 
191
  $form = $form . $args['n'] . $args['buttons_before'] . $buttons . $args['n'] . $args['buttons_after'];
203
  /**
204
  * Filter the sidebar form.
205
  *
206
+ * @since unknown
207
  *
208
  * @param string $form The HTML for the sidebar login form.
209
  */
216
  /**
217
  * Filter the sidebar login failed message.
218
  *
219
+ * @since unknown
220
  *
221
  * @param string $error_msg The error message.
222
  */
230
 
231
  global $user_login;
232
 
233
+ /** This filter is documented in wp-members/inc/dialogs.php */
 
 
 
 
 
 
234
  $logout = apply_filters( 'wpmem_logout_link', $url . '/?a=logout' );
235
 
236
  $str = '<p>' . sprintf( __( 'You are logged in as %s', 'wp-members' ), $user_login ) . '<br />
239
  /**
240
  * Filter the sidebar user login status.
241
  *
242
+ * @since unknown
243
  *
244
  * @param string $str The login status for the user.
245
  */
250
  }
251
  endif;
252
 
253
+ // End of file.
inc/users.php CHANGED
@@ -7,13 +7,12 @@
7
  *
8
  * This file is part of the WP-Members plugin by Chad Butler
9
  * You can find out more about this plugin at http://rocketgeek.com
10
- * Copyright (c) 2006-2015 Chad Butler
11
  * WP-Members(tm) is a trademark of butlerblog.com
12
  *
13
- * @package WordPress
14
- * @subpackage WP-Members
15
  * @author Chad Butler
16
- * @copyright 2006-2015
17
  */
18
 
19
 
@@ -129,4 +128,4 @@ function wpmem_profile_update() {
129
  }
130
  }
131
 
132
- /** End of File **/
7
  *
8
  * This file is part of the WP-Members plugin by Chad Butler
9
  * You can find out more about this plugin at http://rocketgeek.com
10
+ * Copyright (c) 2006-2016 Chad Butler
11
  * WP-Members(tm) is a trademark of butlerblog.com
12
  *
13
+ * @package WP-Members
 
14
  * @author Chad Butler
15
+ * @copyright 2006-2016
16
  */
17
 
18
 
128
  }
129
  }
130
 
131
+ // End of file.
inc/utilities.php CHANGED
@@ -7,13 +7,13 @@
7
  *
8
  * This file is part of the WP-Members plugin by Chad Butler
9
  * You can find out more about this plugin at http://rocketgeek.com
10
- * Copyright (c) 2006-2015 Chad Butler
11
  * WP-Members(tm) is a trademark of butlerblog.com
12
  *
13
  * @package WP-Members
14
  * @subpackage WP-Members Utility Functions
15
  * @author Chad Butler
16
- * @copyright 2006-2015
17
  *
18
  * Functions included:
19
  * - wpmem_create_formfield
@@ -26,6 +26,7 @@
26
  * - wpmem_test_shortcode
27
  * - wpmem_get_excluded_meta
28
  * - wpmem_use_ssl
 
29
  */
30
 
31
 
@@ -109,7 +110,7 @@ if ( ! function_exists( 'wpmem_selected' ) ):
109
  * @param string $type
110
  * @return string $issame
111
  */
112
- function wpmem_selected( $value, $valtochk, $type=null ) {
113
  $issame = ( $type == 'select' ) ? ' selected' : ' checked';
114
  return ( $value == $valtochk ) ? $issame : '';
115
  }
@@ -208,64 +209,164 @@ if ( ! function_exists( 'wpmem_do_excerpt' ) ):
208
  *
209
  * @since 2.6
210
  *
211
- * @global object $wpmem The WP_Members object.
 
212
  *
213
  * @param string $content
214
  * @return string $content
215
  */
216
  function wpmem_do_excerpt( $content ) {
217
 
218
- global $wpmem;
219
 
220
- $arr = $wpmem->autoex; // get_option( 'wpmembers_autoex' );
221
 
222
  // Is there already a 'more' link in the content?
223
  $has_more_link = ( stristr( $content, 'class="more-link"' ) ) ? true : false;
224
 
225
  // If auto_ex is on.
226
- if ( $arr['auto_ex'] == true ) {
227
 
228
  // Build an excerpt if one does not exist.
229
  if ( ! $has_more_link ) {
230
-
231
- $words = explode( ' ', $content, ( $arr['auto_ex_len'] + 1 ) );
232
- if ( count( $words ) > $arr['auto_ex_len'] ) {
233
- array_pop( $words );
 
 
 
 
 
 
234
  }
235
- $content = implode( ' ', $words );
236
-
237
- // Check for common html tags.
238
- $common_tags = array( 'i', 'b', 'strong', 'em', 'h1', 'h2', 'h3', 'h4', 'h5' );
239
- foreach ( $common_tags as $tag ) {
240
- if ( stristr( $content, '<' . $tag . '>' ) ) {
241
- $after = stristr( $content, '</' . $tag . '>' );
242
- $content = ( ! stristr( $after, '</' . $tag . '>' ) ) ? $content . '</' . $tag . '>' : $content;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
243
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
244
  }
245
- }
246
- }
247
 
248
- global $post, $more;
249
- // If there is no 'more' link and auto_ex is on.
250
- if ( ! $has_more_link && ( $arr['auto_ex'] == true ) ) {
251
- // The default $more_link_text.
252
- $more_link_text = __( '(more&hellip;)' );
253
- // The default $more_link.
254
- $more_link = ' <a href="'. get_permalink( $post->ID ) . '" class="more-link">' . $more_link_text . '</a>';
255
- // Apply the_content_more_link filter if one exists (will match up all 'more' link text).
256
- $more_link = apply_filters( 'the_content_more_link' , $more_link, $more_link_text );
257
- // Add the more link to the excerpt.
258
- $content = $content . $more_link;
259
  }
260
 
261
  /**
262
  * Filter the auto excerpt.
263
  *
264
  * @since 2.8.1
 
265
  *
266
- * @param string $content The excerpt.
 
 
267
  */
268
- $content = apply_filters( 'wpmem_auto_excerpt', $content );
269
 
270
  // Return the excerpt.
271
  return $content;
@@ -279,8 +380,7 @@ if ( ! function_exists( 'wpmem_test_shortcode' ) ):
279
  *
280
  * @since 2.6.0
281
  *
282
- * @global $shortcode_tags
283
- *
284
  * @return bool
285
  *
286
  * @example http://codex.wordpress.org/Function_Reference/get_shortcode_regex
@@ -355,4 +455,4 @@ function wpmem_wp_reserved_terms() {
355
  return $reserved_terms;
356
  }
357
 
358
- /** End of File **/
7
  *
8
  * This file is part of the WP-Members plugin by Chad Butler
9
  * You can find out more about this plugin at http://rocketgeek.com
10
+ * Copyright (c) 2006-2016 Chad Butler
11
  * WP-Members(tm) is a trademark of butlerblog.com
12
  *
13
  * @package WP-Members
14
  * @subpackage WP-Members Utility Functions
15
  * @author Chad Butler
16
+ * @copyright 2006-2016
17
  *
18
  * Functions included:
19
  * - wpmem_create_formfield
26
  * - wpmem_test_shortcode
27
  * - wpmem_get_excluded_meta
28
  * - wpmem_use_ssl
29
+ * - wpmem_wp_reserved_terms
30
  */
31
 
32
 
110
  * @param string $type
111
  * @return string $issame
112
  */
113
+ function wpmem_selected( $value, $valtochk, $type = null ) {
114
  $issame = ( $type == 'select' ) ? ' selected' : ' checked';
115
  return ( $value == $valtochk ) ? $issame : '';
116
  }
209
  *
210
  * @since 2.6
211
  *
212
+ * @global object $post The post object.
213
+ * @global object $wpmem The WP_Members object.
214
  *
215
  * @param string $content
216
  * @return string $content
217
  */
218
  function wpmem_do_excerpt( $content ) {
219
 
220
+ global $post, $more, $wpmem;
221
 
222
+ $autoex = ( isset( $wpmem->autoex[ $post->post_type ] ) && 1 == $wpmem->autoex[ $post->post_type ]['enabled'] ) ? $wpmem->autoex[ $post->post_type ] : false;
223
 
224
  // Is there already a 'more' link in the content?
225
  $has_more_link = ( stristr( $content, 'class="more-link"' ) ) ? true : false;
226
 
227
  // If auto_ex is on.
228
+ if ( $autoex ) {
229
 
230
  // Build an excerpt if one does not exist.
231
  if ( ! $has_more_link ) {
232
+
233
+ if ( is_singular( $post->post_type ) ) {
234
+ // If it's a single post, we don't need the 'more' link.
235
+ $more_link_text = '';
236
+ $more_link = '';
237
+ } else {
238
+ // The default $more_link_text.
239
+ $more_link_text = __( '(more&hellip;)' );
240
+ // The default $more_link.
241
+ $more_link = ' <a href="'. get_permalink( $post->ID ) . '" class="more-link">' . $more_link_text . '</a>';
242
  }
243
+
244
+ // Apply the_content_more_link filter if one exists (will match up all 'more' link text).
245
+ /** This filter is documented in /wp-includes/post-template.php */
246
+ $more_link = apply_filters( 'the_content_more_link', $more_link, $more_link_text );
247
+
248
+ $defaults = array(
249
+ 'length' => $autoex['length'],
250
+ 'strip_tags' => false,
251
+ 'close_tags' => array( 'i', 'b', 'strong', 'em', 'h1', 'h2', 'h3', 'h4', 'h5' ),
252
+ 'parse_shortcodes' => false,
253
+ 'strip_shortcodes' => false,
254
+ 'add_ellipsis' => false,
255
+ 'more_link' => $more_link,
256
+ 'blocked_only' => false,
257
+ );
258
+ /**
259
+ * Filter auto excerpt defaults.
260
+ *
261
+ * @since 3.0.9
262
+ *
263
+ * @param array {
264
+ * An array of settings to override the function defaults.
265
+ *
266
+ * @type int $length The default length of the excerpt.
267
+ * @type bool|string $strip_tags Can be a boolean to strip HTML tags from the excerpt
268
+ * or a string of allowed tags. default: false.
269
+ * @type array $close_tags An array of tags to close (without < >:
270
+ * for example i, b, h1, etc).
271
+ * @type bool $parse_shortcodes Parse shortcodes in the excerpt. default: false.
272
+ * @type bool $strip_shortcodes Remove shortcodes in the excerpt. default: false.
273
+ * @type bool $add_ellipsis Add ellipsis (...) to the end of the excerpt.
274
+ * @type string $more_link The more link HTML.
275
+ * }
276
+ * @param string $post->ID The post ID.
277
+ * @param string $post->post_type The content's post type.
278
+ */
279
+ $args = apply_filters( 'wpmem_auto_excerpt_args', '', $post->ID, $post->post_type );
280
+
281
+ // Merge settings.
282
+ $args = wp_parse_args( $args, $defaults );
283
+
284
+ // Are we only excerpting blocked content?
285
+ if ( $args['blocked_only'] ) {
286
+ $post_meta = get_post_meta( $post->ID, '_wpmem_block', true );
287
+ if ( 1 == $wpmem->block[ $post->post_type ] ) {
288
+ // Post type is blocked, if post meta unblocks it, don't do excerpt.
289
+ $do_excerpt = ( "0" == $post_meta ) ? false : true;
290
+ } else {
291
+ // Post type is unblocked, if post meta blocks it, do excerpt.
292
+ $do_excerpt = ( "1" == $post_meta ) ? true : false;
293
+ }
294
+ } else {
295
+ $do_excerpt = true;
296
+ }
297
+
298
+ if ( $do_excerpt ) {
299
+
300
+ // If strip_tags is enabled, remove HTML tags.
301
+ if ( $args['strip_tags'] ) {
302
+ $allowable_tags = ( ! is_bool( $args['strip_tags'] ) ) ? $args['strip_tags'] : '';
303
+ $content = strip_tags( $content, $allowable_tags );
304
+ }
305
+
306
+ // If parse shortcodes is enabled, parse shortcodes in the excerpt.
307
+ $content = ( $args['parse_shortcodes'] ) ? do_shortcode( $content ) : $content;
308
+
309
+ // If strip shortcodes is enabled, strip shortcodes from the excerpt.
310
+ $content = ( $args['strip_shortcodes'] ) ? strip_shortcodes( $content ) : $content;
311
+
312
+ // Create the excerpt.
313
+ $words = preg_split( "/[\n\r\t ]+/", $content, $args['length'] + 1, PREG_SPLIT_NO_EMPTY|PREG_SPLIT_OFFSET_CAPTURE );
314
+ if ( count( $words ) > $args['length'] ) {
315
+ end( $words );
316
+ $last_word = prev( $words );
317
+ $content = substr( $content, 0, $last_word[1] + strlen( $last_word[0] ) );
318
  }
319
+
320
+ /* @todo - Possible better excerpt creation.
321
+ $excerpt = ''; $x = 1; $end_chk = false;
322
+ $words = explode( ' ', $content, ( $args['length'] + 100 ) );
323
+ foreach ( $words as $word ) {
324
+ if ( $x < $args['length'] + 1 ) {
325
+ $excerpt.= trim( $word ) . ' ';
326
+ $offset = ( $x == 1 ) ? 1 : 0;
327
+ if ( strpos( $word, '<', $offset ) || $end_chk ) {
328
+ $end_chk = true;
329
+ if ( strpos( $word, '>' ) && ! strpos( $word, '><' ) ) {
330
+ $end_chk = false;
331
+ $x++;
332
+ }
333
+ } else {
334
+ $x++;
335
+ }
336
+ } else {
337
+ break;
338
+ }
339
+ }
340
+ $content = $excerpt;
341
+ */
342
+
343
+ // Check for common html tags and make sure they're closed.
344
+ foreach ( $args['close_tags'] as $tag ) {
345
+ if ( stristr( $content, '<' . $tag . '>' ) || stristr( $content, '<' . $tag . ' ' ) ) {
346
+ $after = stristr( $content, '</' . $tag . '>' );
347
+ $content = ( ! stristr( $after, '</' . $tag . '>' ) ) ? $content . '</' . $tag . '>' : $content;
348
+ }
349
+ }
350
+ $content = ( $args['add_ellipsis'] ) ? $content . '...' : $content;
351
+
352
+ // Add the more link to the excerpt.
353
+ $content = $content . ' ' . $args['more_link'];
354
  }
 
 
355
 
356
+ }
 
 
 
 
 
 
 
 
 
 
357
  }
358
 
359
  /**
360
  * Filter the auto excerpt.
361
  *
362
  * @since 2.8.1
363
+ * @since 3.0.9 Added post ID and post type parameters.
364
  *
365
+ * @param string $content The content excerpt.
366
+ * @param string $post->ID The post ID.
367
+ * @param string $post->post_type The content's post type.
368
  */
369
+ $content = apply_filters( 'wpmem_auto_excerpt', $content, $post->ID, $post->post_type );
370
 
371
  // Return the excerpt.
372
  return $content;
380
  *
381
  * @since 2.6.0
382
  *
383
+ * @global string $shortcode_tags
 
384
  * @return bool
385
  *
386
  * @example http://codex.wordpress.org/Function_Reference/get_shortcode_regex
455
  return $reserved_terms;
456
  }
457
 
458
+ // End of file.
inc/wp-registration.php CHANGED
@@ -8,13 +8,12 @@
8
  *
9
  * This file is part of the WP-Members plugin by Chad Butler
10
  * You can find out more about this plugin at http://rocketgeek.com
11
- * Copyright (c) 2006-2015 Chad Butler
12
  * WP-Members(tm) is a trademark of butlerblog.com
13
  *
14
- * @package WordPress
15
- * @subpackage WP-Members
16
  * @author Chad Butler
17
- * @copyright 2006-2015
18
  *
19
  * Functions Included:
20
  * - wpmem_do_wp_register_form
@@ -55,15 +54,7 @@ function wpmem_do_wp_register_form() {
55
  } else {
56
  $tos_pop = "<a href=\"#\" onClick=\"window.open('" . WP_PLUGIN_URL . "/wp-members/wp-members-tos.php','mywindow');\">";
57
  }
58
- /**
59
- * Filter the TOS link text.
60
- *
61
- * When this filter is used for the WP native registration, the $toggle parameter is not passed.
62
- *
63
- * @since 2.7.5
64
- *
65
- * @param string The text and link for the TOS.
66
- */
67
  $tos = apply_filters( 'wpmem_tos_link_txt', sprintf( __( 'Please indicate that you agree to the %s TOS %s', 'wp-members' ), $tos_pop, '</a>' ) );
68
 
69
  }
@@ -202,4 +193,4 @@ function wpmem_do_wp_newuser_form() {
202
  echo '</tbody></table>';
203
 
204
  }
205
- /** End of File **/
8
  *
9
  * This file is part of the WP-Members plugin by Chad Butler
10
  * You can find out more about this plugin at http://rocketgeek.com
11
+ * Copyright (c) 2006-2016 Chad Butler
12
  * WP-Members(tm) is a trademark of butlerblog.com
13
  *
14
+ * @package WP-Members
 
15
  * @author Chad Butler
16
+ * @copyright 2006-2016
17
  *
18
  * Functions Included:
19
  * - wpmem_do_wp_register_form
54
  } else {
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( __( 'Please indicate that you agree to the %s TOS %s', 'wp-members' ), $tos_pop, '</a>' ) );
59
 
60
  }
193
  echo '</tbody></table>';
194
 
195
  }
196
+ // End of file.
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.4.0
6
- Stable tag: 3.0.8
7
  License: GPLv2
8
 
9
  WP-Members&trade; is a free membership management framework for WordPress&reg; that restricts content to registered users.
@@ -12,7 +12,7 @@ WP-Members&trade; is a free membership management framework for WordPress&reg; t
12
 
13
  WP-Members&trade; is a membership plugin for WordPress&reg;. Perfect for newsletters, premium content sites, and more! The plugin restricts selected WordPress&reg; content to registered site members. WP-Members&trade; puts the registration process on the site front end so it is inline with your content (and thus your branded theme) instead of the native WP login page. WP-Members&trade; works with no modifications to your theme, but it is scalable for users that want to customize the look and feel, or want to restrict only some content. It is a great tool for sites offering premium content to subscribers, and is adaptable to a variety of applications.
14
 
15
- [vimeo https://vimeo.com/84961265]
16
 
17
  = Features: =
18
 
@@ -111,7 +111,7 @@ Premium priority support is available at the plugin's site [RocketGeek.com](http
111
 
112
  == Upgrade Notice ==
113
 
114
- WP-Members 3.0.8 is a feature release, see release notes.
115
  WP-Members 3.0.0 is a major version release. Please review the changelog: http://rkt.bz/v30
116
 
117
  == Screenshots ==
@@ -135,6 +135,32 @@ WP-Members 3.0.0 is a major version release. Please review the changelog: http:/
135
 
136
  == Changelog ==
137
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
138
  = 3.0.8 =
139
 
140
  * Added process for forgotten username retrieval.
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.4.1
6
+ Stable tag: 3.0.9.2
7
  License: GPLv2
8
 
9
  WP-Members&trade; is a free membership management framework for WordPress&reg; that restricts content to registered users.
12
 
13
  WP-Members&trade; is a membership plugin for WordPress&reg;. Perfect for newsletters, premium content sites, and more! The plugin restricts selected WordPress&reg; content to registered site members. WP-Members&trade; puts the registration process on the site front end so it is inline with your content (and thus your branded theme) instead of the native WP login page. WP-Members&trade; works with no modifications to your theme, but it is scalable for users that want to customize the look and feel, or want to restrict only some content. It is a great tool for sites offering premium content to subscribers, and is adaptable to a variety of applications.
14
 
15
+ [youtube http://www.youtube.com/watch?v=x4MEoRLSY_U]
16
 
17
  = Features: =
18
 
111
 
112
  == Upgrade Notice ==
113
 
114
+ WP-Members 3.0.9 is a feature release, see release notes.
115
  WP-Members 3.0.0 is a major version release. Please review the changelog: http://rkt.bz/v30
116
 
117
  == Screenshots ==
135
 
136
  == Changelog ==
137
 
138
+ = 3.0.9.2 =
139
+
140
+ * Fixes issue with plugin upgrade to new settings, introduces new upgrade process to WP_Members object class.
141
+ * Fixes issue with new wpmem_member_links_args and wpmem_register_links_args filters where filter was not applied.
142
+
143
+ = 3.0.9.1 =
144
+
145
+ * Fixes issue with custom post types when a CPT is exists but is not set in the WP-Members settings.
146
+
147
+ = 3.0.9 =
148
+
149
+ * Added Custom Post Type support.
150
+ * Added wpmem_member_links_args and wpmem_register_links_args filters.
151
+ * Added $link parameter to wpmem_forgot_link_str and wpmem_reg_link_str filters (gives just the link as an available parameter).
152
+ * Added new wpmem_sb_reg_link_str and wpmem_sb_forgot_link_str filters (same format as above).
153
+ * Added [email] and [user-profile] shortcodes to the new user registration email.
154
+ * Added label_text key to wpmem_register_form_rows filter.
155
+ * Added new auto excerpt settings, can now be set by post type.
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.
162
+ * Improved email functions to eliminate get_user_meta() calls when not needed.
163
+
164
  = 3.0.8 =
165
 
166
  * Added process for forgotten username retrieval.
uninstall.php CHANGED
@@ -6,13 +6,12 @@
6
  *
7
  * This file is part of the WP-Members plugin by Chad Butler
8
  * You can find out more about this plugin at http://rocketgeek.com
9
- * Copyright (c) 2006-2015 Chad Butler
10
  * WP-Members(tm) is a trademark of butlerblog.com
11
  *
12
- * @package WordPress
13
- * @subpackage WP-Members
14
  * @author Chad Butler
15
- * @copyright 2006-2015
16
  */
17
 
18
  // If uninstall is not called from WordPress, kill the uninstall.
@@ -78,4 +77,4 @@ function wpmem_uninstall_options() {
78
  delete_option( 'wpmembers_attrib' );
79
  }
80
 
81
- /** End of File **/
6
  *
7
  * This file is part of the WP-Members plugin by Chad Butler
8
  * You can find out more about this plugin at http://rocketgeek.com
9
+ * Copyright (c) 2006-2016 Chad Butler
10
  * WP-Members(tm) is a trademark of butlerblog.com
11
  *
12
+ * @package WP-Members
 
13
  * @author Chad Butler
14
+ * @copyright 2006-2016
15
  */
16
 
17
  // If uninstall is not called from WordPress, kill the uninstall.
77
  delete_option( 'wpmembers_attrib' );
78
  }
79
 
80
+ // End of file.
wp-members-install.php CHANGED
@@ -6,18 +6,18 @@
6
  *
7
  * This file is part of the WP-Members plugin by Chad Butler
8
  * You can find out more about this plugin at http://rocketgeek.com
9
- * Copyright (c) 2006-2015 Chad Butler
10
  * WP-Members(tm) is a trademark of butlerblog.com
11
  *
12
- * @package WordPress
13
- * @subpackage WP-Members
14
  * @author Chad Butler
15
- * @copyright 2006-2015
16
  *
17
  * Functions included:
18
  * - wpmem_do_install
19
  * - wpmem_update_settings
20
  * - wpmem_append_email
 
21
  * - wpmem_update_captcha
22
  */
23
 
@@ -47,7 +47,7 @@ function wpmem_do_install() {
47
  $wpmem_settings = array(
48
  'version' => WPMEM_VERSION,
49
  'block' => array(
50
- 'post' => 1,
51
  'page' => 0,
52
  ),
53
  'show_excerpt' => array(
@@ -62,6 +62,10 @@ function wpmem_do_install() {
62
  'post' => 1,
63
  'page' => 1,
64
  ),
 
 
 
 
65
  'notify' => 0,
66
  'mod_reg' => 0,
67
  'captcha' => 0,
@@ -75,11 +79,8 @@ function wpmem_do_install() {
75
  ),
76
  'cssurl' => '',
77
  'style' => plugin_dir_url ( __FILE__ ) . 'css/generic-no-float.css',
78
- 'autoex' => array(
79
- 'auto_ex' => '',
80
- 'auto_ex_len' => '',
81
- ),
82
  'attrib' => 0,
 
83
  );
84
 
85
  // Using update_option to allow for forced update.
@@ -167,12 +168,40 @@ function wpmem_update_settings() {
167
  // Is this an update from pre-3.0 or 3.0+?
168
  $is_three = ( array_key_exists( 'version', $wpmem_settings ) ) ? true : false;
169
 
 
170
  if ( $is_three ) {
171
- return;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
172
  } else {
173
-
174
- // Can only upgrade from 2.5.1 or higher.
175
  $show_reg = ( $wpmem_settings[7] == 0 ) ? 1 : 0;
 
176
  $wpmem_newsettings = array(
177
  'version' => WPMEM_VERSION,
178
  'block' => array(
@@ -204,10 +233,24 @@ function wpmem_update_settings() {
204
  ),
205
  'cssurl' => get_option( 'wpmembers_cssurl' ),
206
  'style' => get_option( 'wpmembers_style' ),
207
- 'autoex' => get_option( 'wpmembers_autoex' ),
208
  'attrib' => get_option( 'wpmembers_attrib' ),
209
  );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
210
 
 
211
  $wpmem_newsettings = array_merge( $wpmem_settings, $wpmem_newsettings );
212
 
213
  update_option( 'wpmembers_settings', $wpmem_newsettings );
@@ -451,4 +494,4 @@ function wpmem_update_captcha() {
451
  return;
452
  }
453
 
454
- /** End of File **/
6
  *
7
  * This file is part of the WP-Members plugin by Chad Butler
8
  * You can find out more about this plugin at http://rocketgeek.com
9
+ * Copyright (c) 2006-2016 Chad Butler
10
  * WP-Members(tm) is a trademark of butlerblog.com
11
  *
12
+ * @package WP-Members
 
13
  * @author Chad Butler
14
+ * @copyright 2006-2016
15
  *
16
  * Functions included:
17
  * - wpmem_do_install
18
  * - wpmem_update_settings
19
  * - wpmem_append_email
20
+ * - wpmem_update_dialogs
21
  * - wpmem_update_captcha
22
  */
23
 
47
  $wpmem_settings = array(
48
  'version' => WPMEM_VERSION,
49
  'block' => array(
50
+ 'post' => ( is_multisite() ) ? 0 : 1,
51
  'page' => 0,
52
  ),
53
  'show_excerpt' => array(
62
  'post' => 1,
63
  'page' => 1,
64
  ),
65
+ 'autoex' => array(
66
+ 'post' => array( 'enabled' => 0, 'length' => '' ),
67
+ 'page' => array( 'enabled' => 0, 'length' => '' ),
68
+ ),
69
  'notify' => 0,
70
  'mod_reg' => 0,
71
  'captcha' => 0,
79
  ),
80
  'cssurl' => '',
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.
168
  // Is this an update from pre-3.0 or 3.0+?
169
  $is_three = ( array_key_exists( 'version', $wpmem_settings ) ) ? true : false;
170
 
171
+ // If install is 3.0 or higher.
172
  if ( $is_three ) {
173
+
174
+ // If old auto excerpt settings exists, update it.
175
+ if ( isset( $wpmem_settings['autoex']['auto_ex'] ) ) {
176
+ // Update Autoex setting.
177
+ if ( $wpmem_settings['autoex']['auto_ex'] == 1 || $wpmem_settings['autoex']['auto_ex'] == "1" ) {
178
+ // If Autoex is set, move it to posts/pages.
179
+ $wpmem_settings['autoex']['post'] = array( 'enabled' => 1, 'length' => $wpmem_settings['autoex']['auto_ex_len'] );
180
+ $wpmem_settings['autoex']['page'] = array( 'enabled' => 1, 'length' => $wpmem_settings['autoex']['auto_ex_len'] );
181
+ } else {
182
+ // If it is not turned on (!=1), set it to off in new setting (-1).
183
+ $wpmem_settings['autoex']['post'] = array( 'enabled' => 0, 'length' => '' );
184
+ $wpmem_settings['autoex']['page'] = array( 'enabled' => 0, 'length' => '' );
185
+ }
186
+ unset( $wpmem_settings['autoex']['auto_ex'] );
187
+ unset( $wpmem_settings['autoex']['auto_ex_len'] );
188
+ }
189
+
190
+ // If post types settings does not exist, set as empty array.
191
+ if ( ! isset( $wpmem_settings['post_types'] ) ) {
192
+ $wpmem_settings['post_types'] = array();
193
+ }
194
+
195
+ // Version number should be updated no matter what.
196
+ $wpmem_settings['version'] = WPMEM_VERSION;
197
+
198
+ update_option( 'wpmembers_settings', $wpmem_settings );
199
+ return $wpmem_settings;
200
  } else {
201
+ // Update pre 3.0 installs (must be 2.5.1 or higher).
202
+ // Handle show registration setting change.
203
  $show_reg = ( $wpmem_settings[7] == 0 ) ? 1 : 0;
204
+ // Create new settings array.
205
  $wpmem_newsettings = array(
206
  'version' => WPMEM_VERSION,
207
  'block' => array(
233
  ),
234
  'cssurl' => get_option( 'wpmembers_cssurl' ),
235
  'style' => get_option( 'wpmembers_style' ),
 
236
  'attrib' => get_option( 'wpmembers_attrib' ),
237
  );
238
+ // Handle auto excerpt setting change and add to setting array.
239
+ $autoex = get_option( 'wpmembers_autoex' );
240
+ if ( $autoex['auto_ex'] == 1 || $autoex['auto_ex'] == "1" ) {
241
+ // If Autoex is set, move it to posts/pages.
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 (!=1), set it to off in new setting.
246
+ $wpmem_newsettings['autoex']['post'] = array( 'enabled' => 0, 'length' => '' );
247
+ $wpmem_newsettings['autoex']['page'] = array( 'enabled' => 0, 'length' => '' );
248
+ }
249
+
250
+ // Add post types setting.
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 );
494
  return;
495
  }
496
 
497
+ // End of file.
wp-members-tos.php CHANGED
@@ -6,13 +6,12 @@
6
  *
7
  * This file is part of the WP-Members plugin by Chad Butler
8
  * You can find out more about this plugin at http://rocketgeek.com
9
- * Copyright (c) 2006-2015 Chad Butler
10
  * WP-Members(tm) is a trademark of butlerblog.com
11
  *
12
- * @package WordPress
13
- * @subpackage WP-Members
14
  * @author Chad Butler
15
- * @copyright 2006-2015
16
  */
17
 
18
  define ( 'WP_USE_THEMES', false );
6
  *
7
  * This file is part of the WP-Members plugin by Chad Butler
8
  * You can find out more about this plugin at http://rocketgeek.com
9
+ * Copyright (c) 2006-2016 Chad Butler
10
  * WP-Members(tm) is a trademark of butlerblog.com
11
  *
12
+ * @package WP-Members
 
13
  * @author Chad Butler
14
+ * @copyright 2006-2016
15
  */
16
 
17
  define ( 'WP_USE_THEMES', false );
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.8
7
  Author: Chad Butler
8
  Author URI: http://butlerblog.com/
9
  Text Domain: wp-members
@@ -13,7 +13,7 @@ License: GPLv2
13
 
14
 
15
  /*
16
- Copyright (c) 2006-2015 Chad Butler
17
 
18
  The name WP-Members(tm) is a trademark of butlerblog.com
19
 
@@ -62,7 +62,7 @@ License: GPLv2
62
 
63
 
64
  // Initialize constants.
65
- define( 'WPMEM_VERSION', '3.0.8' );
66
  define( 'WPMEM_DEBUG', false );
67
  define( 'WPMEM_DIR', plugin_dir_url ( __FILE__ ) );
68
  define( 'WPMEM_PATH', plugin_dir_path( __FILE__ ) );
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.9.2
7
  Author: Chad Butler
8
  Author URI: http://butlerblog.com/
9
  Text Domain: wp-members
13
 
14
 
15
  /*
16
+ Copyright (c) 2006-2016 Chad Butler
17
 
18
  The name WP-Members(tm) is a trademark of butlerblog.com
19
 
62
 
63
 
64
  // Initialize constants.
65
+ define( 'WPMEM_VERSION', '3.0.9.2' );
66
  define( 'WPMEM_DEBUG', false );
67
  define( 'WPMEM_DIR', plugin_dir_url ( __FILE__ ) );
68
  define( 'WPMEM_PATH', plugin_dir_path( __FILE__ ) );