Make WordPress Core

Opened 15 years ago

Closed 11 years ago

Last modified 11 years ago

#17455 closed enhancement (fixed)

Add $post_type argument to get_lastpostdate/get_lastpostmodified/_get_last_post_time

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

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_ 15 years ago.
17455.2.diff​ (3.8 KB ) - added by duck_ 15 years ago.
17455.3.diff​ (5.8 KB ) - added by SergeyBiryukov 11 years ago.
17455.4.diff​ (6.0 KB ) - added by wonderboymusic 11 years ago.

Download all attachments as: .zip

Change History (14)

@duck_
15 years ago

#1 @duck_
15 years ago

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

@duck_
15 years ago

#2 @duck_
15 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
13 years ago

  • Component General → Post Types

#4 @DrewAPicture
11 years ago

  • Milestone Awaiting Review
  • Resolution → wontfix
  • Status new → closed

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

#5 @SergeyBiryukov
11 years ago

  • Keywords needs-unit-tests added
  • Milestone → 4.4
  • Resolution wontfix
  • Status closed → reopened

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

#6 @SergeyBiryukov
11 years ago

  • Owner set to SergeyBiryukov
  • Status reopened → accepted

#7 @SergeyBiryukov
11 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
11 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
11 years ago

  • Resolution → fixed
  • Status accepted → 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
11 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.