Allow user to Edit Posts but not Add New?

You will have to do something like this: function hide_buttons() { global $current_screen; if($current_screen->id == ‘edit-post’ && !current_user_can(‘publish_posts’)) { echo ‘<style>.add-new-h2{display: none;}</style>’; } } add_action(‘admin_head’,’hide_buttons’); See: http://erisds.co.uk/wordpress/spotlight-wordpress-admin-menu-remove-add-new-pages-or-posts-link for reference

Show admin bar only for some USERS roles

You can disable the admin bar via function: show_admin_bar(false); So with that in mind, we can hook into after_setup_theme and hide the admin bar for all users except administrator and contributor: function cc_wpse_278096_disable_admin_bar() { if (current_user_can(‘administrator’) || current_user_can(‘contributor’) ) { // user can view admin bar show_admin_bar(true); // this line isn’t essentially needed by default… … Read more

Issue with Custom Roles in Multisite

So, thanks to kaiser, I was able to figure it out. I had to do two things to make this work. First, I noticed that disabling the WP User Avatar plugin was causing the errors to disappear. I looked and realized that a setting was checked “allow subscribers and contributors to edit their avatars.” Unchecking … Read more

How to assign specific users the capability to edit specific pages / posts / custom post types

I can suggest another method. First of all: grant full access to projects post type (Example). At the user profile add allowed posts’ id. Then use below filter to restrict access if post id isn’t allowed. function allow_user_to_edit_cpt_filter( $capauser, $capask, $param){ global $wpdb; $allowed_posts_id_for_current_user = array( ’29’, ’30’ ); // you need to get these … Read more

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