[wp-trac] [WordPress Trac] #20836: wp_add_inline_style does not work with concatenated stylesheets

WordPress Trac wp-trac at lists.automattic.com
Mon Jun 4 18:57:38 UTC 2012


#20836: wp_add_inline_style does not work with concatenated stylesheets
--------------------------+------------------------------
 Reporter:  stephenh1988  |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  General       |     Version:  3.3.2
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |
--------------------------+------------------------------
Changes (by stephenh1988):

 * cc: stephen@… (added)
 * keywords:   => has-patch


Comment:

 The additional scripts are stored in an array in
 `$styles->registered[$handle]->extra`. Usually this is imploded before
 printing to the document however, in the case of concatenated scripts
 there are not.

 See `do_item` method of the `WP_Styles` method. In particular line 48-57:
 https://github.com/WordPress/WordPress/blob/3.3.2/wp-includes/class.wp-
 styles.php#L48

 `$this->get_data( $handle, 'after' );` is appended to the code to be
 printed. However `$this->get_data( $handle, 'after' );` either returns an
 array (if there is additional code) or false otherwise. This needs to be
 imploded before being appended to the code.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/20836#comment:1>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list