[wp-trac] [WordPress Trac] #59610: Post modified date cannot be updated through WP-CLI

WordPress Trac noreply at wordpress.org
Fri Oct 13 08:43:40 UTC 2023


#59610: Post modified date cannot be updated through WP-CLI
-------------------------------+-----------------------------
 Reporter:  shreyasikhar26     |      Owner:  (none)
     Type:  defect (bug)       |     Status:  new
 Priority:  normal             |  Milestone:  Awaiting Review
Component:  Posts, Post Types  |    Version:  6.3.3
 Severity:  normal             |   Keywords:
  Focuses:                     |
-------------------------------+-----------------------------
 As we all know, we can update post data using WP-CLI `wp post update
 <post-id>`, but if we try to update post-modified-date using the same CLI,
 the post gets updated with the current date-time rather than the passed
 date-time.

 This CLI uses `wp_update_post()` in its implementation, so to fix this, we
 need to update its implementation or update the documentation of the CLI
 which will explain that post-modified-date cannot be updated through CLI.

 Steps to reproduce this bug:
 1. Open the post on REST endpoint where **post-modified-date** will be
 visible. (for e.g. https://example.com/wp-json/wp/v2/posts/1 )
 2. Run the WP-CLI to update the post-modified-date: `wp post update <post-
 id> --post_modified='2023-10-13T10:18:04'` and reload the REST endpoint
 url.

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


More information about the wp-trac mailing list