[wp-trac] [WordPress Trac] #37638: Allow plugins to do comprehensive late validation of settings

WordPress Trac noreply at wordpress.org
Thu Aug 11 19:13:03 UTC 2016


#37638: Allow plugins to do comprehensive late validation of settings
-------------------------+--------------------
 Reporter:  westonruter  |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  4.7
Component:  Customize    |     Version:  trunk
 Severity:  normal       |  Resolution:
 Keywords:  has-patch    |     Focuses:
-------------------------+--------------------

Comment (by chandrapatel):

 Hello @westonruter

 I am seeing the problem with Option-1 solution is possible same filter
 apply twice from different files if developer didn't create subclass of
 `WP_Customize_Setting`.

 In Option-2 solution, `customize_setting_validities` is new filter which
 also allow developer to validate setting.

 So developer either do validation by adding filter on
 `customize_validate_{$setting->id}` or `customize_setting_validities`.

 Another solution is add `customize_validate_{$setting->id}` filter inside
 `WP_Customize_Manager::validate_setting_values()` and remove from
 `WP_Customize_Setting::validate()`, so developer can use only one filter
 to validate setting and no need to introduce of new filter.

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


More information about the wp-trac mailing list