Make WordPress Core

Opened 11 years ago

Closed 11 years ago

#26682 closed defect (bug) (fixed)

Improve phpdocs for get_the_time and get_post_time

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

Description

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@… 11 years ago.
get_the_time, get_post_time inline docs patch
26682.diff (2.2 KB) - added by DrewAPicture 11 years ago.
Other phpdoc fixes

Download all attachments as: .zip

Change History (10)

@ruud@…
11 years ago

get_the_time, get_post_time inline docs patch

#1 @ruud@…
11 years ago

  • Keywords has-patch added

#2 @ruud@…
11 years ago

  • Cc ruud@… added

#3 @kpdesign
11 years ago

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

#4 @DrewAPicture
11 years 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 :)

@DrewAPicture
11 years ago

Other phpdoc fixes

#5 @ruud@…
11 years ago

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

#6 @nacin
11 years ago

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

#7 @nacin
11 years ago

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

#8 @DrewAPicture
11 years 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.