I`ve tried to find a solution to my problem, but I couldn`t solve it using the existing code. So i`ve created some changes and made a pull request that can be seen here:
https://github.com/wocommunity/wonder/pull/736.
I`d be really thankful if you could review my code to suggest some possible improvements.
Thank you all.