[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
Sat Jan 7 18:52:57 UTC 2017


#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        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------

Comment (by JPry):

 Replying to [comment:2 jnylen0]:
 > Proposed solution for this ticket:
 >
 > - Always allow the standard post formats to be set; show them as part of
 the `format` enum in the arguments and schema.
 > - Additionally allow the current post format to be set, even if the
 theme does not support it.  This should be a no-op.

 [comment:6 jnylen0]:
 > We need consensus on an approach, and we need a patch with unit tests.
 I still think the approach I outlined in comment:2 is sensible.

 I think I'm +1 to your first bullet point. However, I don't agree with the
 second bullet point. Instead, I agree with this:

 [comment:4 Drivingralle]:
 > But a post_format not used by the current theme, but supported by core
 is not a wrong/broken piece of information. It's just not used at this
 point in time.

 I think it makes sense to still set the post format, even if the theme
 doesn't support their use. If a theme isn't using post formats, or isn't
 using certain kinds of post formats, then it should just ignore them.

 However, I disagree with this portion from [comment:4 Drivingralle]:
 > If a theme adds a custom post_format the API should validate the value
 correct. And after a theme switch the format is gone because it's part of
 the theme. The default formats are still inside WP.

 Themes aren't supposed to add their own custom post formats. By extension,
 I don't think that the API should support any "custom" post formats.
 Although, if others decided that it '''should''', then we could put a
 filter in place where the post formats are added to the enum field.

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


More information about the wp-trac mailing list