Members - Version 1.1.3

Version Description

Download this release

Release Info

Developer greenshady
Plugin Icon 128x128 Members
Version 1.1.3
Comparing to
See all releases

Code changes from version 1.1.2 to 1.1.3

admin/class-user-edit.php CHANGED
@@ -144,7 +144,7 @@ final class Members_Admin_User_Edit {
144
  foreach ( $new_roles as $new_role ) {
145
 
146
  // If the user doesn't already have the role, add it.
147
- if ( ! in_array( $new_role, (array) $user->roles ) )
148
  $user->add_role( $new_role );
149
  }
150
 
144
  foreach ( $new_roles as $new_role ) {
145
 
146
  // If the user doesn't already have the role, add it.
147
+ if ( members_is_role_editable( $new_role ) && ! in_array( $new_role, (array) $user->roles ) )
148
  $user->add_role( $new_role );
149
  }
150
 
admin/functions-cap-groups.php CHANGED
@@ -123,7 +123,7 @@ function members_register_cap_groups() {
123
  foreach ( get_post_types( array(), 'objects' ) as $type ) {
124
 
125
  // Skip revisions and nave menu items.
126
- if ( in_array( $type->name, array( 'revision', 'nav_menu_item' ) ) )
127
  continue;
128
 
129
  // Get the caps for the post type.
123
  foreach ( get_post_types( array(), 'objects' ) as $type ) {
124
 
125
  // Skip revisions and nave menu items.
126
+ if ( in_array( $type->name, array( 'revision', 'nav_menu_item', 'custom_css', 'customize_changeset' ) ) )
127
  continue;
128
 
129
  // Get the caps for the post type.
changelog.md CHANGED
@@ -1,5 +1,15 @@
1
  # Change Log
2
 
 
 
 
 
 
 
 
 
 
 
3
  ## [1.1.2] - 2016-06-20
4
 
5
  ### Fixed
1
  # Change Log
2
 
3
+ ## [1.1.3] - 2016-02-06
4
+
5
+ ### Fixed
6
+
7
+ * Removes the `customize_changeset` and `custom_css` post type cap groups so that they don't appear in the capability tabs on the edit role screen.
8
+
9
+ ### Security
10
+
11
+ * Added a check that the role is editable before attempting to add a new role to a user.
12
+
13
  ## [1.1.2] - 2016-06-20
14
 
15
  ### Fixed
inc/functions-role-meta.php ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ function members_get_role_meta_option( $role ) {
4
+
5
+ return get_option( "members_{$role}_role_meta", array() );
6
+ }
7
+
8
+ function members_add_role_meta( $role, $meta_key, $meta_value, $unique = false ) {
9
+
10
+ $check = apply_filter( 'members_add_role_metadata', null, $role, $meta_key, $meta_value, $unique );
11
+
12
+ if ( ! is_null( $check ) )
13
+ return $check;
14
+
15
+ $role = members_sanitize_role( $role );
16
+
17
+
18
+ $option = members_get_role_meta_option( $role );
19
+
20
+ $add_value = $option[ $meta_key ][] = $meta_value;
21
+
22
+ }
23
+
24
+
25
+ function members_get_role_meta( $role, $meta_key = '', $single = false ) {
26
+
27
+
28
+ // Devs can short-circuit this by returning anything other than `null`.
29
+ $check = apply_filters( 'members_get_role_metadata', null, $role, $meta_key, $single );
30
+
31
+ if ( ! is_null( $check ) ) {
32
+
33
+ return $single && is_array( $check ) ? $check[0] : $check;
34
+ }
35
+
36
+
37
+ $role = members_sanitize_role( $role );
38
+
39
+
40
+ $option = members_get_role_meta_option( $role );
41
+
42
+ if ( ! $option || ! isset( $option[ $meta_key ] ) )
43
+ return '';
44
+
45
+ $meta_value = $option[ $meta_key ];
46
+
47
+ return $single && is_array( $meta_value ) ? $meta_value[0] : $meta_value;
48
+ }
49
+
50
+
51
+
52
+
53
+
54
+
55
+
56
+
57
+
58
+
59
+
js/edit-post.js CHANGED
@@ -48,7 +48,7 @@
48
  attributes : function() {
49
  return {
50
  'id' : 'members-cp-section-' + this.model.get( 'name' ),
51
- 'class' : 'members-cp-section,
52
  'aria-hidden' : ! this.model.get( 'selected' )
53
  };
54
  },
48
  attributes : function() {
49
  return {
50
  'id' : 'members-cp-section-' + this.model.get( 'name' ),
51
+ 'class' : 'members-cp-section',
52
  'aria-hidden' : ! this.model.get( 'selected' )
53
  };
54
  },
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.1.2
7
  * Author: Justin Tadlock
8
  * Author URI: http://themehybrid.com
9
  * Text Domain: members
@@ -25,7 +25,7 @@
25
  * write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26
  *
27
  * @package Members
28
- * @version 1.1.2
29
  * @author Justin Tadlock <justin@justintadlock.com>
30
  * @copyright Copyright (c) 2009 - 2016, Justin Tadlock
31
  * @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.1.3
7
  * Author: Justin Tadlock
8
  * Author URI: http://themehybrid.com
9
  * Text Domain: members
25
  * write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26
  *
27
  * @package Members
28
+ * @version 1.1.3
29
  * @author Justin Tadlock <justin@justintadlock.com>
30
  * @copyright Copyright (c) 2009 - 2016, Justin Tadlock
31
  * @link http://themehybrid.com/plugins/members
readme.txt CHANGED
@@ -4,7 +4,8 @@ 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.1.2
 
8
 
9
  The most powerful user, role, and capability management plugin for WordPress.
10
 
@@ -42,7 +43,7 @@ If you need professional plugin support from me, the plugin author, you can acce
42
 
43
  ### Plugin Development
44
 
45
- If you're a theme author, plugin author, or just a code hobbyist, you can follow the development of this plugin on it's [GitHub repository](https://github.com/justintadlock/members).
46
 
47
  == Installation ==
48
 
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
+ Tested up to: 4.7.2
8
+ Stable tag: 1.1.3
9
 
10
  The most powerful user, role, and capability management plugin for WordPress.
11
 
43
 
44
  ### Plugin Development
45
 
46
+ If you're a theme author, plugin author, or just a code hobbyist, you can follow the development of this plugin on it's [GitHub repository](https://github.com/justintadlock/members).
47
 
48
  == Installation ==
49