Hi Savvas
I had to made something like a work around, because If I remove the spdetails_div it “forgot” the details after updateing an event or team.
Howerver, this is the workaroud I’m using now:
1. Uncheck boxes for the “unnessesary” metaboxes
2. Hide the “Screen Options” for spesific users
// Funktion w?hlt alle Metaboxen aus, die Verdeckt werden sollen.
// Function choose all metaboxes which shall disappear
add_filter('hidden_meta_boxes', 'hide_meta_box_attributes', 10, 2);
function hide_meta_box_attributes( $hidden, $screen) {
$hidden = [
'pageparentdiv', //Seitenatribute
'sp_detailsdiv', //Team Details
'postimagediv', //Team Logo
'sp_staffdiv', //Stafflist
'sp_listsdiv', //Playerlist
'postexcerpt', //Excerpt (Auszug)
'slugdiv', //Titelform
];
return $hidden;
}
// Hide Screen Options for all users without "manage_options" capability
// Ansicht anpassen wird für alle ausgeblendet ausser für Benutzer die manage_options haben.
add_filter('screen_options_show_screen', 'remove_screen_options');
function remove_screen_options(){
if(!current_user_can('manage_options')) {
return false;
}
return true;
}
// Entfernt Editor und Titel bei Teams für Mannschaftsführer
// Removes editor and title on team pages (team manager shall not change this data!)
add_action('admin_init', 'sp_team_hide_editor');
function sp_team_hide_editor() {
if (!current_user_can('manage_options'))
remove_post_type_support('sp_team', 'title');
remove_post_type_support('sp_team', 'editor');
}
The code is in the functions.php file of the child theme. Using Code Snippets would work too.
Maybe you have another and better solution.
best regards
korbball
-
This reply was modified 5 years, 2 months ago by korbball.