A “current user can” condition should hide the entire input field.
This is a simple condition i have just checked to be sure:
<?php
if(current_user_can('administrator')) {
echo 'You are the boss';
} else {
echo 'Please Log in';
}
?>
if that kind of condition surrounding that input field it should hide it completely from user that are not the admin.
Related Posts:
- Allow Editors to edit pending posts but not draft ones
- Remove update nags for non-admins [duplicate]
- How to use nonce with front end submission form?
- wp_insert_user role not working
- How to add a class to the attachment images
- How to target with css, admin elements according to user role level?
- Remove admin bar for subscribers
- WordPress as a backend only. How to output database content on public side without WordPress?
- Editor role cannot save custom theme options
- wordpress separate registration for different roles
- Uploading video to google drive via frontend [closed]
- How to attach a uploaded video to post from front end
- Display user role Name – not slug
- ACF: Only get first row of a Repeater Field
- Multiple choice in a custom taxonomy
- Add user settings to specific roles
- How to give new users two specific user role options upon WordPress user registration
- Hiding div based on user role
- custom user role wordpress – grant guest access to edit.php without insert/update/delete
- Do not execute If User is login as Administrator or any Specific Role
- multiple taxonomy select display only one in front end
- Which PHP page is the Default Posts Page
- Add post with approval by the admin
- Creating a blog on my companies new website using WordPress but I have sidebar issues
- How to keep the capability of users and disable Gutenberg editor in WordPress?
- Shortcode for Listing Users from Meta Value?
- Array to string conversion error in PHP 7.2 when returning user role as class
- Add editor toolbar to Metabox
- create front-end users post list by specific category
- Noindex subscriber author page
- Query for user roles
- Accidentally deleted php code in WordPress website [closed]
- Wp_editor doesn’t send the required data
- How to make the WordPress Editor not accept HTML?
- How can I call a specific file (via php) by referencing the logged-in username?
- Execute PHP code only with specific user role
- Edit and delete permissions pages and posts
- How to Add a cutsom slug to my custom author role
- Execute function only for specific user roles
- Allow a user or role to view drafts and previews, but not other admin privileges?
- Creating plugin with front-end pages
- Bootstrap 4 Carosuel with ACF Repeater field
- how to create a user rule that can only manage support tickets?
- Hide payment method based on user role AND minimum cart value
- Edit a function to take different actions based on user role
- Extra editor on top of default in Custom Post Type
- Using wp_editor() when not logged stopped working
- Used a code to revoke some dashboard menus for my contributors but for some reason it’s revoked me access to the editor [closed]
- How to give custom roles the capability to edit one Menu instead of every Menu
- Add another role to a user when they click a button?
- Obtain wordpress user role
- HELP! Frontend User Profile Edit Won’t Update Email
- How to properly create multiple conditions to redirect users roles to different pages
- Echo Option Value Based On WordPress User Role
- remove public static function wp_link_dialog()
- Role exception for a settings sub menu
- Allow BBPress participant role to trash topics
- Post from front end form to post_meta
- Custom user roles doesn’t apply changes
- Front end post submissions do not get submitted in the category
- How to set up an auto delete post?
- Include administrator in author list
- How to connect database table to each registered wordpress user.
- Get author meta of all writers
- Working on fixing wp-front-end-editor, encountering undefined index
- Missing items on page
- Troubleshooting “loopback requests that take too long”
- Switch-Case and user_role
- Setting field not saving on front-end
- Forbid certain users to access a specific page
- How to improve wordpress site creation process to increase productivity.
- How to lock users account until approvation
- Frontend redirect after delete post in wordpress
- How to create a User Role and give permission to only use Web Stories plugin?
- How to create custom user role without plugin?
- Custom Admin Menu Report for Specific User ID
- How to add custom user role into wordpress
- WordPress Create New Role Just to Manage Users?
- Restricting page by user role
- Hide ID for WordPress User Role Subscriber
- Contact form redirecting to page not found on send
- adding a filter to a shortcode?
- Copyright info change in Theme Child PHP
- post meta value as shortcode parameter
- User Defined order on get_categories?
- Is the regular ajax request method safe or I should use admin-ajax.php?
- wp_mail not sending
- Is there a built-in function to generate multiple paragraph tags based on a string with new line separators?
- Find out last 7 days of upload images, last week uploaded image from Gallery and display them in different pages
- Add date before entry title in Twenty Twelve
- Make post title active
- Prevent post from being published and show error
- Problems updating nested ACF field groups
- Hide comment notification number and buttons in wp backend
- meta field for numerous links
- Where can I find the declaration of `$_wp_theme_features`?
- How I can add div to menu?
- Multiple URL from Custom post name
- Custom query_posts() parameter
- Show post in elementor based on views and specific category with query id feature in elementor