Most stupid function in Wordpress?

[...]Will only output the date if the current post’s date is different from the
previous one output.

Source: the_date() function in the Wordpress source code.

WTF! Why on earth is this function only returning a date when the post date differs from the previous one and does nothing if the two are equal. I don’t get this. I guess I’m going to supply a bugreport and a patch.

2 Responses to “Most stupid function in Wordpress?”

  1. Arnoud Engelfriet Says:

    Remotely useful application: to generate “All posts of $date” overview pages. On such pages you don’t want each post to have its date appear in the template. So if you use the_date() in the template you only get it printed once.

  2. BjornW Says:

    Hi Arnoud,

    Indeed remotely useful, therefor I would opt for having a function to work out-of-the-box for most cases and allow to change this behavior in those situations as the one you described. There are probably pieces of code in the nooks and crannies of Wordpress that are even worse, but this one really caught my eye. Luckily it is FLOSS so I can change it and suggest my solution to the core Wordpress committers to patch it.

Leave a Reply