Ticket #43207: 43207.diff
File 43207.diff, 1.4 KB (added by , 7 years ago) |
---|
-
src/wp-includes/option.php
2182 2182 remove_filter( "sanitize_option_{$option_name}", $wp_registered_settings[ $option_name ]['sanitize_callback'] ); 2183 2183 } 2184 2184 2185 // Remove the default filter if a default was provided during registration. 2186 if ( array_key_exists( 'default', $wp_registered_settings[ $option_name ] ) ) { 2187 remove_filter( "default_option_{$option_name}", 'filter_default_option', 10 ); 2188 } 2189 2185 2190 unset( $wp_registered_settings[ $option_name ] ); 2186 2191 } 2187 2192 } -
tests/phpunit/tests/option/registration.php
94 94 public function test_register_deprecated_group_privacy() { 95 95 register_setting( 'privacy', 'test_option' ); 96 96 } 97 98 /** 99 * @ticket 43207 100 */ 101 public function test_unregister_setting_removes_default() { 102 register_setting( 103 'test_group', 'test_default', array( 104 'default' => 'Fuck Cancer', 105 ) 106 ); 107 108 unregister_setting( 'test_group', 'test_default' ); 109 110 $this->assertFalse( has_filter( 'default_option_test_default', 'filter_default_option' ) ); 111 } 97 112 }