Skip to content

Instantly share code, notes, and snippets.

@dvessel
Created April 4, 2013 18:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dvessel/5312604 to your computer and use it in GitHub Desktop.
Save dvessel/5312604 to your computer and use it in GitHub Desktop.
Get all node types and information on their fields.
<?php
foreach (array_keys(field_info_instances('node')) as $node_type) {
$fields_info = field_info_instances('node', $node_type);
print $node_type . '</br>';
foreach ($fields_info as $field_name => $value) {
$field_info = field_info_field($field_name);
$field_name = $field_info['field_name'];
$type = $field_info['type'];
$module = $field_info['module'];
print "&nbsp;&nbsp;$field_name</br>";
print "&nbsp;&nbsp;&nbsp;&nbsp;type: $type</br>";
print "&nbsp;&nbsp;&nbsp;&nbsp;module: $module</br>";
}
print '</br>';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment