[wp-trac] [WordPress Trac] #60266: get_the_modified_date function doesn't return the date for newly published posts

WordPress Trac noreply at wordpress.org
Tue Jan 16 14:32:37 UTC 2024


#60266: get_the_modified_date function doesn't return the date for newly published
posts
--------------------------+-----------------------------
 Reporter:  bugnumber9    |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Date/Time     |    Version:
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 When a new post is published, both `post_date` and `post_modified` columns
 contain equal values (which makes total sense).

 However, when I use `get_the_modified_date` function - it doesn't return
 anything if a post hasn't been modified after publishing. This doesn't
 make sense to me since the value is there in the database.
 So when I want to show something like "last updated" in the postmeta
 section - I first have to check if `get_the_modified_date` returns
 anything and fall back to `get_the_date` if it doesn't.

 This seems weird, why wouldn't it return the value from the database?

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/60266>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list