[wp-trac] [WordPress Trac] #13078: Make wp_register_style and wp_enqueue_style consistent

WordPress Trac wp-trac at lists.automattic.com
Thu Apr 22 01:08:39 UTC 2010


#13078: Make wp_register_style and wp_enqueue_style consistent
--------------------------+-------------------------------------------------
 Reporter:  koopersmith   |       Owner:            
     Type:  defect (bug)  |      Status:  new       
 Priority:  normal        |   Milestone:  Unassigned
Component:  General       |     Version:  3.0       
 Severity:  minor         |    Keywords:  has-patch 
--------------------------+-------------------------------------------------
 When fixing #13056, I noticed that wp_register_style and wp_enqueue_style
 had a few odd differences.

 1. Enqueue truncates the $handle variable after the first '?' while
 register (and all other wp_style functions) accept any string.

 2. Register set the default for $media to 'all', while enqueue set it to
 false. (fixed in the #13056 patch).

 Moreover, since the two functions are practically the same, I've grouped
 them together in a private _wp_register_style function with an additional
 $enqueue boolean. Both enqueue and register call _wp_register_style.

 I've omitted the truncate behavior mentioned above. If there's any reason
 for it in one, and not the other, or in both, feel free to correct me.

 We could also just remove the truncate behavior from enqueue. It's a minor
 patch, and comes down to coding style.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/13078>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list