#10891 closed enhancement (duplicate)
Internal support for conditional scripts (same as existing conditional style support)
Reported by: | jdub | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 2.9 |
Component: | General | Keywords: | has-patch |
Focuses: | Cc: |
Description
Although it's not exposed through the wp_enqueue_style API, you can add a conditional to the queued style (by twiddling $wp_styles) and WP_Styles::do_item will do the right thing. This is used within core to provide CSS to poopy browsers ("lt IE 7").
This patch adds similar internal-only support for script conditionals to WP_Scripts::do_item.
It might be nice to expose this in the wp_enqueue_* API at some point, but for now this will do. :-)
Attachments (1)
Change History (6)
#3
@
15 years ago
Also the current patch doesn't work when core scripts are concatenated. The conditional script has to be taken out of the concat queue and printed separately.
Note: See
TracTickets for help on using
tickets.
We discussed this in todays dev meetup and we are not sure if this is the best way to achieve the requirement here and also about how this would interact with the script concatentation so we don't think it is right for 2.9 due to the feature freeze.
Moving out to future for now.