function widgeditor_elements() { $type = array(); if (user_access('use widgEditor')) { $type['textarea'] = array('#process' => array('widgeditor_process_textarea' => array())); } return $type; } function widgeditor_process_textarea($element) { $textareas[] = $element['#id']; return $element; }