#790 closed enhancement (wontfix)
enhancement proposal "bb_inject script" to suppliment bb_enqueue_script
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | low | |
| Severity: | minor | Version: | |
| Component: | Back-end | Keywords: | |
| Cc: |
Description
I've noticed that several plugins use bb_enqueue_script to add little micro scraps of javascript to bbpress.
The problem is this can make a page have up to 20 external files in some circumstance - and considering that almost every extra feature in bbpress is a plugin, this can only get worse over time (like some wordpress installs). Some browsers and some servers don't even properly cache these kinds of files causing countless extra hits.
Instead of just adding it as an external, I'd like to see an additional option on bb_enqueue_script to actually inject it into the <head></head> area directly or a separate function (ie. bb_inject script).
Of course this can be done with a bit of extra code by a plugin author by appending to the header hook but why not make it easy and standardized.
I think bb_head and bb_admin_head are fine for this.
my_js_func() { ?> <script type="text/javascript"> /* <![CDATA[ */ ... /* ]]> */ </script> <?php } add_action( 'bb_head', 'my_js_func' );How would a new function make it easier? Reopen with more detail if it still interests you.