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?
- WordPress Theme file editor – error with sleep() php function
- Restricting page by user role
- Hide ID for WordPress User Role Subscriber
- Prevent render in editor via PHP
- Vertical Menu for one page only
- make an array in wordpress cusmization api?
- How can I export data without using any import/export plugin
- Not able to add new item in wordpress home page
- Bootstrap Carousel Indicators Won’t Cycle On Custom WordPress Theme
- Advanced WordPress SQL Query
- Use header option on wp-login page with a second logo
- Display specific main Sub Nav on Woocommerce product pages
- How to have more than one ID included in the exclude command?
- Error when saving wordpress
- How to send logs to plugin owner for a plugin?
- Position a repeated article blocks
- Search for images that width and height is more than 500
- Where to check in PHPmyAdmin / SQL database for subdomain
- Editable Student file associated with basic User ID
- How do I get object if class is instantiated only like this new classname()
- Multisite – Display different header content based on which site is accessed
- How to change query string with pretty URL in WordPress using .htaccess file