[wp-trac] [WordPress Trac] #9868: the_title(), the_content(), the_permalink(), etc inconsistencies

WordPress Trac wp-trac at lists.automattic.com
Mon May 18 22:57:21 GMT 2009


#9868: the_title(), the_content(), the_permalink(), etc inconsistencies
-------------------------+--------------------------------------------------
 Reporter:  archon810    |       Owner:            
     Type:  enhancement  |      Status:  new       
 Priority:  normal       |   Milestone:  Unassigned
Component:  General      |     Version:  2.7.1     
 Severity:  normal       |    Keywords:            
-------------------------+--------------------------------------------------
 After looking at the_title(), the_content(), and the_permalink()
 functions, I saw that all of them, at least in WP 2.7.1 by default just
 echo everything and don't return anything back.

 the_title(), however, supports a flag that says do not print and return
 instead, like so

 {{{
 the_title(null, null, false)
 }}}

 The other 2, however, don't have such flags, and such inconsistency is
 quite shocking to me.

 Indeed, a call to get_the_SOMETHING() functions could be wrapped into an
 apply_filters() function but I think it is
  - for the_content() with the 3rd flag=false and get_the_content(), it
 provides duplicate and inconsistent with other fucntions functionality
  - hacky
  - some the_SOMETHING() functions do additional processing after the
 get_the_SOMETHING() calls, for example the_content()

 I've opened a [http://stackoverflow.com/questions/879078/best-way-to-get-
 post-info-into-variables-without-displaying-them-in-wordpress Stack
 Overflow question] to get to the bottom of this but so far nobody offered
 an acceptable solution.

 A similar ticket #7166 has been closed as "wontfix" but it offered a
 different solution and was indeed superfluous.

 A solution is to allow all the_SOMETHING() functions to skip printing and
 being able to specify a flag to return data instead, like the_title()
 does. Please do not close simply because this ticket reminds you of #7166
 and instead discuss :)

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


More information about the wp-trac mailing list