Change WordPress user roles and capabilities › Forums › How to or FAQ › Edit Page – but a specific page only › Reply To: Edit Page – but a specific page only

#6002
Vladimir
Keymaster

Check what exact ID your custom post type CPT really has. Pay attention that while we talk ‘posts’, post type ID is ‘post’. So I suppose that your CPT is ‘scholarship’, not ‘scholarships’.
With this assumption in mind try this version of a code:


if (current_user_can('scholarships')) {  // Role ID
      if ($post_type=='scholarship') {  // CPT ID
        $restrict_it = false;
      }
  }