How to create new permission for custom post types for doing specific tasks

Check the below code- add_action( ‘admin_init’, ‘the_dramatist_add_role_caps’, 999 ); function the_dramatist_add_role_caps() { // Add the roles you’d like to administer the custom post types $roles = array( ‘editor’, ‘administrator’ ); // Loop through each role and assign capabilities foreach($roles as $the_role) { $role = get_role($the_role); $role->add_cap( ‘read’ ); $role->add_cap( ‘read_{Post_Type_A_Name}’ ); // Also do for … Read more

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