Thank you for your reply.
It is part of a wordpress press Plugin i’m making for personal use. Not the first time someone said that to me…what’s missing to make it wordpress-iesh ? Maybe the code i didnt paste? Or do I need something else? I dont get it! ??
This code is working properly outside wordpress. As for error log, for some reason, this specific error (if there is one), is not showing up on logs, or even when php debug is on. No error.