Version Description
Download this release
Release Info
Developer | greenshady |
Plugin | Members |
Version | 1.0.2 |
Comparing to | |
See all releases |
Code changes from version 1.0.1 to 1.0.2
- admin/class-settings.php +8 -8
- changelog.md +8 -0
- inc/functions-shortcodes.php +2 -2
- members.php +2 -2
- readme.txt +1 -1
admin/class-settings.php
CHANGED
@@ -158,14 +158,14 @@ final class Members_Settings_Page {
|
|
158 |
function validate_settings( $settings ) {
|
159 |
|
160 |
// Validate true/false checkboxes.
|
161 |
-
$settings['role_manager'] =
|
162 |
-
$settings['explicit_denied_caps'] =
|
163 |
-
$settings['multi_roles'] =
|
164 |
-
$settings['content_permissions'] =
|
165 |
-
$settings['login_form_widget'] =
|
166 |
-
$settings['users_widget'] =
|
167 |
-
$settings['private_blog'] =
|
168 |
-
$settings['private_feed'] =
|
169 |
|
170 |
// Kill evil scripts.
|
171 |
$settings['content_permissions_error'] = stripslashes( wp_filter_post_kses( addslashes( $settings['content_permissions_error'] ) ) );
|
158 |
function validate_settings( $settings ) {
|
159 |
|
160 |
// Validate true/false checkboxes.
|
161 |
+
$settings['role_manager'] = ! empty( $settings['role_manager'] ) ? true : false;
|
162 |
+
$settings['explicit_denied_caps'] = ! empty( $settings['explicit_denied_caps'] ) ? true : false;
|
163 |
+
$settings['multi_roles'] = ! empty( $settings['multi_roles'] ) ? true : false;
|
164 |
+
$settings['content_permissions'] = ! empty( $settings['content_permissions'] ) ? true : false;
|
165 |
+
$settings['login_form_widget'] = ! empty( $settings['login_form_widget'] ) ? true : false;
|
166 |
+
$settings['users_widget'] = ! empty( $settings['users_widget'] ) ? true : false;
|
167 |
+
$settings['private_blog'] = ! empty( $settings['private_blog'] ) ? true : false;
|
168 |
+
$settings['private_feed'] = ! empty( $settings['private_feed'] ) ? true : false;
|
169 |
|
170 |
// Kill evil scripts.
|
171 |
$settings['content_permissions_error'] = stripslashes( wp_filter_post_kses( addslashes( $settings['content_permissions_error'] ) ) );
|
changelog.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1 |
# Change Log
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
## [1.0.1] - 2015-09-14
|
4 |
|
5 |
### Fixed
|
1 |
# Change Log
|
2 |
|
3 |
+
## [1.0.2] - 2015-09-15
|
4 |
+
|
5 |
+
### Fixed
|
6 |
+
|
7 |
+
* Make sure `$attr` is set by `shortcode_atts()` in the `[members_access]` shortcode.
|
8 |
+
* Use `members_current_user_has_role()` in the `[members_access]` shortcode.
|
9 |
+
* Use `! empty()` to validate the checkboxes when settings are saved.
|
10 |
+
|
11 |
## [1.0.1] - 2015-09-14
|
12 |
|
13 |
### Fixed
|
inc/functions-shortcodes.php
CHANGED
@@ -98,7 +98,7 @@ function members_access_check_shortcode( $attr, $content = null ) {
|
|
98 |
);
|
99 |
|
100 |
// Merge the input attributes and the defaults.
|
101 |
-
shortcode_atts( $defaults, $attr, 'members_access' );
|
102 |
|
103 |
// If the current user has the capability, show the content.
|
104 |
if ( $attr['capability'] ) {
|
@@ -125,7 +125,7 @@ function members_access_check_shortcode( $attr, $content = null ) {
|
|
125 |
foreach ( $roles as $role ) {
|
126 |
|
127 |
// If the current user has the role, return the content.
|
128 |
-
if (
|
129 |
return do_shortcode( $content );
|
130 |
}
|
131 |
}
|
98 |
);
|
99 |
|
100 |
// Merge the input attributes and the defaults.
|
101 |
+
$attr = shortcode_atts( $defaults, $attr, 'members_access' );
|
102 |
|
103 |
// If the current user has the capability, show the content.
|
104 |
if ( $attr['capability'] ) {
|
125 |
foreach ( $roles as $role ) {
|
126 |
|
127 |
// If the current user has the role, return the content.
|
128 |
+
if ( members_current_user_has_role( trim( $role ) ) )
|
129 |
return do_shortcode( $content );
|
130 |
}
|
131 |
}
|
members.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: Members
|
4 |
* Plugin URI: http://themehybrid.com/plugins/members
|
5 |
* Description: A user and role management plugin that puts you in full control of your site's permissions. This plugin allows you to edit your roles and their capabilities, clone existing roles, assign multiple roles per user, block post content, or even make your site completely private.
|
6 |
-
* Version: 1.0.
|
7 |
* Author: Justin Tadlock
|
8 |
* Author URI: http://themehybrid.com
|
9 |
*
|
@@ -23,7 +23,7 @@
|
|
23 |
* write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
24 |
*
|
25 |
* @package Members
|
26 |
-
* @version 1.0.
|
27 |
* @author Justin Tadlock <justin@justintadlock.com>
|
28 |
* @copyright Copyright (c) 2009 - 2015, Justin Tadlock
|
29 |
* @link http://themehybrid.com/plugins/members
|
3 |
* Plugin Name: Members
|
4 |
* Plugin URI: http://themehybrid.com/plugins/members
|
5 |
* Description: A user and role management plugin that puts you in full control of your site's permissions. This plugin allows you to edit your roles and their capabilities, clone existing roles, assign multiple roles per user, block post content, or even make your site completely private.
|
6 |
+
* Version: 1.0.2
|
7 |
* Author: Justin Tadlock
|
8 |
* Author URI: http://themehybrid.com
|
9 |
*
|
23 |
* write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
24 |
*
|
25 |
* @package Members
|
26 |
+
* @version 1.0.2
|
27 |
* @author Justin Tadlock <justin@justintadlock.com>
|
28 |
* @copyright Copyright (c) 2009 - 2015, Justin Tadlock
|
29 |
* @link http://themehybrid.com/plugins/members
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Contributors: greenshady
|
|
4 |
Donate link: http://themehybrid.com/donate
|
5 |
Tags: admin, role, roles, member, members, profile, shortcode, user, users, widget, widgets
|
6 |
Requires at least: 4.3
|
7 |
-
Stable tag: 1.0.
|
8 |
|
9 |
The most powerful user, role, and capability management plugin for WordPress.
|
10 |
|
4 |
Donate link: http://themehybrid.com/donate
|
5 |
Tags: admin, role, roles, member, members, profile, shortcode, user, users, widget, widgets
|
6 |
Requires at least: 4.3
|
7 |
+
Stable tag: 1.0.2
|
8 |
|
9 |
The most powerful user, role, and capability management plugin for WordPress.
|
10 |
|