Options: Unhook default option filter when setting is unregistered.

Fixes #43207.

Built from https://develop.svn.wordpress.org/trunk@42655


git-svn-id: http://core.svn.wordpress.org/trunk@42484 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Felix Arntz 2018-02-06 14:49:32 +00:00
parent 3517dc0b8b
commit f3eaddd2dc
2 changed files with 6 additions and 1 deletions

View File

@ -2182,6 +2182,11 @@ function unregister_setting( $option_group, $option_name, $deprecated = '' ) {
remove_filter( "sanitize_option_{$option_name}", $wp_registered_settings[ $option_name ]['sanitize_callback'] );
}
// Remove the default filter if a default was provided during registration.
if ( array_key_exists( 'default', $wp_registered_settings[ $option_name ] ) ) {
remove_filter( "default_option_{$option_name}", 'filter_default_option', 10 );
}
unset( $wp_registered_settings[ $option_name ] );
}
}

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.0-alpha-42653';
$wp_version = '5.0-alpha-42655';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.