How do I write into a file (css)

I’m writing my first wp plugin and I have many problems, most of those I got to solve by just reading the codex, but I don’t know how to write into a css file within my plugin’s options. Maybe there’s a better way of doing it, but what I had in mind was using a text field and saving that into an empty custom.css file that would be packed with the plugin. I don’t want having to save css info into the wp_options table. Is there a standardized way of having custom css for your plugins which could be changed by the user without having to open the css file themselves??

Thanks in advance

Related posts

Leave a Reply

1 comment

  1. What’s wrong with saving CSS to the database? That is the correct approach. And that way, you can simply output the options to a function, which can be enqueued properly, using wp_print_styles, and entirely avoid file operations/writing to .css files.