# Getting tags from post in plugin 'addPostTransformCallback(...)' function?

**URL:** <https://meta.discourse.org/t/getting-tags-from-post-in-plugin-addposttransformcallback-function/83678>\
**Category:** Development\
**Created:** [March 23, 2018, 8:35pm UTC](https://meta.discourse.org/t/getting-tags-from-post-in-plugin-addposttransformcallback-function/83678 "2018-03-23T20:35:33Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Anton](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/anton/32/262773_2.png) [@Anton](https://meta.discourse.org/u/Anton)\
**Post date:** [March 23, 2018, 10:48pm UTC](https://meta.discourse.org/t/getting-tags-from-post-in-plugin-addposttransformcallback-function/83678/3 "2018-03-23T22:48:06Z")

</div>

That sounds a lot like my scenario. Basically I’m making a plugin to hide things based on whether they have a tag or not:

> [@Best way to hide specific posts for non-logged in users?](https://meta.discourse.org/t/best-way-to-hide-specific-posts-for-non-logged-in-users/83611):
>
> I have a community that often posts things they don’t want to appear to the general public, so I have the site set to disallow public access. However, this obviously makes it hard for people to get an idea of what kind of things are going on if they’re not already signed up. I’d like to be able to differentiate between posts that are ‘cool for everyone’ and those that are ‘members only’ so that I could allow anon users to at least read the posts that have been made that aren’t ‘private’. I know…

I’ll take a look at searching for the CSS, though that also seems kind of hacky. It seems like it’d be pretty easy to add the tags to the transformed post object (in `transform-post.js.es6 :: transformPost(...)`) – it seems like there’s lots of `topic` data there already. That would make this a lot less hacky 🙂

---

_[View the full topic](https://meta.discourse.org/t/getting-tags-from-post-in-plugin-addposttransformcallback-function/83678)._
