[wp-trac] [WordPress Trac] #11928: Recent Comments sidebar widget (and probably others) inject unconfigurable CSS (with !important)

WordPress Trac wp-trac at lists.automattic.com
Sun Jan 17 05:35:55 UTC 2010


#11928: Recent Comments sidebar widget (and probably others) inject unconfigurable
CSS (with !important)
--------------------------+-------------------------------------------------
 Reporter:  archon810     |       Owner:            
     Type:  defect (bug)  |      Status:  new       
 Priority:  normal        |   Milestone:  Unassigned
Component:  General       |     Version:  2.9.1     
 Severity:  normal        |    Keywords:            
--------------------------+-------------------------------------------------
 I think this issue is long overdue as I saw people complaining about it
 for quite some time, myself included.

 The Recent Comments sidebar widget, the one from WP core, actually adds
 inline non-configurable css into <head>:
 {{{
 <style type="text/css">.recentcomments a{display:inline !important;
 padding:0 !important;margin:0 !important;}</style>
 }}}

 This is done in default-widgets.php.

 I think it's really bad practice because
  - it's not configurable
  - it's not removable or overridable due to !important - when I tried to
 remove the filter, I found that it had a non-unique changing name
 WP_Widget_Recent_Commentsrecent_comments_style25

 Somebody even created a blog post about this issue
 [http://webstractions.com/wordpress/remove-recent-comments-inline-styl/
 here] but the solution didn't work for me due to, most likely, changes in
 later versions of WP.

 Specifically, in my case, I need to override the padding property.

 Nacin pointed out in [11891] that other widgets and the gallery might use
 the same tactics, to combat which I would imagine plugins like
 [http://justintadlock.com/archives/2008/04/13/cleaner-wordpress-gallery-
 plugin Cleaner WP Galler] and such were created. The gallery issue might
 be kind of separate, so I'll leave it alone here.

 Thoughts?

 Thanks.

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


More information about the wp-trac mailing list