Skip to content

Instantly share code, notes, and snippets.

@raynimmo
Last active August 29, 2015 14:01
Show Gist options
  • Save raynimmo/9180e5e93801f40e2cab to your computer and use it in GitHub Desktop.
Save raynimmo/9180e5e93801f40e2cab to your computer and use it in GitHub Desktop.
Drupal list all content types and fields
$content_types = node_get_types();
$output = '';
foreach($content_types as $content_type => $content_type_object) {
$output .= "" . $content_type_object->name . "";
$output .= ' ';
$fields = _content_type_info();
$fields = $fields['content types'][$content_type]['fields'];
$ouput = '';
foreach ($fields as $field_name=>$field) {
$output .= $field['widget']['label'];
$output .= ' ';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment