[wp-trac] [WordPress Trac] #50790: REST API: Allow sending empty array to remove all values for single = false meta

WordPress Trac noreply at wordpress.org
Mon Jul 27 17:57:37 UTC 2020


#50790: REST API: Allow sending empty array to remove all values for single = false
meta
----------------------------+-----------------------------
 Reporter:  chrisvanpatten  |      Owner:  (none)
     Type:  defect (bug)    |     Status:  new
 Priority:  normal          |  Milestone:  Awaiting Review
Component:  REST API        |    Version:
 Severity:  normal          |   Keywords:
  Focuses:  rest-api        |
----------------------------+-----------------------------
 When sending an update to a piece of content via the REST API, meta
 registered with `'single' => false` cannot be removed by sending an empty
 array; you must send `null`.

 The inability to send an empty array is slightly confusing and
 inconsistent with `array`-type meta registered with `'single' => true`,
 which will correctly save the empty value.

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


More information about the wp-trac mailing list