WordPress Capabilities: edit_user vs edit_users

I found a few references to edit_user as a capability, one of which is this: // Allow user to edit itself if ( ‘edit_user’ == $cap && isset( $args[0] ) && $user_id == $args[0] ) break; http://core.trac.wordpress.org/browser/tags/3.5.2/wp-includes/capabilities.php#L1005 I believe the comment in that block of code answers this question. Per @PatJ, it looks like map_meta_cap … Read more

Hide specific admin users’ posts

Try this – rather than redo all the hard work that WordPress does for the view links, just calculate all the posts for the admin you want to “hide” and subtract from the existing post counts: function wpse_229427_get_hidden_admin_id() { return 3; // You could make this a setting or return a value conditionally } function … Read more

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

Looks like I found a snippet that do exactly that. It’s from Daniel Bachhuber, the API developer. add_filter( ‘rest_authentication_errors’, function( $result ) { if ( ! empty( $result ) ) { return $result; } if ( ! is_user_logged_in() ) { return new WP_Error( ‘restx_logged_out’, ‘Sorry, you must be logged in to make a request.’, array( … Read more

What exactly is WordPress?

Yes, you can run WordPress with your own domain if you purchase hosting for it. WordPress has system of Roles (which can be further enhanced via plugins), you can let users register and allow to perform actions accordign to their role. Essentially yes. You copy WordPress files to server and initiate brief installation procedure. First … Read more

How to update user role without logout

I think you are on the right track, wp_cache_delete was what finally helped me get an auto-signup with auto-login plugin working… I have this from there: wp_cache_delete($current_user->ID, ‘users’); wp_cache_delete($current_user->user_login, ‘userlogins’); Then see what roles you get after that with: $current_user = wp_get_current_user();