redux-framework icon indicating copy to clipboard operation
redux-framework copied to clipboard

Run The CSS Compiler on wpmu_new_blog action

Open Kieran-Calvert opened this issue 9 years ago • 4 comments

Hi Guys

Sorry if this id the wrong place to post this but cannot find the Premium Support page

At present I have the compiler creating and and saving to an individual CSS files for each site in multisite. This works perfectly. When I create a new site however I have to press save in Redux to create the new CSS file as it does not exist.

So I need to run the compiler to create a CSS file when a new site is created. I presume I can do this on the add_action('wpmu_new_blog') action. But how do I make Redux run the save/compiler hook?

Thanks for your help

Kieran

Kieran-Calvert avatar Oct 26 '17 12:10 Kieran-Calvert

Unfortunately, the compiler was never designed to do what you want here. it was only ever designed to fire on save. What would accomplish this is the output arg. And from a design perspective - just to offer advice based on experience - dumping to a file and loading in the browser is less effective than outputting to page. The only option is to have a default css file that will be overridden, if you stay this route. Sorry I can;t be more helpful.

kprovance avatar Oct 27 '17 03:10 kprovance

Hi

Thanks for you advice. Taken on board.

Just before I try the solution you recomended: Is there perhaps a way to make Redux run its save function and this in turn would pass the CSS to the compiler function?

Thanks again

Kieran

Kieran-Calvert avatar Oct 27 '17 05:10 Kieran-Calvert

Without a major rewrite of various functions? I don;t think so. We'd need thousands of dollars in financial backing...and no one seems interested in giving back to Redux. it is what it is.

If you want to put in that kind of work and submit a pull request, it's very welcome, although very carefully vetted. ;-)

kprovance avatar Oct 27 '17 05:10 kprovance

Hi Thanks for the update.

As a workaround I stored the CSS in an option that is used until Redux is updated. I read on the blog last week that Redux 4 is on it's way?

I really hope the project is continued. I would imagine the Redux Pro idea would be a no brainer to purchase.

Anyway thanks again.

K

Kieran-Calvert avatar Nov 05 '17 14:11 Kieran-Calvert