[wp-trac] [WordPress Trac] #13493: Make the_date() and is_new_day work properly

WordPress Trac wp-trac at lists.automattic.com
Sat May 22 15:59:21 UTC 2010


#13493: Make the_date() and is_new_day work properly
-----------------------------+----------------------------------------------
 Reporter:  banago           |       Owner:  Otto                       
     Type:  feature request  |      Status:  new                        
 Priority:  normal           |   Milestone:  3.1                        
Component:  Template         |     Version:                             
 Severity:  normal           |    Keywords:  has-patch reporter-feedback
-----------------------------+----------------------------------------------
Changes (by filosofo):

  * keywords:  needs-patch reporter-feedback => has-patch reporter-feedback


Comment:

 If you want to print the date every iteration, just use `echo
 get_the_date();`

 Getting `the_date();` to change its behavior to do so is unnecessary, and
 it's unlikely to win support since it would upset the default behavior of
 many themes.

 Also, it makes more sense to deprecate `is_new_day()`.
  * It's never been used in core WordPress
  * One must use another function (`the_date()`) within the same block or
 it won't work.
  * Loop conditions must be the most basic or else it won't work correctly.
  * It's bad programming form and poorly named.
  * A more reliable and generally useful approach to accomplishing similar
 goals would be to use modulus on a Unix time integer. If we need syntactic
 sugar for that, then let's handle that in a new function.

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


More information about the wp-trac mailing list