diff --git a/sharethis.module b/sharethis.module
index b22d653..fd1fc8b 100644
--- a/sharethis.module
+++ b/sharethis.module
@@ -572,12 +572,13 @@ function theme_sharethis($variables) {
     // Sanitize the service code for display.
     $display = check_plain($serviceCodeName);
 
-    // Put together the span attributes.
-    $attributes = array(
-      'st_url' => $m_path,
-      'st_title' => $title,
-      'class' => 'st_' . $display . $type,
-    );
+    // Add attributes to the variables array so they can be overridden and
+    // put together the default span attributes.
+    $attributes = $variables['attributes'];
+    $attributes['st_url'] = $m_path;
+    $attributes['st_title'] = $title;
+    $attributes['class'] = 'st_' . $display . $type;
+
     if ($serviceCodeName == 'twitter') {
       if (!empty($data_options['twitter_handle'])) {
         $attributes['st_via'] = $data_options['twitter_handle'];
