WordPress.org

Make WordPress Core

Opened 3 years ago

Last modified 8 months ago

#13771 new enhancement

get_the_date() to accept optional $post argument

Reported by: bigdawggi Owned by:
Priority: normal Milestone: Future Release
Component: General Version: 3.0
Severity: normal Keywords: has-patch
Cc: matt@…, devin@…, b.kooij@…

Description

Currently the get_the_date() function only utilizes the global $post. Allowing this function to accept an optional $post object as an argument would be beneficial for getting the formatted date of any post.

Attachments (2)

get_the_date.diff (526 bytes) - added by bigdawggi 3 years ago.
Patch for get_the_date() to accept optional $post arg.
13771.diff (993 bytes) - added by solarissmoke 2 years ago.

Download all attachments as: .zip

Change History (8)

bigdawggi3 years ago

Patch for get_the_date() to accept optional $post arg.

comment:1 ryan3 years ago

  • Milestone changed from 3.0 to 3.1

We typically call get_post() and let it figure out whether to use the global.

No more enhancements for 3.0. Moving to 3.1.

comment:2 bigdawggi3 years ago

  • Cc matt@… added

Thanks Ryan. I agree, I was just trying to trim the extra function calls; but after review it may not be worth the investment in time to set a precedent of allowing an optional $post arg in template tags, though I'll let you guys decide ;)

comment:3 nacin3 years ago

  • Keywords needs-patch added; date removed
  • Milestone changed from Awaiting Triage to Future Release

solarissmoke2 years ago

comment:4 solarissmoke2 years ago

  • Keywords has-patch added; needs-patch removed

Also cleaned up the code/docs a bit.

comment:5 devinreams20 months ago

  • Cc devin@… added

comment:6 barrykooij8 months ago

  • Cc b.kooij@… added

When will this be added to core?

Version 2, edited 8 months ago by barrykooij (previous) (next) (diff)
Note: See TracTickets for help on using tickets.