problem is with your logical statement.
now you are trying to remove dashboard staff where user id is not ‘279’, which means only user id 279 can see dashboard.
you can try this in if statement
if(is_admin() && $user_id == '279'){ //your codes }
Related Posts:
- Allowing users to edit only their page and nobody else’s
- Disallowing Users of a Custom Role from Deleting or Adding Administrators?
- How to customize wp_signon()
- Can I create users that have access to *some* other users posts instead of all other users posts?
- Set default page for user account in admin
- Hide everything on site for visitors except specific page IDs
- Managing Users and Creating Groups [closed]
- How to disable a specific page for a specific user
- wordpress user roles are not working
- Displaying different in-page content to cliente/admin
- Problem with automatic role change through cron job
- How can I allow an User to publish only 5 posts per month?
- Where are $current_user->allcaps set?
- Allow admins to login as other users
- Can I Create a Second Admin Level User Role?
- WordPress user role with create user capability?
- Update user role for expired membership
- Custom User Role: Can Edit Own Page, Cannot Create New
- WordPress install checking permissions of user id 0
- Allowing users to edit only their page and nobody else’s
- How to bulk change user role to “No role for this site”
- Restrict Access to the User Profile
- Control Category of each user can post
- Limit user access to installing/configuring a plugin?
- How to remove/limit Editor accounts privileges, to prevent them from deleting media and pages created by Admin
- How to add default folders to Every registered User when registered in WordPress site?
- If the current user is an administrator or editor
- Editor can create any new user except administrator
- How to allow an user role to create a new user under a role which lower than his level only?
- How to programatically change username (user_login)?
- Remove Ability for Other Users to View Administrator in User List?
- Find out if logged in user is not subscriber
- Groups of capabilities: users with multiple roles?
- User-edit role setting distinct from wp_capabilities? [closed]
- How to restrict access to uploaded files?
- alphabetically order role drop-down selection in dashboard
- Execute a function when admin changes the user role
- How to let contributors to create a new revision(draft) editing their published posts
- What the user_status column?
- How to hide media uploads by other users in the Media menu?
- Show admin bar only for some USERS roles
- Allowing an email as the username?
- Grouping users under parent user
- Check if specific username is logged in
- How to update user role without logout
- How to check user role without using current_user_can()
- Post list based on the user that is logged in
- Basic auth WordPress REST API dilemma
- Do not allow users to create new posts and pages
- \WP_User Object | What’s the Difference Between {caps} and {allcaps}?
- How to enable the theme editor cap for an editor role?
- How to assign capabilities to user NOT to User Role
- How to assign an additional/extra/second user-role to multiple users (of a specific user-role)
- How to stop a user from updating the post date
- BuddyPress | Check if user is in current group [closed]
- Copy a user from one WordPress site to another
- How to remove “Super Admin” from All Users for those that are not a “Super Admin”?
- Return ID of authors who have at least one post
- WordPress edit_user_profile_update update secondary role
- Front end user meta options for users
- How do I properly format the user_role array?
- How-to Delay The Capability To Publish Posts?
- Is there a simple way to manage capabilities per user?
- Is it possible to get a user with just the password field?
- How to get the Role Name of the current user? (WordPress)
- Redirect after login based on user role (custom login page)
- set_role has no effect
- WP_User->add_role producing unexpected results
- How can I check if the admin bar is visible to the current user?
- Users roles, make a page belonging to multiple users
- Tagging users in WordPress
- Redirect after users complete profile form
- Share user table from WP with Drupal
- How do I list in the backend all users that were assigned to a custom role?
- How to add local users to wordpress without email password?
- Log all users out of all locations after 24 hours
- Get User Role by ID not working
- the_author_meta(‘user_url’, $author->ID) not working properly. how can I solve this?
- Getting users by specific capability, not role
- add_cap not working with Shop Manager role
- show text If special user is logged
- Upgrade Nightmare – No Posts, Permissions Issues and Can’t Create a new post
- remove/hide pages from users backend
- Are User Levels Still Currently Used?
- Error: How to allow the “contributor” to upload media in wordpress
- Allow user access to Dashboard only!
- Restrict access of admin uploads to certain logged-in users?
- Remove Capabilities from WP admin for specific user role
- Updating wp_user_level on user update
- Fix permissions for users role
- User capability for editing their own comments
- What are some best practices for user exit strategy?
- Is there a way to identify a user in a custom REST API method? [duplicate]
- Reset Password policy
- Allow Contributors to Upload Files
- Is possible to allow user to login with different role?
- Add a role and give admin priviledges
- Create custom post with custom user rules
- How change user type from contributor to author
- How do I let contributors edit their posts after being approved once?