[wp-trac] [WordPress Trac] #38916: REST API: Can't set existing post format if theme does not support it

WordPress Trac noreply at wordpress.org
Wed Nov 23 15:26:11 UTC 2016


#38916: REST API: Can't set existing post format if theme does not support it
--------------------------+--------------------
 Reporter:  iseulde       |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  4.7
Component:  REST API      |     Version:  trunk
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+--------------------

Comment (by danielbachhuber):

 > HTML forms don't let you omit the field without the help of JS.

 How does a HTML form handle a JSON response in the first place?

 A HTML form POSTing to an API endpoint will always need JavaScript if it
 wants to avoid displaying JSON to the end user.

 > Shouldn't you be able to POST the data you got back to the server
 without errors?

 Ideally yes, but I don't think the API can guarantee this.

 > Isn't it now conditional if it's based on the theme?

 Sure, it's conditional in the sense that any PHP code can modify the
 `enum`. Validation doesn't change from request to request though, which is
 one of the principles of REST.

 I'm open to always supporting 'standard' as a value though.

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


More information about the wp-trac mailing list