Trim "Minify" inline css at runtime, expand it at edit time.
- by Scott B
My custom WP theme has a text block in the theme options panel that allows the user to create and maintain a custom css block that is applied to the site template at runtime.
I would like to trim or "minify" this content before its stored in the database, but retain all the whitespace when its presented back to the user for editing.
Would this be possible?
For example, if the user has entered the following as their custom css code...
.red {color:red;}
.green {color:green;}
.blue {color:blue;}
Then I would like to store it in the database as:
.red{color:red;}.green{color:green;}.blue{color:blue;}
But still display it as it was input (ie, retain all the white space and line breaks) when the user is editing the content via my theme options panel.