Skip to content

Node.js based forum software built for the modern web

feat: send pids into filter:post.getFields hook

Julian Lam0e07ffa1d9b9
diff --git a/src/posts/data.js b/src/posts/data.js
index 06204ca30e..8d5ea80bed 100644
--- a/src/posts/data.js
+++ b/src/posts/data.js
@@ -21,7 +21,11 @@ module.exports = function (Posts) {
} else {
postData = await db.getObjects(keys);
}
- const result = await plugins.fireHook('filter:post.getFields', { posts: postData, fields: fields });
+ const result = await plugins.fireHook('filter:post.getFields', {
+ pids: pids,
+ posts: postData,
+ fields: fields,
+ });
result.posts.forEach(post => modifyPost(post, fields));
return Array.isArray(result.posts) ? result.posts : null;
};