Make WordPress Core

Opened 14 years ago

Closed 9 years ago

Last modified 9 years ago

#17455 closed enhancement (fixed)

Add $post_type argument to get_lastpostdate/get_lastpostmodified/_get_last_post_time

Reported by: duck_'s profile duck_ Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 4.4 Priority: normal
Severity: normal Version:
Component: Posts, Post Types Keywords: has-patch needs-unit-tests
Focuses: Cc:

Description

As title says. You can currently use these functions to only get the latest [modification] date of all publicly queryable content types.

Attachments (4)

17455.diff (2.9 KB) - added by duck_ 14 years ago.
17455.2.diff (3.8 KB) - added by duck_ 14 years ago.
17455.3.diff (5.8 KB) - added by SergeyBiryukov 9 years ago.
17455.4.diff (6.0 KB) - added by wonderboymusic 9 years ago.

Download all attachments as: .zip

Change History (14)

@duck_
14 years ago

#1 @duck_
14 years ago

Updated key for adding to cache, but haven't put in code for deleting it when it changes yet.

@duck_
14 years ago

#2 @duck_
14 years ago

Haven't tested the cache invalidation in an environment with a persistent cache. Also moved the call to date('Z') to where it's needed, don't need to hit the system clock if unnecessary.

Related #14922 which added a filter for a short period.

#3 @nacin
11 years ago

  • Component changed from General to Post Types

#4 @DrewAPicture
9 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed

There has been no interest or meaningful activity in four years. Closing as wontfix.

#5 @SergeyBiryukov
9 years ago

  • Keywords needs-unit-tests added
  • Milestone set to 4.4
  • Resolution wontfix deleted
  • Status changed from closed to reopened

This would make things easier for XML sitemaps in Yoast SEO.

#6 @SergeyBiryukov
9 years ago

  • Owner set to SergeyBiryukov
  • Status changed from reopened to accepted

#7 @SergeyBiryukov
9 years ago

While we're at it, the $timezone description should be synchronized between get_lastpostdate() and _get_last_post_time(), and extra or 'server'. should be removed from get_lastpostmodified().

It would probably make sense to move the extended description from get_lastpostmodified() to get_lastpostdate() (since it comes first), and then reference it in get_lastpostmodified() and _get_last_post_time().

Leaving a note here to create a separate ticket or handle this in a separate commit.

#8 @wonderboymusic
9 years ago

In 34201:

Allow get_lastpostdate(), get_lastpostmodified(), and _get_last_post_time() to accept $post_type and cache separately.

Props _duck, SergeyBiryukov.
See #17455.

#9 @wonderboymusic
9 years ago

  • Resolution set to fixed
  • Status changed from accepted to closed

In 34202:

Don't redirect to the Term list table after submitting the form on the Edit Term page.

Props chiragswadia, UmeshSingla, rhyswynne, afercia.
Fixes #17455.

#10 @SergeyBiryukov
9 years ago

In 34240:

Docs: Synchronize the $timezone parameter description between get_lastpostdate(), get_lastpostmodified(), and _get_last_post_time().

See #17455.

Note: See TracTickets for help on using tickets.