Display Suite field content type class I've created a custom field in Display Suite using this code in my module:

function mymodule_ds_fields_info($entity_type) {
$fields = array();

$fields['node']['type_label'] = array(
  'title' =&gt; t('Label'),
  'field_type' =&gt; DS_FIELD_TYPE_FUNCTION,
  'function' =&gt; 'mymodule_ds_field_type_label',
);

function mymodule_ds_field_type_label($field) {

$entity = $field['entity'];
$content = $entity-&gt;type;

return $content;
}


Now, I was able to set the content of the field to match my content type, but I also want to set a dynamic class for this field equal to that content type, for example: 

$fields['node']['type_label'] = array(
  'title' =&gt; t('Label'),
  'field_type' =&gt; DS_FIELD_TYPE_FUNCTION,
  'function' =&gt; 'mymodule_ds_field_type_label',
  'class' =&gt; 'CONTENTTYPE',
);


Or:

function mymodule_ds_field_type_label($field) {

  $entity = $field['entity'];
  $content = $entity-&gt;type;
  $class = $entity-&gt;type;


So the end result should be something like this:

&lt;div class="field field--name-type-label field--type-ds CONTENTTYPE"&gt;...&lt;/div&gt;


How can I do this?

Thanks in advance.
Each time Display Suite is used in content output, it's wrapped in an &lt;article&gt; element with the content type as a class. You can see below that the content type can be found as node-enterprise-blog class.



I'm not sure what your end purpose for this is, but this way you can select the element using .node-enterprise-blog .field-field-name. If you need to add a class to the field, consider using the Field Template option under DS Extras. It allows you to change the markup of each field in a view mode.