You are here

function schemaorg_contrib_preprocess_field in Schema.org 7

Implements MODULE_preprocess_HOOK().

File

modules/schemaorg_contrib/schemaorg_contrib.module, line 11
Add schema.org support for compound fields from contributed modules.

Code

function schemaorg_contrib_preprocess_field(&$variables) {
  $element = $variables['element'];
  $field_name = $element['#field_name'];

  // Address field module integration.
  if ($element['#field_type'] == 'addressfield' && $element['#formatter'] == 'addressfield_default' && !empty($element['#object']->rdf_mapping[$field_name]['predicates'])) {
    module_load_include('inc', 'schemaorg_contrib', 'schemaorg_contrib.addressfield');
    schemaorg_contrib_field_preprocess_addressfield($variables);
  }

  // Fivestar module integration.
  if ($element['#field_type'] == 'fivestar' && !empty($element['#object']->rdf_mapping[$field_name]['predicates'])) {
    module_load_include('inc', 'schemaorg_contrib', 'schemaorg_contrib.fivestar');
    schemaorg_contrib_field_preprocess_fivestar($variables);
  }
}