I am writing a wordpress plugin for Wordpress designers that enables a dev to incorporate my very own icons within their theme at any time.

The problem is the fact that I can not control when they are likely to require/make use of the widget code - which itself might necessitate the inclusion of exterior js/css files.

I believe the chances are individuals will call these icons frequently after wordpress_mind() has performed, meaning any js/css inclusions which go using the particular widget they have known as can get added inline (or, in to the footer basically write it this way).

I can not predict in advance which icons they may use to make certain the assets are incorporated in an earlier juncture - and so far as i understand, i can not ensure they finish up within the [mind] lacking changing the output buffer having a preg_replace later on.

So my real question is really two-fold: Should you be while using wordpress plugin, can you have trouble with potential assets for icons (like carousel rides, etc) being loaded inline or perhaps in the footer? (I understand non-critical js is frequently loaded within the footer, but haven't seen a convention for carrying this out with css) And when so, could it be worth changing the buffer having a preg_replace to be able to fix this problem and be sure the externals finish up within the [mind]? Or possibly a 3rd option I've not considered?

The icons themselves could be custom-made and so i can't guarantee that any scripts which go together aren't important enough to be loaded first (climax unlikely) and i am slightly concerned that changing the buffer after every page load could be inefficient.


I'd create a requirement that the pluggins should be loaded within the template or perhaps in the pluggins before wordpress_mind will get known as. It's progressively vital that you provide well structured code nowadays so offering a hack through or a method to produce bad code is IMO bad practice.

Your understanding of the replace is great, it's not necessarily a bad factor whatsoever that may allow late-binding of exterior scripts, but my suggestion stands. If wordpress requires you to definitely setup your CSS and Plug ins and Scripts prior to the wordpress-mind, why don't you want it too for the framework...

Enforcing good standards should not cause you to weary, a minimum of, the actual professional community will enjoy it, as the copy/pasters that do not really understand programming will most likely think it is frustrating and sophisticated.