<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul, pre { overflow: auto; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<title>[13745] trunk/wp-admin: Remove Options -&gt;
  Misc entirely as core as there are no longer options left there.</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/13745">13745</a></dd>
<dt>Author</dt> <dd>dd32</dd>
<dt>Date</dt> <dd>2010-03-18 07:50:43 +0000 (Thu, 18 Mar 2010)</dd>
</dl>

<h3>Log Message</h3>
<pre>Remove Options -&gt; Misc entirely as core as there are no longer options left there. Plugin registered options will be redirected to the General settings page. Fixes <a href="http://trac.wordpress.org/ticket/12437">#12437</a></pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminincludespluginphp">trunk/wp-admin/includes/plugin.php</a></li>
<li><a href="#trunkwpadminincludestemplatephp">trunk/wp-admin/includes/template.php</a></li>
<li><a href="#trunkwpadminmenuphp">trunk/wp-admin/menu.php</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkwpadminoptionsmiscphp">trunk/wp-admin/options-misc.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadminincludespluginphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/plugin.php (13744 => 13745)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/plugin.php        2010-03-18 07:17:55 UTC (rev 13744)
+++ trunk/wp-admin/includes/plugin.php        2010-03-18 07:50:43 UTC (rev 13745)
</span><span class="lines">@@ -1452,6 +1452,10 @@
</span><span class="cx">  */
</span><span class="cx"> function add_option_update_handler($option_group, $option_name, $sanitize_callback = '') {
</span><span class="cx">         global $new_whitelist_options;
</span><ins>+
+        if ( 'misc' == $option_group )
+                $option_group = 'general';
+
</ins><span class="cx">         $new_whitelist_options[ $option_group ][] = $option_name;
</span><span class="cx">         if ( $sanitize_callback != '' )
</span><span class="cx">                 add_filter( &quot;sanitize_option_{$option_name}&quot;, $sanitize_callback );
</span><span class="lines">@@ -1468,6 +1472,10 @@
</span><span class="cx">  */
</span><span class="cx"> function remove_option_update_handler($option_group, $option_name, $sanitize_callback = '') {
</span><span class="cx">         global $new_whitelist_options;
</span><ins>+
+        if ( 'misc' == $option_group )
+                $option_group = 'general';
+
</ins><span class="cx">         $pos = array_search( $option_name, (array) $new_whitelist_options );
</span><span class="cx">         if ( $pos !== false )
</span><span class="cx">                 unset( $new_whitelist_options[ $option_group ][ $pos ] );
</span></span></pre></div>
<a id="trunkwpadminincludestemplatephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/template.php (13744 => 13745)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/template.php        2010-03-18 07:17:55 UTC (rev 13744)
+++ trunk/wp-admin/includes/template.php        2010-03-18 07:50:43 UTC (rev 13745)
</span><span class="lines">@@ -2980,6 +2980,9 @@
</span><span class="cx"> function add_settings_section($id, $title, $callback, $page) {
</span><span class="cx">         global $wp_settings_sections;
</span><span class="cx"> 
</span><ins>+        if ( 'misc' == $page )
+                $page = 'general';
+
</ins><span class="cx">         if ( !isset($wp_settings_sections) )
</span><span class="cx">                 $wp_settings_sections = array();
</span><span class="cx">         if ( !isset($wp_settings_sections[$page]) )
</span><span class="lines">@@ -3015,6 +3018,9 @@
</span><span class="cx"> function add_settings_field($id, $title, $callback, $page, $section = 'default', $args = array()) {
</span><span class="cx">         global $wp_settings_fields;
</span><span class="cx"> 
</span><ins>+        if ( 'misc' == $page )
+                $page = 'general';
+
</ins><span class="cx">         if ( !isset($wp_settings_fields) )
</span><span class="cx">                 $wp_settings_fields = array();
</span><span class="cx">         if ( !isset($wp_settings_fields[$page]) )
</span></span></pre></div>
<a id="trunkwpadminmenuphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/menu.php (13744 => 13745)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/menu.php        2010-03-18 07:17:55 UTC (rev 13744)
+++ trunk/wp-admin/menu.php        2010-03-18 07:50:43 UTC (rev 13745)
</span><span class="lines">@@ -193,8 +193,6 @@
</span><span class="cx">         $submenu['options-general.php'][30] = array(__('Media'), 'manage_options', 'options-media.php');
</span><span class="cx">         $submenu['options-general.php'][35] = array(__('Privacy'), 'manage_options', 'options-privacy.php');
</span><span class="cx">         $submenu['options-general.php'][40] = array(__('Permalinks'), 'manage_options', 'options-permalink.php');
</span><del>-        if ( is_super_admin() )
-                $submenu['options-general.php'][45] = array(__('Miscellaneous'), 'manage_options', 'options-misc.php');
</del><span class="cx"> 
</span><span class="cx"> $_wp_last_utility_menu = 80; // The index of the last top-level menu in the utility menu group
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkwpadminoptionsmiscphp"></a>
<div class="delfile"><h4>Deleted: trunk/wp-admin/options-misc.php (13744 => 13745)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/options-misc.php        2010-03-18 07:17:55 UTC (rev 13744)
+++ trunk/wp-admin/options-misc.php        2010-03-18 07:50:43 UTC (rev 13745)
</span><span class="lines">@@ -1,42 +0,0 @@
</span><del>-&lt;?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');
-
-?&gt;
-
-&lt;div class=&quot;wrap&quot;&gt;
-&lt;?php screen_icon(); ?&gt;
-&lt;h2&gt;&lt;?php echo esc_html( $title ); ?&gt;&lt;/h2&gt;
-
-&lt;form method=&quot;post&quot; action=&quot;options.php&quot;&gt;
-&lt;?php settings_fields('misc'); ?&gt;
-
-&lt;table class=&quot;form-table&quot;&gt;
-&lt;?php do_settings_fields('misc', 'default'); ?&gt;
-&lt;/table&gt;
-
-&lt;?php do_settings_sections('misc'); ?&gt;
-
-&lt;p class=&quot;submit&quot;&gt;
-        &lt;input type=&quot;submit&quot; name=&quot;Submit&quot; class=&quot;button-primary&quot; value=&quot;&lt;?php esc_attr_e('Save Changes') ?&gt;&quot; /&gt;
-&lt;/p&gt;
-
-&lt;/form&gt;
-&lt;/div&gt;
-
-&lt;?php include('./admin-footer.php'); ?&gt;
</del><span class="cx">\ No newline at end of file
</span></span></pre>
</div>
</div>

</body>
</html>