diff --git a/fivestar.module b/fivestar.module
index 0ac5567..aa64af4 100644
--- a/fivestar.module
+++ b/fivestar.module
@@ -470,7 +470,7 @@ function fivestar_expand($element) {
   $settings = $element['#settings'];
   $values = $element['#values'];
   $class[] = 'clearfix';
-
+  
   $options = array('-' => t('Select rating'));
   for ($i = 1; $i <= $element['#stars']; $i++) {
     $this_value = ceil($i * 100/$element['#stars']);
@@ -489,6 +489,11 @@ function fivestar_expand($element) {
     '#default_value' => _fivestar_get_element_default_value($element),
   );
 
+  // Check if microdata array is set
+  if (!isset($settings['microdata'])) {
+        $settings['microdata'] = array();
+  }
+  
   if (isset($element['#parents'])) {
     $element['vote']['#parents'] = $element['#parents'];
   }
@@ -502,6 +507,7 @@ function fivestar_expand($element) {
         'user_rating' => $values['user'],
         'votes' => $settings['style'] == 'dual' ? NULL : $values['count'],
         'stars' => $settings['stars'],
+	'microdata' => $settings['microdata'],
       ));
       $class[] = 'fivestar-user-text';
       break;
@@ -510,6 +516,7 @@ function fivestar_expand($element) {
         'average_rating' => $values['average'],
         'votes' => $values['count'],
         'stars' => $settings['stars'],
+	'microdata' => $settings['microdata'],
       ));
       $class[] = 'fivestar-average-text';
       break;
@@ -519,6 +526,7 @@ function fivestar_expand($element) {
         'average_rating' => $values['user'] ? NULL : $values['average'],
         'votes' => $settings['style'] == 'dual' ? NULL : $values['count'],
         'stars' => $settings['stars'],
+	'microdata' => $settings['microdata'],
       ));
       $class[] = 'fivestar-smart-text';
       $class[] = $values['user'] ? 'fivestar-user-text' : 'fivestar-average-text';
@@ -529,6 +537,7 @@ function fivestar_expand($element) {
         'average_rating' => $settings['style'] == 'dual' ? NULL : $values['average'],
         'votes' => $settings['style'] == 'dual' ? NULL : $values['count'],
         'stars' => $settings['stars'],
+	'microdata' => $settings['microdata'],
       ));
       $class[] = ' fivestar-combo-text';
       break;
diff --git a/includes/fivestar.field.inc b/includes/fivestar.field.inc
index e34d8bd..b6bf001 100644
--- a/includes/fivestar.field.inc
+++ b/includes/fivestar.field.inc
@@ -476,6 +476,11 @@ function fivestar_field_formatter_view($entity_type, $entity, $field, $instance,
       'field_name' => $instance['field_name'],
       'langcode' => $langcode,
     );
+    // If microdata module is enabled, attach the microdata attributes the module
+    // adds to the entity object.
+    if (module_exists('microdata')) {
+      $settings['microdata'] = $entity->microdata[$field['field_name']];
+    }
     $element[0] = drupal_get_form('fivestar_custom_widget', $values, $settings);
     // Our work here is done.
     return $element;
