So i am trying to make a web shop plugin that will add all product, it will get them from an api for products i get from a supplier. Now i am trying to make an attribute programmatically with php but i cant find how i have tried a lot of code from other people but its outdated or i cant get it to work, i just want whenever I press a button that the attribute will be create just an attribute nothing more.
I have tried Create new product attribute programmatically in Woocommerce answer code (and more…).