Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

(using scribu's front-end-editor)

Currently I have several custom fields and taxonomies that appear on posts as they are created by users. Each author is able to edit only their own posts.

However, there is one taxonomy (or custom field) that needs to only be editable by admins or editors and NOT authors.

What would I need to do to disable this particular taxonomy (or custom field)?

share|improve this question
    
Currently I am using this: if (current_user_can('editor') || current_user_can('administrator')){ however, everyone is able to edit the field when set like this.. if I change it however like this if (!current_user_can('editor') || !current_user_can('administrator')){ nobody can edit it... Any ideas? –  drew Oct 25 '11 at 19:00
add comment

1 Answer

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.