• Resolved paracetamol

    (@paracetamol)


    Hello!
    I’d like to strip a few (well, to be honest, quite a lot) fields from the editor, depending on the user. I use an alternative image uploader + Custom Fields and my author is a bit lost between a lot of fields he doesn’t really need. (Trackbacks, old uploader etc.)

    I took the edit-form-advanced.php and simply disabled those options via HTML-comments. But actually that’s a rather brute method and as the admin, I still would be able to change the timestamp and post status for example.

    How do I get the role or ID of the current user in the admin panel? I tried <?php if ($user_ID != said id) : ?>, but no avail.

Viewing 2 replies - 1 through 2 (of 2 total)
  • $user_ID *is* a global var available while in the admin pages. Try:

    <?php
    global $user_ID;
    if ($user_ID !=
    said id) :
    ?>

    Thread Starter paracetamol

    (@paracetamol)

    Thanks a lot, it worked and looks much better now!

    — some problems later .. —

    Ok, I realized I can’t skip the Custom Field dropdown as I use the Custom Field GUI for separate meta data and leaving out the regular custom field editor fucks up the whole account+cookie.

    But thanks again! I wouldn’t have figured out the global variable thing by myself.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Deactivate editor fields by role/user’ is closed to new replies.