Index: nodewords.module
===================================================================
--- nodewords.module	(revision 62)
+++ nodewords.module	(working copy)
@@ -2,6 +2,33 @@
 /* $Id: nodewords.module,v 1.48.4.27 2008/03/07 16:34:02 robrechtj Exp $ */
 
 /**
+ * Invoke a hook_nodewords() operation in all modules.
+ *
+ * @param &$tags
+ *   A tags object.
+ * @param $op
+ *   A string containing the name of the nodeapi operation.
+ * @param $a3, $a4
+ *   Additional parameters to pass through this hook
+ * @return
+ *   The returned value of the invoked hooks.
+ */
+function _nodewords_invoke(&$tags, $op, $a3, $a4) {
+  $return = array();
+  foreach (module_implements('nodewords') as $name) {
+    $function = $name .'_nodewords';
+    $result = $function($tags, $op, $a3, $a4);
+    if (isset($result) && is_array($result)) {
+      $return = array_merge($return, $result);
+    }
+    else if (isset($result)) {
+      $return[] = $result;
+    }
+  }
+  return $return;
+}
+
+/**
  * @file
  * Assign META tags to nodes, vocabularies, terms and pages.
  */
@@ -760,6 +787,8 @@ function _nodewords_get_viewable_tags($w
 function _nodewords_prepare($type, $ids, $tags, $filtered = TRUE) {
   $settings = _nodewords_get_settings();
 
+  _nodewords_invoke($tags, 'prepare', $type, $ids);
+
   // Prepare the tags
   foreach (_nodewords_get_possible_tags() as $tag) {
     $function = 'nodewords_'. $tag .'_prepare';
