You are here

function _microdata_get_schema_url in Microdata 7

Helper function.

Gets an array of attributes for the Schema URL.

@todo Remove this function once Google recognizes itemid.

1 call to _microdata_get_schema_url()
microdata_mapping_to_attributes in ./microdata.module
Converts a mapping array to an attibute array.

File

./microdata.module, line 1131

Code

function _microdata_get_schema_url($entity_type, $entity) {
  $entity_uri = entity_uri($entity_type, $entity);

  // Ensure the options parameter is an array.
  if (!isset($entity_uri['options']) || !is_array($entity_uri['options'])) {
    $entity_uri['options'] = array();
  }
  return array(
    '#attributes' => array(
      'href' => url($entity_uri['path'], $entity_uri['options']),
      'itemprop' => 'url',
    ),
  );
}