[wp-trac] [WordPress Trac] #47023: Allow settings option schema to be modified

WordPress Trac noreply at wordpress.org
Wed Apr 24 04:03:04 UTC 2019


#47023: Allow settings option schema to be modified
-------------------------+-----------------------------
 Reporter:  pcfreak30    |      Owner:  (none)
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  REST API     |    Version:  trunk
 Severity:  normal       |   Keywords:
  Focuses:               |
-------------------------+-----------------------------
 In WP_REST_Settings_Controller,
 {{{
 get_registered_options
 }}}
 and
 {{{
 get_item_schema
 }}}

 Seem to pull/manipulate data from
 {{{
 get_registered_settings
 }}}
 , but don't have filters and/or register_setting does not allow a schema
 for the option value.

 The use case is storing an associative array/hash of settings data in one
 option, to keep the options table tidy.

 I think the best route possibly may be for
 {{{
 register_settings
 }}}
  to allow a schema in the
 {{{
 $args
 }}}
  and that get used in the controller for validation. Another way maybe
 just a filter to inject the needed schema on the fly, but that's less than
 ideal for the use case of verifying children items inside an options data.

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


More information about the wp-trac mailing list