How do I fix “You are not allowed to edit this item.” for Admins on existing posts?

I fixed this by editing /wp-includes/capabilities.php The code was function current_user_can( $capability ) { $current_user = wp_get_current_user(); if ( empty( $current_user ) ) return false; $args = array_slice( func_get_args(), 1 ); $args = array_merge( array( $capability ), $args ); return call_user_func_array( array( $current_user, ‘has_cap’ ), $args ); } and I changed it to function current_user_can( … Read more

Is there a simple way to manage capabilities per user?

You don’t necessarily have to assign roles to manage the user’s capabilities. First, register your custom post types with their respective capabilities. See capabilities under Function Reference/register post type – Parameters Managing User Capabilities You can use add_cap or remove_cap to add or remove user capabilities for a specific user. // Add capability to a … Read more

Admins can’t edit each other’s posts

Ok, I got it figured out. For some reason, current_user_can was returning false when an admin went to edit other user’s posts… I have no idea how admins lost the ability to do this, but putting this into functions.php is a workable bandaid that restores admin edit capabilities; $administrator = get_role(‘administrator’); $administrator->add_cap(‘edit_others_posts’);

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)