Quantcast
Channel: Zenphoto forum
Viewing all articles
Browse latest Browse all 2917

gjr on "A way to call plugin assets only when needed"

$
0
0

Just a discussion starter, or maybe there is already a way to do this that I am missing. Developing a plugin, and would like to add script/css links in the header when needed, using the applicable filter. However, I do not need to load these on most pages, but it could be variable, so I cannot simply check the $zp_current_page in the plugin file. Any suggestions on another way?

Even core extensions load all their scripts/css on pages when not necessary. For example, on my index page, I am loading rating and comment pagination js and css when it will never be needed.


Viewing all articles
Browse latest Browse all 2917

Trending Articles