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

WordPress Trac noreply at wordpress.org
Mon Mar 20 12:50:04 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:5 jnylen0]:
 > It sounds like this is probably already happening during any normal post
 update, no?

 Upon a closer look, we
 [https://core.trac.wordpress.org/browser/tags/4.7.3/src/wp-includes/rest-
 api/endpoints/class-wp-rest-posts-
 controller.php?marks=669,676,710-712#L669 never pass] `page_template` to
 `wp_update_post`, so
 [https://core.trac.wordpress.org/browser/tags/4.7.3/src/wp-
 includes/post.php#L3406 its logic] for updating a page template is never
 triggered by the API.

 So this looks like a pretty straightforward change to me, only touching
 `WP_REST_Posts_Controller::handle_template`.  @swissspidy do you agree or
 is there something I'm missing here?

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


More information about the wp-trac mailing list