Changeset 42655
- Timestamp:
- 02/06/2018 02:48:46 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/option.php
r42359 r42655 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 } -
trunk/tests/phpunit/tests/option/registration.php
r42343 r42655 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 }
Note: See TracChangeset
for help on using the changeset viewer.