[wp-trac] [WordPress Trac] #55129: WP REST API - Updating "status" field on a "post" from "future" to "publish" does not work
WordPress Trac
noreply at wordpress.org
Wed Feb 9 18:32:26 UTC 2022
#55129: WP REST API - Updating "status" field on a "post" from "future" to
"publish" does not work
--------------------------+-----------------------------
Reporter: mcmwebsol | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: REST API | Version: 5.9
Severity: normal | Keywords:
Focuses: |
--------------------------+-----------------------------
When using the WP REST API's "posts" endpoint to update an existing post,
the "status" field will not update from "future" to "publish".
Example Request:
curl -X POST https://example.com/wp-json/wp/v2/posts/2742 -d
'{"status":"publish"}'
Example Response:
{"id":2742,"date":"2022-02-12T12:30:00","date_gmt":"2022-02-12T18:30:00","guid":{"rendered":"https:\/\/subdomain.wpengine.com\/?p=2742","raw":"https:\/\/subdomainagi.wpengine.com\/?p=2742"},"modified":"2022-02-09T12:30:22","modified_gmt":"2022-02-09T18:30:22","password":"","slug
":"formerly-scheduled-
test","status":"future","type":"post","link":"https:\/\/robertsonstagi.wpengine.com\/?p=2742","title":{"raw":"Formerly
Scheduled Test","rendered":"Formerly Scheduled Test"},"content":{"raw":"
fake content here<\/p>\r\n","rendered":"
fake content
here<\/p>\n","protected":false,"block_version":0},"excerpt":{"raw":"","rendered":"
fake content
here<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_yoast_wpseo_focuskw":"","_yoast_wpseo_metadesc":"","tdm_status":"","tdm_grid_status":"","_yoast_wpseo_primary_category":17,"_yoast_wpseo_focuskeywords":""},"categories":[17,13],"tags":[57],"permalink_template":"https:\/\/robertsonstagi.wpengine.com\/%postname%\/","generated_slug
":"formerly-scheduled-
test","td_post_theme_settings":"","yoast_head":"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t\n
Note that updating the status from "draft" to "publish" works (and vice
versa). Also updating the status from "future" to "draft" works (and vice
versa). Additonally, updating the date/time of a "future" status works
(at least if the date/time is in the future).
Thank you
--
Ticket URL: <https://core.trac.wordpress.org/ticket/55129>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list