[wp-trac] [WordPress Trac] #48747: WP_Customize_Setting doesn't clean up after itself

WordPress Trac noreply at wordpress.org
Fri Nov 22 00:53:55 UTC 2019


#48747: WP_Customize_Setting doesn't clean up after itself
-------------------------------+------------------------------
 Reporter:  jon81              |       Owner:  (none)
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Customize          |     Version:  3.4
 Severity:  minor              |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:
-------------------------------+------------------------------

Comment (by jon81):

 Replying to [comment:1 dlh]:
 > is there a reason the `customize_sanitize_{$id}` filter can't be used
 instead?

 Hi! I did look into removing the filter manually, though I'd need to
 remove all filters as @westonruter mentioned above. I've also considered
 just creating a new setting as a proxy or replacing the twentytwenty
 `customize_register` hook entirely.

 Replying to [comment:2 westonruter]:
 > In any case, I suggest removing the filters. Assuming there is only a
 `sanitize_callback` you can just do:
 >
 > {{{#!php
 > <?php
 > remove_all_filters( 'customize_sanitize_header_footer_background_color'
 );
 > }}}

 Thanks! I think this is what I may end up doing.

 I imagine there isn't a great need for `WP_Customize_Setting` to clean up,
 it was just a frustrating afternoon trying to figure out why
 `remove_setting()` wasn't behaving as I expected.

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


More information about the wp-trac mailing list