[wp-trac] [WordPress Trac] #35874: XMLRPC: Draft posts are published immediately when changed to published and future-dated at once

WordPress Trac noreply at wordpress.org
Fri Mar 11 21:59:32 UTC 2016


#35874: XMLRPC: Draft posts are published immediately when changed to published and
future-dated at once
--------------------------------------+--------------------------
 Reporter:  redsweater                |       Owner:  rachelbaker
     Type:  defect (bug)              |      Status:  assigned
 Priority:  normal                    |   Milestone:  4.5
Component:  XML-RPC                   |     Version:  4.4
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+--------------------------

Comment (by redsweater):

 Please consider the updated patch
 https://core.trac.wordpress.org/attachment/ticket/35874/xmlrpc-based-fix-
 and-test.patch.

 The key insight here is that the test in wp_update_post that determines
 whether to clear the date (the crux of this problem) consults among its
 tests the value of $postarr['edit_date'] which is always missing on calls
 originating from XMLRPC. The value appears to be a flag set by the wp-
 admin interface specifically to indicate whether a change of date was
 specified by the user.

 It seems reasonable then, to adapt XMLRPC to supply this value when it
 makes edits, so that the same logic that prevents dates being reset for
 wp-admin edits will also apply to scenarios where the API can tell that an
 explicit date has been specified.

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


More information about the wp-trac mailing list