[wp-trac] Re: [WordPress Trac] #4477: Unfiltered post titles in Recent Comments widget

WordPress Trac wp-trac at lists.automattic.com
Sat Jun 16 13:21:17 GMT 2007


#4477: Unfiltered post titles in Recent Comments widget
---------------------------------------+------------------------------------
 Reporter:  jhodgdon                   |        Owner:  anonymous
     Type:  defect                     |       Status:  new      
 Priority:  normal                     |    Milestone:  2.2.2    
Component:  General                    |      Version:  2.2      
 Severity:  normal                     |   Resolution:           
 Keywords:  widget, filter, has_patch  |  
---------------------------------------+------------------------------------
Comment (by jhodgdon):

 Ah. That would certainly make my life easier, if all of the get_the_xyz
 functions had the filters built into them, or at least get_the_title. But
 I'm also wondering if it's a little dangerous to change the behavior of
 all the get_xyz functions at this point, given that plugins/themes could
 conceivably be using them for something. They've been unfiltered for quite
 a while.

 I checked on the get_the_title() function in [5718] and it looks like
 putting the filters in it would help all but one of the 22 uses of the
 function in the core, rather than hurting anything. The one place I wasn't
 sure about was in the_title, which puts $before and $after onto the title
 text before filtering. I suppose a $filter=true argument could be added to
 get_the_title to take care of that.

 So, I've made a patch for get_the_title... will leave it to you to decide
 whether it would break plugins to change the behavior of get_the_title to
 filtered by default. I did apply it in my own test blog, and it didn't
 appear to break anything. Also it fixed the reported bug with the Recent
 Comments widget. Again, tested in [5718].

-- 
Ticket URL: <http://trac.wordpress.org/ticket/4477#comment:4>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list