How can I allow user to select minimum privilege smartly

You are using the right WP function but unfortunately not passing the right parameter to make this work for you. current_user_can() accepts capabilities as well as roles as parameters. In the above you are using roles and not capabilities. You can use capabilities to make it work. For example, if you want the minimum privilege … Read more

Allow users to set a post author

The edit_others_posts capability should allow users to set the author of a post. At first glance you might reply that you don’t want your authors to be able to edit one another’s posts. The difference in ability is very subtle though: writing a post and then assigning it to another user isn’t much different from … Read more

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