Remove CCK Fields from the Node Form
grayside — Thu, 11/12/2009 - 15:05
There is a fine tutorial on drupal.org describing How to set the disabled attribute of a CCK field on your node add/edit form. All that does is deactivate the input widget without removing the clutter. Let's get rid of the form elements entirely.
To actually remove the field from the input form, change the _mysnippet_fix_disabled() function to the following:
function _mysnippet_set_denied(&$elements) {
foreach (element_children($elements) as $key) {
if (isset($elements[$key]) && $elements[$key]) {
// Recurse through all children elements.
_mysnippet_set_denied($elements[$key]);
}
}
$elements['#access'] = FALSE;
}