Customize users’ capabilities to change a custom post’s post status

I’ve got a somewhat unique scenario that I would appreciate some assistance with. I have a custom post type, coin, for content that is automatically created by an custom import process. I would like to restrict all users from performing certain actions on any coin posts. Specifically, I want to prevent any user from deleting … Read more

REST API: How can I restrict a custom post type to only be accessible by authenticated users?

I have a custom post type configured to be accessible via the WP Rest API v2. How do I lock the access to this custom post type so that only the authenticated users can perform GET requests? 1 Answer 1 Looks like I found a snippet that do exactly that. It’s from Daniel Bachhuber, the … Read more

How to prevent users with “edit_others_posts” capability from editing admin posts

I have some posts that author is Administrator and some other posts that author is Editor After logging in as Editor, I can edit Administrator posts. I would like to prevent this. I find some information about filters like user_has_cap and map_meta_cap but i’m not sure it’s right direction. Maybe I’m digging too deep and … Read more

What exactly is WordPress?

These are some very basic questions, so I apologize for asking them, but it’s hard to understand exactly how some things work without spending dozens of hours experimenting with them. I’m more than willing to learn WP if it can do these things, but I just need some yes / no / brief explanation answers … Read more

How to check user role without using current_user_can()

I am filtering the map_meta_cap() function, which is called from $user->has_cap (which is called from current_user_can()). I only want my filter to execute if the current user is an administrator, so I need a conditional in my filter that checks their role. I can’t use current_user_can(), because that invokes my filter, causing an infinite loop. … Read more