| 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 |
?> |