How can I grant capabilities directly to users (not roles) in wp-admin?

you can assign capabilities directly to user using the class WP_user::add_cap()

//to remove capability from user
$user = new WP_User( $user_id );
$user->remove_cap( 'can_email');

//to add capability to user
$user = new WP_User( $user_id );
$user->add_cap( 'can_email');

Source – https://wordpress.stackexchange.com/a/60433/17968

Leave a Comment

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