<!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>[12698] trunk/wp-includes/functions.php: Mainstream things that don'
 t need to be multisite only.</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/12698">12698</a></dd>
<dt>Author</dt> <dd>ryan</dd>
<dt>Date</dt> <dd>2010-01-11 22:08:49 +0000 (Mon, 11 Jan 2010)</dd>
</dl>

<h3>Log Message</h3>
<pre>Mainstream things that don't need to be multisite only. Formatting cleanups. see <a href="http://trac.wordpress.org/ticket/11644">#11644</a></pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpincludesfunctionsphp">trunk/wp-includes/functions.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpincludesfunctionsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/functions.php (12697 => 12698)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/functions.php        2010-01-11 21:49:40 UTC (rev 12697)
+++ trunk/wp-includes/functions.php        2010-01-11 22:08:49 UTC (rev 12698)
</span><span class="lines">@@ -28,13 +28,13 @@
</span><span class="cx">         if ( empty( $m ) )
</span><span class="cx">                 return false;
</span><span class="cx"> 
</span><del>-        if( 'G' == $dateformatstring ) {
</del><ins>+        if ( 'G' == $dateformatstring ) {
</ins><span class="cx">                 return strtotime( $m . ' +0000' );
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         $i = strtotime( $m );
</span><span class="cx"> 
</span><del>-        if( 'U' == $dateformatstring )
</del><ins>+        if ( 'U' == $dateformatstring )
</ins><span class="cx">                 return $i;
</span><span class="cx"> 
</span><span class="cx">         if ( $translate)
</span><span class="lines">@@ -200,7 +200,7 @@
</span><span class="cx">         $day = mktime( 0, 0, 0, $md, $mm, $my ); // The timestamp for mysqlstring day.
</span><span class="cx">         $weekday = date( 'w', $day ); // The day of the week from the timestamp
</span><span class="cx">         $i = 86400; // One day
</span><del>-        if( !is_numeric($start_of_week) )
</del><ins>+        if ( !is_numeric($start_of_week) )
</ins><span class="cx">                 $start_of_week = get_option( 'start_of_week' );
</span><span class="cx"> 
</span><span class="cx">         if ( $weekday &lt; $start_of_week )
</span><span class="lines">@@ -329,11 +329,11 @@
</span><span class="cx">         // prevent non-existent options from triggering multiple queries
</span><span class="cx">         if ( defined( 'WP_INSTALLING' ) &amp;&amp; is_multisite() ) {
</span><span class="cx">                 $notoptions = array();
</span><del>-        } else {
-                $notoptions = wp_cache_get( 'notoptions', 'options' );
-                if ( isset( $notoptions[$setting] ) )
-                        return $default;
-        }
</del><ins>+        } else {
+                $notoptions = wp_cache_get( 'notoptions', 'options' );
+                if ( isset( $notoptions[$setting] ) )
+                        return $default;
+        }
</ins><span class="cx"> 
</span><span class="cx">         $alloptions = wp_load_alloptions();
</span><span class="cx"> 
</span><span class="lines">@@ -416,7 +416,7 @@
</span><span class="cx">         global $wpdb;
</span><span class="cx"> 
</span><span class="cx">         if ( !defined( 'WP_INSTALLING' ) || !is_multisite() )
</span><del>-                $alloptions = wp_cache_get( 'alloptions', 'options' );
</del><ins>+                $alloptions = wp_cache_get( 'alloptions', 'options' );
</ins><span class="cx"> 
</span><span class="cx">         if ( !$alloptions ) {
</span><span class="cx">                 $suppress = $wpdb-&gt;suppress_errors();
</span><span class="lines">@@ -426,8 +426,8 @@
</span><span class="cx">                 $alloptions = array();
</span><span class="cx">                 foreach ( (array) $alloptions_db as $o )
</span><span class="cx">                         $alloptions[$o-&gt;option_name] = $o-&gt;option_value;
</span><del>-                if ( !defined( 'WP_INSTALLING' ) || !is_multisite() )
-                        wp_cache_add( 'alloptions', $alloptions, 'options' );
</del><ins>+                        if ( !defined( 'WP_INSTALLING' ) || !is_multisite() )
+                                wp_cache_add( 'alloptions', $alloptions, 'options' );
</ins><span class="cx">         }
</span><span class="cx">         return $alloptions;
</span><span class="cx"> }
</span><span class="lines">@@ -629,8 +629,7 @@
</span><span class="cx"> function delete_transient($transient) {
</span><span class="cx">         global $_wp_using_ext_object_cache, $wpdb;
</span><span class="cx"> 
</span><del>-        if( is_multisite() )
-                    do_action( 'delete_transient_' . $transient );
</del><ins>+    do_action( 'delete_transient_' . $transient );
</ins><span class="cx"> 
</span><span class="cx">         if ( $_wp_using_ext_object_cache ) {
</span><span class="cx">                 return wp_cache_delete($transient, 'transient');
</span><span class="lines">@@ -699,8 +698,7 @@
</span><span class="cx"> function set_transient($transient, $value, $expiration = 0) {
</span><span class="cx">         global $_wp_using_ext_object_cache, $wpdb;
</span><span class="cx"> 
</span><del>-        if( is_multisite() )
-                    $value = apply_filters( 'pre_set_transient_' . $transient, $value );
</del><ins>+    $value = apply_filters( 'pre_set_transient_' . $transient, $value );
</ins><span class="cx"> 
</span><span class="cx">         if ( $_wp_using_ext_object_cache ) {
</span><span class="cx">                 return wp_cache_set($transient, $value, 'transient', $expiration);
</span><span class="lines">@@ -1432,7 +1430,7 @@
</span><span class="cx">         global $wp, $wp_query, $wp_the_query;
</span><span class="cx">         $wp-&gt;main( $query_vars );
</span><span class="cx"> 
</span><del>-        if( !isset($wp_the_query) )
</del><ins>+        if ( !isset($wp_the_query) )
</ins><span class="cx">                 $wp_the_query = $wp_query;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2112,7 +2110,7 @@
</span><span class="cx">         $name = basename($filename, $ext);
</span><span class="cx"> 
</span><span class="cx">         // edge case: if file is named '.ext', treat as an empty name
</span><del>-        if( $name === $ext )
</del><ins>+        if ( $name === $ext )
</ins><span class="cx">                 $name = '';
</span><span class="cx"> 
</span><span class="cx">         // Increment the file number until we have a unique file to save in $dir. Use $override['unique_filename_callback'] if supplied.
</span><span class="lines">@@ -2186,14 +2184,11 @@
</span><span class="cx">         if ( $upload['error'] !== false )
</span><span class="cx">                 return $upload;
</span><span class="cx"> 
</span><del>-        if( is_multisite() ) {
-                    /* WPMU check file before writing it */
-                $upload_bits_error = apply_filters( 'wp_upload_bits', array( 'name' =&gt; $name, 'bits' =&gt; $bits, 'time' =&gt; $time ) );
-                if( is_array( $upload_bits_error ) == false ) {
-                        $upload[ 'error' ] = $upload_bits_error;
-                        return $upload;
-                }
-        }
</del><ins>+        $upload_bits_error = apply_filters( 'wp_upload_bits', array( 'name' =&gt; $name, 'bits' =&gt; $bits, 'time' =&gt; $time ) );
+        if ( !is_array( $upload_bits_error ) ) {
+                $upload[ 'error' ] = $upload_bits_error;
+                return $upload;
+        }
</ins><span class="cx"> 
</span><span class="cx">         $filename = wp_unique_filename( $upload['path'], $name );
</span><span class="cx"> 
</span><span class="lines">@@ -2529,7 +2524,7 @@
</span><span class="cx">                 $admin_dir = 'wp-admin/';
</span><span class="cx"> 
</span><span class="cx">         if ( !function_exists( 'did_action' ) || !did_action( 'admin_head' ) ) :
</span><del>-        if( !headers_sent() ){
</del><ins>+        if ( !headers_sent() ){
</ins><span class="cx">                 status_header( $r['response'] );
</span><span class="cx">                 nocache_headers();
</span><span class="cx">                 header( 'Content-Type: text/html; charset=utf-8' );
</span><span class="lines">@@ -3761,7 +3756,7 @@
</span><span class="cx">         // PHP will close file handle, but we are good citizens.
</span><span class="cx">         fclose( $fp );
</span><span class="cx"> 
</span><del>-        if( $context != '' ) {
</del><ins>+        if ( $context != '' ) {
</ins><span class="cx">                 $extra_headers = apply_filters( &quot;extra_$context&quot;.'_headers', array() );
</span><span class="cx"> 
</span><span class="cx">                 $extra_headers = array_flip( $extra_headers );
</span></span></pre>
</div>
</div>

</body>
</html>