feat: send pids into filter:post.getFields hook

v1.18.x
Julian Lam 6 years ago
parent 65fc06128c
commit 0e07ffa1d9

@ -21,7 +21,11 @@ module.exports = function (Posts) {
} else { } else {
postData = await db.getObjects(keys); 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)); result.posts.forEach(post => modifyPost(post, fields));
return Array.isArray(result.posts) ? result.posts : null; return Array.isArray(result.posts) ? result.posts : null;
}; };

Loading…
Cancel
Save