Remove Options -> Misc entirely as core as there are no longer options left there. Plugin registered options will be redirected to the General settings page. Fixes #12437

git-svn-id: https://develop.svn.wordpress.org/trunk@13745 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dion Hulse
2010-03-18 07:50:43 +00:00
parent 0b02d175c5
commit 17d50834af
4 changed files with 14 additions and 44 deletions
+8
View File
@@ -1452,6 +1452,10 @@ function unregister_setting($option_group, $option_name, $sanitize_callback = ''
*/
function add_option_update_handler($option_group, $option_name, $sanitize_callback = '') {
global $new_whitelist_options;
if ( 'misc' == $option_group )
$option_group = 'general';
$new_whitelist_options[ $option_group ][] = $option_name;
if ( $sanitize_callback != '' )
add_filter( "sanitize_option_{$option_name}", $sanitize_callback );
@@ -1468,6 +1472,10 @@ function add_option_update_handler($option_group, $option_name, $sanitize_callba
*/
function remove_option_update_handler($option_group, $option_name, $sanitize_callback = '') {
global $new_whitelist_options;
if ( 'misc' == $option_group )
$option_group = 'general';
$pos = array_search( $option_name, (array) $new_whitelist_options );
if ( $pos !== false )
unset( $new_whitelist_options[ $option_group ][ $pos ] );