/ Published in: PHP

With thanks to emspace for the original code :)
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
/** * Helper function to create a content field (CCK field). * * @param $type_name * The content type for which the content field should be created. * @param $properties * An array with field type properties, that override the default ones. */ function _create_content_field($type_name, $properties) { 'label' => 'A field label', // Override in $properties 'widget_type' => '', // Override in $properties 'op' => 'Create field', 'submit' => 'Create field', 'locked' => FALSE, 'field_name' => '', // Override in $properties, lowercase underscore ); $new_field['type_name'] = $type_name; _content_admin_field_add_new_submit('_content_admin_field_add_new', $new_field); }
Comments
