Loop all content type field

WE HAVE MOVED!

Please visit our new Drupal Website at https://www.xenyo.com我們的新網頁設計公司網頁.

  $contentinfo = node_type_get_types();
  foreach ($contentinfo as $content_type) {
    $field_instances = field_info_instances('node', $content_type->type);
    $allow_field = array();
    foreach ($field_instances as $field) {
      if ($field['widget']['module'] == 'image' || $field['widget']['module'] == 'file') {
        $allow_field[$field['field_id']] = t($field['field_name']);
      }
    }
    //.................................
   }
Help Share this Article