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

WordPress Trac noreply at wordpress.org
Sun Dec 11 12:29:59 UTC 2016


#39232: REST API: Can't set existing post format if theme does not support it (2)
--------------------------+-----------------------------
 Reporter:  iseulde       |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  REST API      |    Version:  4.7
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 Follow up ticket on #38916.

 The schema for the post format depends on the theme. Should it be?

 Some highlights:

 Replying to [comment:4:ticket:38916 danielbachhuber]:
 > As a corollary example to consider, what should happen if you try to
 update `template` for a Page to a template value that doesn't exist in the
 theme?

 Replying to [comment:9:ticket:38916 joehoyle]:
 > We only recently changed the validation to only support the values
 allowed by the current theme (as that's broadly what the admin does),
 however I thinking maybe that was a mistake and we should always support
 _all_ the post formats in the API. Even if we fixed the validation issue,
 it's somewhat annoying that you can get a post in the API which has an
 post format that you, as an api client, never knew the existence of.

 Replying to [comment:12:ticket:38916 Drivingralle]:
 > I think the behavior to just allow the post formats of the current theme
 is bad for a long term use of user data.
 >
 > The current theme maybe doesn't support the format "aside" but the theme
 used two month later does. [[BR]]
 > If a user publishes the same content using a client via REST API
 suddenly gets different results. Because the newer posts suddenly have the
 format "aside" and the older once are "standard".
 >
 > If we always allow to set the default post formats a client can write
 the full set of information into the post. If a theme leverages the data
 or not.[[BR]]
 > This way we make it pain-free to switch themes, something we should aim
 for.
 >
 > We also allow to post comments into the API even if the theme doesn't
 show/support them.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/39232>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list