Hi Dennis,
We don’t currently have a way for you to hook in and do this but it wouldn’t be too hard to add. Have a look at the compress_css and compress_js functions. If you manage to get it working send through your changes.
Hi,
I just got it working. I simply added a filter “modify_js_output_before_save” into line 724 of merge-minify-refresh.php:
if($should_minify)
{
// FILTER OUTPUT
if($ext == 'js') $output = apply_filters( 'modify_js_output_before_save', $output );
I’m not sure it is the best position for that filter, but it’s working flawlessly. It’s fired after the merge, and before the save.
In my particular case I had to disable JS Minification in the plugin’s settings since my obfuscation is messing up with minified files. Luckily the obfuscated code is even more compressed than a regular minified file.
I hope to see the filter in one of the upcoming versions.
Thanks again!
Dennis
Thanks Dennis,
I have released the new version of MMR with your filter. I made a small change which allowed css to be filtered as well and moved the filter just before the check if MMR should minify the file. This will allow your filter to run even if MMR minification is turned off.
Updated and works. Thanks again!