Make WordPress Core

Opened 15 years ago

Closed 13 years ago

Last modified 13 years ago

#10891 closed enhancement (duplicate)

Internal support for conditional scripts (same as existing conditional style support)

Reported by: jdub's profile 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)

script-conditionals.diff (1011 bytes) - added by jdub 15 years ago.

Download all attachments as: .zip

Change History (6)

#1 @scribu
15 years ago

  • Milestone changed from Unassigned to 2.9

#2 @westi
15 years ago

  • Milestone changed from 2.9 to Future Release

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.

#3 @azaozz
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.

#4 @demetris
13 years ago

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

There is a newer ticket for this, which seems to have made some more progress: #16024.

Closing this one as a duplicate.

#5 @SergeyBiryukov
13 years ago

  • Milestone Future Release deleted
Note: See TracTickets for help on using tickets.