Make WordPress Core

#26682 closed defect (bug) (fixed)

Improve phpdocs for get_the_time and get_post_time

Reported by: ruud@… Owned by: DrewAPicture
Milestone: 3.9 Priority: normal
Severity: normal Version:
Component: Posts, Post Types Keywords: has-patch commit
Focuses: docs, template Cc:


get_the_time utilizes get_the_post, get_the_post uses mysql2date, mysql2date can return a string or an int in the specific case that an Unix timestamp is requested.

( * @return string|int Formatted date string, or Unix timestamp. )

In the added patch I've changed the inline documentation to better reflect that possibility.

Of course via the filters they can return also other types.., but I don't know how that is supposed to be handled with the inline docs.

Attachments (2)

get_the_time_inline_docs.patch (1.1 KB) - added by ruud@… 22 months ago.
get_the_time, get_post_time inline docs patch
26682.diff (2.2 KB) - added by DrewAPicture 21 months ago.
Other phpdoc fixes

Download all attachments as: .zip

Change History (10)

@ruud@…22 months ago

get_the_time, get_post_time inline docs patch

comment:1 @ruud@…22 months ago

  • Keywords has-patch added

comment:2 @ruud@…22 months ago

  • Cc ruud@… added

comment:3 @kpdesign22 months ago

  • Type changed from enhancement to defect (bug)
  • Version 3.8 deleted

comment:4 @DrewAPicture21 months ago

  • Keywords commit added
  • Milestone changed from Awaiting Review to 3.9
  • Summary changed from get_the_time and get_post_time both say to only return a string when in fact they can also return an int. to Improve phpdocs for get_the_time and get_post_time

26682.diff also fixes some other issues with the phpdocs for these two functions. Might as well fix them while we're in there :)

@DrewAPicture21 months ago

Other phpdoc fixes

comment:5 @ruud@…21 months ago

Thanks DrewAPicture, for picking this up.
Does this mean its actually getting into version 3.9? :)

comment:6 @nacin21 months ago

  • Component changed from Inline Docs to Template
  • Focuses docs added

comment:7 @nacin20 months ago

  • Component changed from Template to Posts, Post Types
  • Focuses template added

comment:8 @DrewAPicture20 months ago

  • Owner set to DrewAPicture
  • Resolution set to fixed
  • Status changed from new to closed

In 27148:

Improve inline documenation for get_the_time() and `get_post_time().

Props ruud@joyo for the initial patch.
Fixes #26682.

Note: See TracTickets for help on using tickets.