WowPress-Tailwind/theme/inc/config-functions.php

47 lines
1.2 KiB
PHP

<?php
function set_roles()
{
remove_role('editor');
remove_role('contributor');
remove_role('author');
remove_role('subscriber');
$admin = get_role('administrator');
add_role('gildenmeister', __('Gildenmeister'), ['read' => true]);
$gm = get_role('gildenmeister');
add_role('offizier', __('Offizier'), ['read' => true]);
$offi = get_role('offizier');
add_role('raidlead', __('Raidlead'), ['read' => true]);
$rl = get_role('raidlead');
add_role('raider', __('Raider'), ['read' => true]);
$raider = get_role('raider');
add_role('novize', __('Novize'), ['read' => true]);
$novize = get_role('novize');
add_role('f_f', __('F&F'), ['read' => true]);
$ff = get_role('f_f');
add_role('nobody', __('Niemand'));
update_option('default_role', 'nobody');
$admin->add_cap('wowpress_edit_site', true);
$admin->add_cap('wowpress_edit_raids', true);
$admin->add_cap('wowpress_edit_characters', true);
foreach (get_role('administrator')->capabilities as $cap => $status) {
$gm->add_cap($cap, $status);
$offi->add_cap($cap, $status);
}
$rl->add_cap('wowpress_edit_raids', true);
$rl->add_cap('wowpress_edit_characters', true);
}