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: http://svn.automattic.com/wordpress/trunk@13745 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
dd32 2010-03-18 07:50:43 +00:00
parent d51a95d091
commit 5a5064ae61
4 changed files with 14 additions and 44 deletions

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 ] );

View File

@ -2980,6 +2980,9 @@ function get_hidden_meta_boxes($screen) {
function add_settings_section($id, $title, $callback, $page) {
global $wp_settings_sections;
if ( 'misc' == $page )
$page = 'general';
if ( !isset($wp_settings_sections) )
$wp_settings_sections = array();
if ( !isset($wp_settings_sections[$page]) )
@ -3015,6 +3018,9 @@ function add_settings_section($id, $title, $callback, $page) {
function add_settings_field($id, $title, $callback, $page, $section = 'default', $args = array()) {
global $wp_settings_fields;
if ( 'misc' == $page )
$page = 'general';
if ( !isset($wp_settings_fields) )
$wp_settings_fields = array();
if ( !isset($wp_settings_fields[$page]) )

View File

@ -193,8 +193,6 @@ $menu[80] = array( __('Settings'), 'manage_options', 'options-general.php', '',
$submenu['options-general.php'][30] = array(__('Media'), 'manage_options', 'options-media.php');
$submenu['options-general.php'][35] = array(__('Privacy'), 'manage_options', 'options-privacy.php');
$submenu['options-general.php'][40] = array(__('Permalinks'), 'manage_options', 'options-permalink.php');
if ( is_super_admin() )
$submenu['options-general.php'][45] = array(__('Miscellaneous'), 'manage_options', 'options-misc.php');
$_wp_last_utility_menu = 80; // The index of the last top-level menu in the utility menu group

View File

@ -1,42 +0,0 @@
<?php
/**
* Miscellaneous settings administration panel.
*
* @package WordPress
* @subpackage Administration
*/
/** WordPress Administration Bootstrap */
require_once('admin.php');
if ( ! current_user_can('manage_options') )
wp_die(__('You do not have sufficient permissions to manage options for this blog.'));
$title = __('Miscellaneous Settings');
$parent_file = 'options-general.php';
include('admin-header.php');
?>
<div class="wrap">
<?php screen_icon(); ?>
<h2><?php echo esc_html( $title ); ?></h2>
<form method="post" action="options.php">
<?php settings_fields('misc'); ?>
<table class="form-table">
<?php do_settings_fields('misc', 'default'); ?>
</table>
<?php do_settings_sections('misc'); ?>
<p class="submit">
<input type="submit" name="Submit" class="button-primary" value="<?php esc_attr_e('Save Changes') ?>" />
</p>
</form>
</div>
<?php include('./admin-footer.php'); ?>