Skip to:
Content

bbPress.org

Opened 18 years ago

Closed 18 years ago

Last modified 18 years ago

#790 closed enhancement (wontfix)

enhancement proposal "bb_inject script" to suppliment bb_enqueue_script

Reported by: _ck_'s profile _ck_ 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.

Change History (3)

#1 @sambauers
18 years ago

  • Milestone set to 0.8.5 & XML-RPC

#2 @mdawaffe
18 years ago

  • Resolution set to wontfix
  • Status changed from new to closed

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.

#3 @mdawaffe
18 years ago

  • Milestone 1.0-beta & XML-RPC deleted
Note: See TracTickets for help on using tickets.