own minifier plugin wrong approach?
-
Hi,
I am developing my first “bigger” plugin with the goal to compress and merge css/js files.
I know that there are other plugins that already do that but I want to have specific behavior, look and feel and the most important learn how to do it myself to get an understanding of how the things work.This is the setup:
Plugin file in plugin folder -> here the admin can setup the path to the js/css files that need to be compressed and change the order of what files should come first.
compress.php inside a lib folder -> when the admin hits the save button all the needed data is send to the compress.php that “do the magic”. (compressing and merging)So far so good, everything is working. But now I want to enqueue the final compressed file “automatically” in the current used theme and I have no clue how to manage that. Is it even possible? I was in the wordpress help chat before and got the hint that my approach is “wrong”.
The thing is, I know other plugins are able to do that (but they are kinda too complex for me).
Oh, “just” registering/enqueuing the files in the compress.php isn’t working. Because the file is not included in the normal “frontend”/theme and only for admins in backend.
- The topic ‘own minifier plugin wrong approach?’ is closed to new replies.