<!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>[12825] trunk/wp-admin: Deprecate mu_options.</title>
</head>
<body>
<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/12825">12825</a></dd>
<dt>Author</dt> <dd>ryan</dd>
<dt>Date</dt> <dd>2010-01-25 21:33:49 +0000 (Mon, 25 Jan 2010)</dd>
</dl>
<h3>Log Message</h3>
<pre>Deprecate mu_options. Integrate directly into options.php. see <a href="http://trac.wordpress.org/ticket/11644">#11644</a></pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminincludesmsdeprecatedphp">trunk/wp-admin/includes/ms-deprecated.php</a></li>
<li><a href="#trunkwpadminincludesmsphp">trunk/wp-admin/includes/ms.php</a></li>
<li><a href="#trunkwpadminincludespluginphp">trunk/wp-admin/includes/plugin.php</a></li>
<li><a href="#trunkwpadminoptionsphp">trunk/wp-admin/options.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadminincludesmsdeprecatedphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/ms-deprecated.php (12824 => 12825)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/ms-deprecated.php        2010-01-25 19:46:24 UTC (rev 12824)
+++ trunk/wp-admin/includes/ms-deprecated.php        2010-01-25 21:33:49 UTC (rev 12825)
</span><span class="lines">@@ -28,4 +28,12 @@
</span><span class="cx">                 wp_die( __('Sorry, you must delete files before you can upload any more.') );
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+/**
+ * @deprecated 3.0
+ */
+function mu_options( $options ) {
+        _deprecated_function(__FUNCTION__, '3.0', '' );
+        return $options;
+}
+
</ins><span class="cx"> ?>
</span><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpadminincludesmsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/ms.php (12824 => 12825)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/ms.php        2010-01-25 19:46:24 UTC (rev 12824)
+++ trunk/wp-admin/includes/ms.php        2010-01-25 21:33:49 UTC (rev 12825)
</span><span class="lines">@@ -562,29 +562,6 @@
</span><span class="cx"> }
</span><span class="cx"> add_action( 'admin_page_access_denied', 'redirect_user_to_blog', 99 );
</span><span class="cx">
</span><del>-function mu_options( $options ) {
-        if ( defined( 'POST_BY_EMAIL' ) ) {
-                $writing = array( 'ping_sites' );
-        } else {
-                $writing = array( 'ping_sites', 'mailserver_login', 'mailserver_pass', 'default_email_category', 'mailserver_port', 'mailserver_url' );
-        }
-        $removed = array(
-                'general' => array( 'siteurl', 'home', 'admin_email', 'users_can_register', 'default_role' ),
-                'reading' => array( 'gzipcompression' ),
-                'writing' => $writing,
-        );
-
-        $added = array( 'general' => array( 'new_admin_email', 'WPLANG', 'language' ) );
-
-        $options[ 'misc' ] = array();
-
-        $options = remove_option_whitelist( $removed, $options );
-        $options = add_option_whitelist( $added, $options );
-
-        return $options;
-}
-add_filter( 'whitelist_options', 'mu_options' );
-
</del><span class="cx"> function check_import_new_users( $permission ) {
</span><span class="cx">         if ( !is_super_admin() )
</span><span class="cx">                 return false;
</span></span></pre></div>
<a id="trunkwpadminincludespluginphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/plugin.php (12824 => 12825)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/plugin.php        2010-01-25 19:46:24 UTC (rev 12824)
+++ trunk/wp-admin/includes/plugin.php        2010-01-25 21:33:49 UTC (rev 12825)
</span><span class="lines">@@ -1064,13 +1064,13 @@
</span><span class="cx"> * @return unknown
</span><span class="cx"> */
</span><span class="cx"> function add_option_whitelist( $new_options, $options = '' ) {
</span><del>-        if ( $options == '' ) {
</del><ins>+        if ( $options == '' )
</ins><span class="cx">                 global $whitelist_options;
</span><del>-        } else {
</del><ins>+        else
</ins><span class="cx">                 $whitelist_options = $options;
</span><del>-        }
-        foreach( $new_options as $page => $keys ) {
-                foreach( $keys as $key ) {
</del><ins>+
+        foreach ( $new_options as $page => $keys ) {
+                foreach ( $keys as $key ) {
</ins><span class="cx">                         if ( !isset($whitelist_options[ $page ]) || !is_array($whitelist_options[ $page ]) ) {
</span><span class="cx">                                 $whitelist_options[ $page ] = array();
</span><span class="cx">                                 $whitelist_options[ $page ][] = $key;
</span><span class="lines">@@ -1081,6 +1081,7 @@
</span><span class="cx">                         }
</span><span class="cx">                 }
</span><span class="cx">         }
</span><ins>+
</ins><span class="cx">         return $whitelist_options;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -1094,13 +1095,13 @@
</span><span class="cx"> * @return unknown
</span><span class="cx"> */
</span><span class="cx"> function remove_option_whitelist( $del_options, $options = '' ) {
</span><del>-        if ( $options == '' ) {
</del><ins>+        if ( $options == '' )
</ins><span class="cx">                 global $whitelist_options;
</span><del>-        } else {
</del><ins>+        else
</ins><span class="cx">                 $whitelist_options = $options;
</span><del>-        }
-        foreach( $del_options as $page => $keys ) {
-                foreach( $keys as $key ) {
</del><ins>+
+        foreach ( $del_options as $page => $keys ) {
+                foreach ( $keys as $key ) {
</ins><span class="cx">                         if ( isset($whitelist_options[ $page ]) && is_array($whitelist_options[ $page ]) ) {
</span><span class="cx">                                 $pos = array_search( $key, $whitelist_options[ $page ] );
</span><span class="cx">                                 if ( $pos !== false )
</span><span class="lines">@@ -1108,6 +1109,7 @@
</span><span class="cx">                         }
</span><span class="cx">                 }
</span><span class="cx">         }
</span><ins>+
</ins><span class="cx">         return $whitelist_options;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkwpadminoptionsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/options.php (12824 => 12825)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/options.php        2010-01-25 19:46:24 UTC (rev 12824)
+++ trunk/wp-admin/options.php        2010-01-25 21:33:49 UTC (rev 12825)
</span><span class="lines">@@ -22,23 +22,45 @@
</span><span class="cx"> wp_reset_vars(array('action'));
</span><span class="cx">
</span><span class="cx"> $whitelist_options = array(
</span><del>-        'general' => array( 'blogname', 'blogdescription', 'admin_email', 'users_can_register', 'gmt_offset', 'date_format', 'time_format', 'start_of_week', 'default_role', 'timezone_string' ),
</del><ins>+        'general' => array( 'blogname', 'blogdescription', 'gmt_offset', 'date_format', 'time_format', 'start_of_week', 'timezone_string' ),
</ins><span class="cx">         'discussion' => array( 'default_pingback_flag', 'default_ping_status', 'default_comment_status', 'comments_notify', 'moderation_notify', 'comment_moderation', 'require_name_email', 'comment_whitelist', 'comment_max_links', 'moderation_keys', 'blacklist_keys', 'show_avatars', 'avatar_rating', 'avatar_default', 'close_comments_for_old_posts', 'close_comments_days_old', 'thread_comments', 'thread_comments_depth', 'page_comments', 'comments_per_page', 'default_comments_page', 'comment_order', 'comment_registration' ),
</span><span class="cx">         'misc' => array( 'use_linksupdate', 'uploads_use_yearmonth_folders', 'upload_path', 'upload_url_path' ),
</span><span class="cx">         'media' => array( 'thumbnail_size_w', 'thumbnail_size_h', 'thumbnail_crop', 'medium_size_w', 'medium_size_h', 'large_size_w', 'large_size_h', 'image_default_size', 'image_default_align', 'image_default_link_type', 'embed_autourls', 'embed_size_w', 'embed_size_h' ),
</span><span class="cx">         'privacy' => array( 'blog_public' ),
</span><span class="cx">         'reading' => array( 'posts_per_page', 'posts_per_rss', 'rss_use_excerpt', 'blog_charset', 'show_on_front', 'page_on_front', 'page_for_posts' ),
</span><del>-        'writing' => array( 'default_post_edit_rows', 'use_smilies', 'ping_sites', 'mailserver_url', 'mailserver_port', 'mailserver_login', 'mailserver_pass', 'default_category', 'default_email_category', 'use_balanceTags', 'default_link_category', 'enable_app', 'enable_xmlrpc' ),
</del><ins>+        'writing' => array( 'default_post_edit_rows', 'use_smilies', 'default_category', 'default_email_category', 'use_balanceTags', 'default_link_category', 'enable_app', 'enable_xmlrpc' ),
</ins><span class="cx">         'options' => array( '' ) );
</span><del>-if ( !defined( 'WP_SITEURL' ) ) $whitelist_options['general'][] = 'siteurl';
-if ( !defined( 'WP_HOME' ) ) $whitelist_options['general'][] = 'home';
</del><span class="cx">
</span><ins>+$mail_options = array('mailserver_url', 'mailserver_port', 'mailserver_login', 'mailserver_pass');
+
+if ( !is_multisite() ) {
+        if ( !defined( 'WP_SITEURL' ) ) $whitelist_options['general'][] = 'siteurl';
+        if ( !defined( 'WP_HOME' ) ) $whitelist_options['general'][] = 'home';
+        $whitelist_options['general'][] = 'admin_email';
+        $whitelist_options['general'][] = 'users_can_register';
+        $whitelist_options['general'][] = 'default_role';
+
+        $whitelist_options['writing'] = array_merge($whitelist_options['writing'], $mail_options);
+        $whitelist_options['writing'][] = 'ping_sites';
+} else {
+        $whitelist_options['general'][] = 'new_admin_email';
+        $whitelist_options['general'][] = 'WPLANG';
+        $whitelist_options['general'][] = 'language';
+
+        $whitelist_options[ 'misc' ] = array();
+
+        if ( defined( 'POST_BY_EMAIL' ) )
+                $whitelist_options['writing'] = array_merge($whitelist_options['writing'], $mail_options);
+
+        $whitelist_options[ 'misc' ] = array();
+}
+
</ins><span class="cx"> $whitelist_options = apply_filters( 'whitelist_options', $whitelist_options );
</span><span class="cx">
</span><span class="cx"> if ( !current_user_can('manage_options') )
</span><span class="cx">         wp_die(__('Cheatin&#8217; uh?'));
</span><span class="cx">
</span><del>-if ( is_multisite() && is_super_admin() && $_GET[ 'adminhash' ] ) {
</del><ins>+if ( is_multisite() && is_super_admin() && isset($_GET[ 'adminhash' ]) && $_GET[ 'adminhash' ] ) {
</ins><span class="cx">         $new_admin_details = get_option( 'adminhash' );
</span><span class="cx">         if ( is_array( $new_admin_details ) && $new_admin_details[ 'hash' ] == $_GET[ 'adminhash' ] && $new_admin_details[ 'newemail' ] != '' ) {
</span><span class="cx">                 update_option( "admin_email", $new_admin_details[ 'newemail' ] );
</span></span></pre>
</div>
</div>
</body>
</html>