|Reported by:||mattwiebe||Owned by:||westi|
There should be actions that fire after a script is printed. This would enabled this best-practices usage scenario (from http://github.com/paulirish/html5-boilerplate/blob/master/index.html ):
<!-- Grab Google CDN's jQuery. fall back to local if necessary --> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script>!window.jQuery && document.write('<script src="js/jquery-1.4.2.min.js"><\/script>')</script>
The before action isn't covered by that use-case, but if we're going to have an after action, we might as well have a before one.
I've attached a patch that would allow for this. Dead simple.
Change History (15)
comment:3 @mattwiebe — 4 years ago
- Summary changed from WP_Scripts::do_item before/after actions to WP_Scripts::do_item filter
- Keywords 3.2-early added
- Owner set to westi
- Status changed from new to accepted
comment:10 @atimmer — 21 months ago
- Cc atimmermans@… added