In reply to Tomas Mackevicius.

On the front end, it should be relatively easy with a filter on the block itself. In the editor, I'm not sure. I don't know how you'd get whatever context you need (current post, current query, etc.). That's where I've hit problems.