[wp-trac] [WordPress Trac] #44975: REST API support switching draft to unscheduled

WordPress Trac noreply at wordpress.org
Thu Sep 19 22:31:45 UTC 2019


#44975: REST API support switching draft to unscheduled
-------------------------------------------------+-------------------------
 Reporter:  mnelson4                             |       Owner:
                                                 |  adamsilverstein
     Type:  feature request                      |      Status:  assigned
 Priority:  normal                               |   Milestone:  5.3
Component:  REST API                             |     Version:  4.7
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch 2nd-opinion has-unit-      |     Focuses:
  tests                                          |
-------------------------------------------------+-------------------------

Comment (by TimothyBlynJacobs):

 Uploaded a patch that supports validation for `type` being a list. Then,
 the post controller can specify that the `date/date_gmt` is a `'type' =>
 array( 'string', 'null' )`. Then, in `prepare_item_for_database` check
 that the parameter was included in the request and set to `null`.

 This introduces `WP_REST_Request::has_param` to make it simpler to check
 if a parameter with a null value was included in the request. The settings
 controller ( which also checks for null values ) works around this by
 using `array_key_exists` on the existing `::get_params()` method.

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


More information about the wp-trac mailing list