mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-04 20:54:29 +00:00
Options: Unhook default option filter when setting is unregistered.
Fixes #43207. git-svn-id: https://develop.svn.wordpress.org/trunk@42655 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -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 ] );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user