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

WordPress Trac noreply at wordpress.org
Mon Mar 20 12:43:31 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 jnylen0):

 Replying to [comment:4 swissspidy]:
 > Ideally, we fix `wp_update_post()`, remove the call to
 `handle_template()` and add a new test for this behaviour.

 Couldn't we just unset `$data['template']` from the update if it's the
 same as the current value?  This would skip both passing it to
 `wp_update_post` and calling `handle_template`.

 > the meta entry would get updated ''twice''  because the `update_item()`
 method calls `WP_REST_Posts_Controller::handle_template()`.

 It sounds like this is probably already happening during any normal post
 update, no?

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


More information about the wp-trac mailing list