WordPress.org

Make WordPress Core

Opened 4 months ago

Closed 3 months ago

#40845 closed defect (bug) (fixed)

Incomplete `get_the_modified_(date|time)` filter docs

Reported by: dlh Owned by: DrewAPicture
Milestone: 4.9 Priority: normal
Severity: normal Version: 4.6
Component: General Keywords: has-patch
Focuses: docs Cc:

Description

Both get_the_modified_date() and get_the_modified_time() set the $post variable to the return value of get_post(). As noted in code comments within each function, For backward compatibility, failures go through the filter below (see [37866]). However, the "official" filter docs don't specify that null is a possible type for $post. The attached patch would amend the filter docs to include that note.

Attachments (2)

40845.diff (1.8 KB) - added by dlh 4 months ago.
40845.2.diff (1.8 KB) - added by dlh 4 months ago.

Download all attachments as: .zip

Change History (5)

@dlh
4 months ago

@dlh
4 months ago

#1 @dlh
4 months ago

40845.2.diff also amends docs for $the_time to note the possible bool value.

#2 @DrewAPicture
3 months ago

  • Keywords has-patch added
  • Milestone changed from Awaiting Review to 4.9

@dlh Thanks buddy, looks good :-)

#3 @DrewAPicture
3 months ago

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

In 40946:

Docs: Clarify that the $post parameters for the get_the_modified_date and get_the_modified_time filters can also be of type null.

Props dlh.
Fixes #40845.

Note: See TracTickets for help on using tickets.