function content_fields in Content Construction Kit (CCK) 6
Same name and namespace in other branches
- 5 content.module \content_fields()
- 6.3 content.module \content_fields()
- 6.2 content.module \content_fields()
Return a list of all fields.
Parameters
$field_name: If set, return information on just this field.
$content_type_name: If set, return information of the field within the context of this content type.
27 calls to content_fields()
- content_add_more_js in includes/
content.node_form.inc - Menu callback for AHAH addition of new empty widgets.
- content_admin_display_overview_form_submit in includes/
content.admin.inc - Submit handler for the display overview form.
- content_copy_export_form in modules/
content_copy/ content_copy.module - A form to export field definitions.
- content_field_batch_update in includes/
content.admin.inc - Content Field Batch Update Operation
- content_format in ./
content.module - Format a field item for display.
File
- ./
content.module, line 1182 - Allows administrators to associate custom fields to content types.
Code
function content_fields($field_name = NULL, $content_type_name = NULL) {
$info = _content_type_info();
if (isset($info['fields'])) {
if (!isset($field_name)) {
return $info['fields'];
}
if (isset($info['fields'][$field_name])) {
if (!isset($content_type_name)) {
return $info['fields'][$field_name];
}
if (isset($info['content types'][$content_type_name]['fields'][$field_name])) {
return $info['content types'][$content_type_name]['fields'][$field_name];
}
}
}
}