[wp-trac] [WordPress Trac] #39996: Grant clients more liberty in setting 'template' attribute

WordPress Trac noreply at wordpress.org
Fri Mar 17 11:36:13 UTC 2017


#39996: Grant clients more liberty in setting 'template' attribute
------------------------------------------+--------------------
 Reporter:  danielbachhuber               |       Owner:
     Type:  defect (bug)                  |      Status:  new
 Priority:  normal                        |   Milestone:  4.7.4
Component:  REST API                      |     Version:
 Severity:  normal                        |  Resolution:
 Keywords:  needs-patch needs-unit-tests  |     Focuses:
------------------------------------------+--------------------

Comment (by swissspidy):

 It's a bit of a mess it seems.

 `WP_REST_Posts_Controller::update_item()` calls `wp_update_post()`, which
 doesn't allow you to update the post's template to the current value. If
 you'd change that, the meta entry would get updated ''twice''  because the
 `update_item()` method calls
 `WP_REST_Posts_Controller::handle_template()`.

 Ideally, we fix `wp_update_post()`, remove the call to `handle_template()`
 and add a new test for this behaviour.

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


More information about the wp-trac mailing list