I have a custom post type on WordPress, from an external plugin, and i want to conditionally deny showing content from this post type, based on user capability. Pseudocode is better to explain than 1000 words:
if (!current_user_can('my_custom_capability') && $post->post_type == 'my_custom_post_type')
then
deny showing post content;
which filter I have to use?
I have been searching for hours, but I've found only: capability for custom post types and this, that seems to be the closest one, but I still can't figure out how to use them. I just need to do this check on an already existing custom post type