Change WordPress user roles and capabilities › Forums › Restrict or Permit access inside WordPress – how to › Restrict access to content by Author in Media Library › Reply To: Restrict access to content by Author in Media Library
21/01/2017 at 01:41
#3266
Vladimir
Keymaster
Use this workaround:
add_filter('ure_restrict_edit_post_type', 'exclude_posts_from_edit_restrictions');
function exclude_posts_from_edit_restrictions($post_type) {
global $current_user;
$restrict_it = true;
if ($current_user->user_login=='your_user_login_here') {
if ($post_type!=='attachment') {
$restrict_it = false;
}
}
return $restrict_it;
}
It applies ‘edit restrictions’ set for the user to the ‘attachment’ post type only.