1 <?php
2
3 /*
4 * WORDSMITH USER ROLE CLASS
5 *
6 * this class is the base object for a custom action to be added into wordpress.
7 * it is a best prectise initiative that all actions to implement custom wordpress logic be enclosed in a single class which exnteds this class.
8 */
9
10 namespace nk2580\wordsmith\UserRoles;
11
12 class UserRole {
13
14 protected $role_name;
15 protected $display_name;
16 protected $capabilities = [];
17
18 public function __construct() {
19 add_action( 'init', array( $this, 'callAddRole' ) );
20 }
21
22 public function callAddRole() {
23 add_role( $this->role_name, $this->display_name, $this->capabilities );
24 }
25
26 }
27