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:
parent
0b02d175c5
commit
17d50834af
@ -1452,6 +1452,10 @@ function unregister_setting($option_group, $option_name, $sanitize_callback = ''
|
|||||||
*/
|
*/
|
||||||
function add_option_update_handler($option_group, $option_name, $sanitize_callback = '') {
|
function add_option_update_handler($option_group, $option_name, $sanitize_callback = '') {
|
||||||
global $new_whitelist_options;
|
global $new_whitelist_options;
|
||||||
|
|
||||||
|
if ( 'misc' == $option_group )
|
||||||
|
$option_group = 'general';
|
||||||
|
|
||||||
$new_whitelist_options[ $option_group ][] = $option_name;
|
$new_whitelist_options[ $option_group ][] = $option_name;
|
||||||
if ( $sanitize_callback != '' )
|
if ( $sanitize_callback != '' )
|
||||||
add_filter( "sanitize_option_{$option_name}", $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 = '') {
|
function remove_option_update_handler($option_group, $option_name, $sanitize_callback = '') {
|
||||||
global $new_whitelist_options;
|
global $new_whitelist_options;
|
||||||
|
|
||||||
|
if ( 'misc' == $option_group )
|
||||||
|
$option_group = 'general';
|
||||||
|
|
||||||
$pos = array_search( $option_name, (array) $new_whitelist_options );
|
$pos = array_search( $option_name, (array) $new_whitelist_options );
|
||||||
if ( $pos !== false )
|
if ( $pos !== false )
|
||||||
unset( $new_whitelist_options[ $option_group ][ $pos ] );
|
unset( $new_whitelist_options[ $option_group ][ $pos ] );
|
||||||
|
@ -2980,6 +2980,9 @@ function get_hidden_meta_boxes($screen) {
|
|||||||
function add_settings_section($id, $title, $callback, $page) {
|
function add_settings_section($id, $title, $callback, $page) {
|
||||||
global $wp_settings_sections;
|
global $wp_settings_sections;
|
||||||
|
|
||||||
|
if ( 'misc' == $page )
|
||||||
|
$page = 'general';
|
||||||
|
|
||||||
if ( !isset($wp_settings_sections) )
|
if ( !isset($wp_settings_sections) )
|
||||||
$wp_settings_sections = array();
|
$wp_settings_sections = array();
|
||||||
if ( !isset($wp_settings_sections[$page]) )
|
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()) {
|
function add_settings_field($id, $title, $callback, $page, $section = 'default', $args = array()) {
|
||||||
global $wp_settings_fields;
|
global $wp_settings_fields;
|
||||||
|
|
||||||
|
if ( 'misc' == $page )
|
||||||
|
$page = 'general';
|
||||||
|
|
||||||
if ( !isset($wp_settings_fields) )
|
if ( !isset($wp_settings_fields) )
|
||||||
$wp_settings_fields = array();
|
$wp_settings_fields = array();
|
||||||
if ( !isset($wp_settings_fields[$page]) )
|
if ( !isset($wp_settings_fields[$page]) )
|
||||||
|
@ -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'][30] = array(__('Media'), 'manage_options', 'options-media.php');
|
||||||
$submenu['options-general.php'][35] = array(__('Privacy'), 'manage_options', 'options-privacy.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');
|
$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
|
$_wp_last_utility_menu = 80; // The index of the last top-level menu in the utility menu group
|
||||||
|
|
||||||
|
@ -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'); ?>
|
|
Loading…
Reference in New Issue
Block a user