[wp-trac] [WordPress Trac] #15046: places where the_title is used instead of the_title_attribute

WordPress Trac wp-trac at lists.automattic.com
Wed Oct 6 09:43:52 UTC 2010


#15046: places where the_title is used instead of the_title_attribute
--------------------------+-------------------------------------------------
 Reporter:  drzraf        |       Owner:                 
     Type:  defect (bug)  |      Status:  new            
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Formatting    |     Version:                 
 Severity:  minor         |    Keywords:                 
--------------------------+-------------------------------------------------
Changes (by drzraf):

 * cc: raphael.droz@… (added)


Comment:

 Replying to [comment:1 nacin]:
 > I'm not sure of the purpose of get_the_author() to using the author meta
 function, but the use of the_title_attribute there looks sane.

 About the_author_meta(): themes often uses get_the_author() when they just
 want the 'display name' string (in the "title" attribute of <a>)
 The purpose of author-template_get_the_author_meta.patch is to use the
 unfiltered content in the_author_posts_link() of author-template.php
 Thus, doing the following
 {{{
 add_filter('the_author', 'hook');
 function hook($author) {
    return "<span rel='sioc:has_creator'>$author</span>";
 }
 }}}
 doesn't put garbage in <a> @title.

 > Only thing is, we'll want to remove our esc_attr(). Also, maybe we take
 all of that logic (the anchor text too) and make it less redundant, that
 way we're not calling it so many times.

 I'm not sure to get it (do you have a ticket reference about this ?)
 The question I see is :
 When we want an 'unfiltered' version of the content :
 1) do we want a partly-filtered content (with only hooks about
 style|meta|... applied) ?
 2) do we want a filtered content where html is stripped ?
 3) do we want a filtered content where html is escaped ?
 4) do we want an unfiltered content coming directly from the DB ?
 ...
 As it's not quite clear for me (and I'm new to WP code) some patches here
 use 1) (changing the_title to the_title_attribute) while some others use
 3) (adding strip_tags())

 I would happily follow existing guidelines/past consideration on this
 topic if I can find them.

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


More information about the wp-trac mailing list