i am writing a plugin that injects unescaped content (including javascript) into a post. i'm storing this content as a custom field, and am wondering if there are any built in ways to prevent users from editing specific custom fields.
|
Simply use a Custom Field with its name starting with an underscore, so it won't show up in the CF meta box, eg, It will be hidden for all roles, but if you are manipulating its value only through code, then no problem. If you need to manipulate the value on the edit screen, then you'll need a Custom Meta Box and control its appearance according to the user role. [ update: looks like this kind of field can only be entered dynamically, it dumps an error if you try in the admin interface ] |
|||||||||||
|
|
Without code, it is hard to give you anything specific. A lot depends on what you are doing and where you need to do it. In addition to what brasofilo suggested, you can always wrap individual blocks of code with
Note: the Codex page for |
|||||||
|