PluginProbe
WP Directory Kit / 1.4.8
WP Directory Kit v1.4.8
1.5.6 1.5.5 1.5.4 1.5.3 trunk 1.1.0 1.1.6 1.1.8 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.8 1.4.0 1.4.1 All 35 releases
wpdirectorykit / custom_user_roles.php

custom_user_roles.php in WP Directory Kit 1.4.8, at custom_user_roles.php

27 lines 860 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 if ( ! defined( 'ABSPATH' ) ) {
4 exit; // Exit if accessed directly.
5 }
6
7 add_action( 'init', 'wdk_custom_user_roles' );
8 function wdk_custom_user_roles()
9 {
10 add_role('wdk_agent' , __('Agent', 'wpdirectorykit'), array( 'read' => true, 'level_0' => true ) );
11 $role = get_role('wdk_agent');
12 $role->add_cap('edit_own_listings');
13 $role->add_cap('edit_own_profile');
14 $role->add_cap('upload_files');
15
16 add_role('wdk_listing_admin' , __('Listing Admin', 'wpdirectorykit'), array( 'read' => true, 'level_0' => true ) );
17 $role = get_role('wdk_listing_admin');
18 $role->add_cap('edit_own_listings');
19 $role->add_cap('edit_own_profile');
20 $role->add_cap('upload_files');
21 $role->add_cap('wdk_listings_manage');
22
23 $role = get_role('administrator');
24 $role->add_cap('wdk_listings_manage');
25 }
26
27 ?>