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); $admin->add_cap('wowpress_view_raids'); $admin->add_cap('wowpress_view_teamspeak'); $admin->add_cap('wowpress_view_birthdays'); $admin->add_cap('wowpress_view_complaints'); $admin->add_cap('wowpress_edit_complaints'); 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); $rl->add_cap('wowpress_view_raids'); $raider->add_cap('wowpress_view_raids'); $novize->add_cap('wowpress_view_raids'); $ff->add_cap('wowpress_view_raids'); $rl->add_cap('wowpress_view_teamspeak'); $raider->add_cap('wowpress_view_teamspeak'); $novize->add_cap('wowpress_view_teamspeak'); $ff->add_cap('wowpress_view_teamspeak'); $rl->add_cap('wowpress_view_birthdays'); $raider->add_cap('wowpress_view_birthdays'); $novize->add_cap('wowpress_view_birthdays'); $ff->add_cap('wowpress_view_birthdays'); $rl->add_cap('wowpress_view_complaints'); $raider->add_cap('wowpress_view_complaints'); $novize->add_cap('wowpress_view_complaints'); $ff->add_cap('wowpress_view_complaints'); } function isAllowed($capability) { if (!current_user_can($capability)) : include plugin_dir_path(__FILE__) . '../pages/404.php'; die; endif; } function setGlobalUser(){ global $user; $user = get_current_user_id(); if ($user) { $user = User::find($user); } else { $user = new User(); $user->ID = 0; $user->login = "Gast"; } } add_action( 'show_user_profile', 'wowpress_extra_user_profile_fields' ); add_action( 'edit_user_profile', 'wowpress_extra_user_profile_fields' ); function wowpress_extra_user_profile_fields( $user ) { ?>