Some role updates

This commit is contained in:
Tetrakern 2023-08-10 11:32:09 +02:00
parent cc0a5d62df
commit 43bb28cb28
2 changed files with 4 additions and 10 deletions

View File

@ -195,9 +195,6 @@ function fictioneer_restrict_editor_menu_access() {
function fictioneer_reduce_editor_admin_bar() {
global $wp_admin_bar;
// Remove all [+New] items
$wp_admin_bar->remove_node( 'new-content' );
// Remove comments
$wp_admin_bar->remove_node( 'comments' );
}
@ -295,9 +292,6 @@ function fictioneer_reduce_contributor_dashboard_widgets() {
function fictioneer_reduce_contributor_admin_bar() {
global $wp_admin_bar;
// Remove all [+New] items
$wp_admin_bar->remove_node( 'new-content' );
// Remove comments
$wp_admin_bar->remove_node( 'comments' );
}

View File

@ -195,8 +195,8 @@ function fictioneer_scope_media_to_uploader( $query ) {
return;
}
// Those who can edit users, can also see their files
if ( ! current_user_can( 'edit_users' ) ) {
// Those who can edit posts of others, can also see their files
if ( ! current_user_can( 'edit_others_posts' ) ) {
$query->set( 'author', $current_user->ID );
}
}
@ -221,8 +221,8 @@ function fictioneer_restrict_media_edit_delete( $caps, $cap, $user_id, $args ) {
return $caps;
}
// Those who can edit users, can also edit their files
if ( user_can( $user_id, 'edit_users' ) ) {
// Those who can edit posts of others, can also edit their files
if ( user_can( $user_id, 'edit_others_posts' ) ) {
return $caps;
}