I have created a custom post type and custom role, created the proper capabilities and assigned them so the new role and see and edit their own ctp's entries... but I'd like to create a customized edit screen for this role and for administrator roles.

E.g.: the role "custom_user" can edit the title, edit the attached image, etc; can see the value of another custom field (e.g.: 'approved_for_publication'), but can't edit that field.

A regular admin would get the regular edit screen, with all fields, but "custom_user" would get the modified version.

Same thing with the list view in the dashboard for that CTP. The admin would get certain columns, but the "custom_user" would get a slightly modified set of columns (e.g. the admin would get a "author" column, but "custom_user" wouldn't, since he'd only be seeing his own posts.

Any pointer on how to go about it? Searching about it I only find howtos to create custom roles and capabilities, or custom post types; which are things I already have covered.



Solved it for different edit pages for different roles.

In my method resposible for rendering the field I have:

if ( count( array_intersect( $allowed_editors, $user->roles ) ) < 1 )
   $readonly = 'readonly';

Which I later use to either set the input field as readonly or add/remove classes before rendering it.

Still working for the different columns, I'll update when finished. I guess that this is more useful than just deleting my question... :P

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.