Is it possible, when creating a custom field, to have it

Is it possible, when creating a custom field, to have it enabled for the administrator but disabled for other roles?

  • DavidM
    • DEV MAN’s Mascot

    Interestingly enough, that Custom Field Suite plugin actually has a user role option when creating custom fields.

    I wonder, as custom field creation with it works very similar to CustomPress, would that work for you?

    CustomPress doesn't currently provide user role restrictions on custom fields, though it should be possible to remove the arrays it adds through the add_meta_boxes. It's just that there's no interface for that and it's actually a bit complex.

    -David

  • DavidM
    • DEV MAN’s Mascot

    Hiya Andrew, that's understandable. I was thinking that'd be the easiest way to go as well. There's no way to restrict the custom fields on a user role basis without code and once you're already coding, might as well code it all.

    I didn't mention any specific snippet because it depends entirely on the array of custom fields you've setup.

    That Custom Field Suite plugin does provide user role restrictions though. And it's a very nice plugin, well designed and easy to make changes right from the interface.

    Just wanted to be sure to reiterate, it's really an incredible plugin, especially in conjunction with CustomPress, which is relatively lightweight with regard to custom fields.

    -David

  • DavidM
    • DEV MAN’s Mascot

    Hi @AndrewTraub,

    Sounds great! Please feel free to link to that here, I'd love to have a look myself if it'll be open-sourced. Or even if it'll be a premium plugin, would love to see how that all works out for ya. :slight_smile:

    Cheers,
    David

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.