How to restrict subscriber editing other posts but read specific posts in backend

To query posts with more than one author ID, you can use author__in parameter. This makes posts from chosen authors visible (read only) for the current user. add_filter(‘pre_get_posts’, ‘posts_for_current_author’); function posts_for_current_author($query) { if ( $query->is_admin && ‘edit.php’ === $GLOBALS[‘pagenow’] && ! current_user_can( ‘edit_others_posts’ ) ) { $query->set(‘author__in’, array(get_current_user_id(), 1, 2, 3) ); // add 1 … Read more

Remove add post for user role

This is not possible using the capabilities system, the granularity you want does not exist in WP core: edit_posts Since 2.0 Allows access to Administration Screens options: Posts Posts > Add New Comments Comments > Awaiting Moderation https://wordpress.org/support/article/roles-and-capabilities/#edit_posts edit_posts covers both viewing, adding, and editing posts, as well as commenting. There is a capability that … Read more

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