PluginProbe
Members – Membership & User Role Editor Plugin / 3.2.24
Members – Membership & User Role Editor Plugin v3.2.24
3.2.25 3.2.26 3.2.24 3.2.23 3.2.22 3.2.21 trunk 0.1 0.1.1 0.2 0.2.1 0.2.2 0.2.3 0.2.4 0.2.5 1.0.0 1.0.1 1.0.2 1.1.0 1.1.1 1.1.2 1.1.3 2.0.0 2.0.1 2.0.2 All 66 releases
members / inc / class-capability.php

class-capability.php in Members – Membership & User Role Editor Plugin 3.2.24, at inc/class-capability.php

82 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Creates a new capability object.
4 *
5 * @package Members
6 * @subpackage Includes
7 * @author The MemberPress Team
8 * @copyright Copyright (c) 2009 - 2018, The MemberPress Team
9 * @link https://members-plugin.com/
10 * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
11 */
12 namespace Members;
13
14 defined('ABSPATH') || exit;
15 /**
16 * Capability class.
17 *
18 * @since 2.0.0
19 * @access public
20 */
21 class Capability {
22
23 /**
24 * The capability name.
25 *
26 * @since 2.0.0
27 * @access public
28 * @var string
29 */
30 public $name = '';
31
32 /**
33 * The capability label.
34 *
35 * @since 2.0.0
36 * @access public
37 * @var string
38 */
39 public $label = '';
40
41 /**
42 * The group the capability belongs to.
43 *
44 * @see Members_Cap_Group
45 * @since 2.0.0
46 * @access public
47 * @var string
48 */
49 public $group = '';
50
51 /**
52 * Return the role string in attempts to use the object as a string.
53 *
54 * @since 2.0.0
55 * @access public
56 * @return string
57 */
58 public function __toString() {
59 return $this->name;
60 }
61
62 /**
63 * Creates a new role object.
64 *
65 * @since 2.0.0
66 * @access public
67 * @global object $wp_roles
68 * @param string $role
69 * @return void
70 */
71 public function __construct( $name, $args = array() ) {
72
73 foreach ( array_keys( get_object_vars( $this ) ) as $key ) {
74
75 if ( isset( $args[ $key ] ) )
76 $this->$key = $args[ $key ];
77 }
78
79 $this->name = sanitize_key( $name );
80 }
81 }
82