[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 16:21:02 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 joehoyle):
My 2c:
> Shouldn't you be able to POST the data you got back to the server
without errors?
Broadly speaking: yes. However, there are some edgecases when this isn't
exactly possible., following to:
> Isn't it now conditional if it's based on the theme?
I think the distinction here is site wide conditional (say for the theme)
or conditional based off a specific post. Right now, it's implement as:
"Allow any of these values" (valid formats), however, if you have a non-
valid format already on the resource, then you are actually saying "Allow
any of these values, or the specific value that might already be stored
for that specific post". Right now, most of the validation is not specific
post aware.
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.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/38916#comment:9>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list