[wp-trac] [WordPress Trac] #4575: Add functions to return the last-modified timestamp of a category/tag

WordPress Trac noreply at wordpress.org
Wed Apr 22 19:02:22 UTC 2015


#4575: Add functions to return the last-modified timestamp of a category/tag
-------------------------------------------------+-------------------------
 Reporter:  delusions                            |       Owner:
     Type:  enhancement                          |      Status:  new
 Priority:  normal                               |   Milestone:  Future
Component:  Feeds                                |  Release
 Severity:  normal                               |     Version:  2.2.1
 Keywords:  good-first-bug has-patch needs-      |  Resolution:
  testing                                        |     Focuses:  template
-------------------------------------------------+-------------------------

Comment (by stevenkword):

 Replying to [comment:20 MikeNGarrett]:
 > This looks really good. We'll have to replicate this for the other feed
 types once we get a final version.
 >
 > Here's another question: would you need to make another db query to get
 the last modified posts? You already have a list of posts, so instead of
 building an array of IDs you should be able to build an array of
 post_modified values and return the latest.

 Good catch.  I could have sworn the WP_Query object excluded
 post_modified_gmt, but I double-checked and sure enough its there.

 In 4575_2.diff I've been able to minimize the number of calls to the
 database by extracting the post IDs and last modified times from WP_Query.
 However, I still had to perform an extra lookup on comment feeds.

 > I would only have 2 concerns if we went that direction:
 > 1. What happens when feeds are not sorted by latest?

 Since this is using PHP/MySQL max functions, this should sort itself out.

 > 2. Should we be concerned about pagination?

 I don't think we need to worry about it.  Page 2 will show the last time
 page 2 was updated since it will always be based on the content displayed.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/4575#comment:21>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list