I really think the access team should consider adding an option to break hierarchy, this would allow for sites with client portal needs to be able to permission off different content. Anyways since that isn't the case currently I am fine with using current_user_can but what I need to know is this. With Access when a CPT is blocked from a certain role that CPT will not show inside of post query's. It doesn't just return a blank page it makes sure that the CPT returns a 404, and never shows up in any queries unless the user has the correct permissions. I want to emulate this behavior, where and how can I implement current_user_can to achieve this? I assume there is a wp hook I must use that happens when the post is queried? Then if ( current_user_can('role name')) return cpt else return 404page. Is this correct?
↧