<!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>[15851] trunk/wp-includes: Lose get_ordered_blogs_of_user()
  and set_visibility().</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/15851">15851</a></dd>
<dt>Author</dt> <dd>ryan</dd>
<dt>Date</dt> <dd>2010-10-19 15:32:33 +0000 (Tue, 19 Oct 2010)</dd>
</dl>

<h3>Log Message</h3>
<pre>Lose get_ordered_blogs_of_user() and set_visibility().  Not using them yet. see <a href="http://trac.wordpress.org/ticket/14772">#14772</a></pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpincludesadminbaradminbarclassphp">trunk/wp-includes/admin-bar/admin-bar-class.php</a></li>
<li><a href="#trunkwpincludesuserphp">trunk/wp-includes/user.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpincludesadminbaradminbarclassphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/admin-bar/admin-bar-class.php (15850 => 15851)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/admin-bar/admin-bar-class.php        2010-10-19 14:41:30 UTC (rev 15850)
+++ trunk/wp-includes/admin-bar/admin-bar-class.php        2010-10-19 15:32:33 UTC (rev 15851)
</span><span class="lines">@@ -12,7 +12,7 @@
</span><span class="cx">                 $this-&gt;menu = new stdClass;
</span><span class="cx"> 
</span><span class="cx">                 /* Populate settings we need for the menu based on the current user. */
</span><del>-                $this-&gt;user-&gt;blogs = get_ordered_blogs_of_user( $current_user-&gt;id );
</del><ins>+                $this-&gt;user-&gt;blogs = get_blogs_of_user( $current_user-&gt;id );
</ins><span class="cx">                 if ( is_multisite() ) {
</span><span class="cx">                         $this-&gt;user-&gt;active_blog = get_active_blog_for_user( $current_user-&gt;id );
</span><span class="cx">                         $this-&gt;user-&gt;domain = empty( $this-&gt;user-&gt;active_blog ) ? user_admin_url() : trailingslashit( get_home_url( $this-&gt;user-&gt;active_blog-&gt;blog_id ) );
</span></span></pre></div>
<a id="trunkwpincludesuserphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/user.php (15850 => 15851)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/user.php        2010-10-19 14:41:30 UTC (rev 15850)
+++ trunk/wp-includes/user.php        2010-10-19 15:32:33 UTC (rev 15851)
</span><span class="lines">@@ -637,83 +637,6 @@
</span><span class="cx">         return apply_filters( 'get_blogs_of_user', $blog_deets, $id, $all );
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-function get_ordered_blogs_of_user( $user_id, $visibility = true ) {
-        $newblogs      = $ordered = array();
-        $blogs         = get_blogs_of_user( $user_id );
-        $order_meta    = get_user_meta( $user_id, 'blog_order' );
-        $visible_meta  = get_user_meta( $user_id, 'blog_visibility' );
-
-        $order = $order_meta;
-        if ( !is_array( $order ) )
-                $order = array();
-
-        $visible = $visible_meta;
-        if ( !is_array( $visible ) )
-                $visible = array();
-
-        // Index the blogs by userblog_id and set the visibility flag
-        // Visibility is on by default, unless a linked site then off
-        foreach ( $blogs as $blog ) {
-                $blog-&gt;visible = true;
-
-                if ( isset( $visible[$blog-&gt;userblog_id] ) )
-                        $blog-&gt;visible = $visible[$blog-&gt;userblog_id];
-
-                $newblogs[$blog-&gt;userblog_id] = $blog;
-        }
-
-        // Add the blogs to our list by order
-        foreach ( (array)$order as $id ) {
-                // A previous change was saving the entire blog details into ordered, not just the blog ID - this detects it
-                if ( is_object( $id ) &amp;&amp; isset( $id-&gt;userblog_id ) )
-                        $id = $id-&gt;userblog_id;
-                
-                if ( is_numeric( $id ) &amp;&amp; isset( $newblogs[intval( $id )] ) ) {
-                        $ordered[$id] = $newblogs[$id];
-                        unset( $newblogs[$id] );
-                }
-        }
-
-        // Add any blog not yet ordered to the end
-        foreach ( $newblogs as $blog ) {
-                $ordered[$blog-&gt;userblog_id] = $blog;
-        }
-
-        // If we're only interested in visible blogs then remove the rest
-        if ( $visibility ) {
-                foreach ( (array)$ordered as $pos =&gt; $blog ) {
-                        if ( $blog-&gt;visible == false )
-                                unset( $ordered[$pos] );
-                }
-        }
-
-/*
-        // Set the order and visible options if the user doesn't have any,
-        // but rate limit it so that the global DB doesn't get hammered
-        if ( !is_array( $order_meta ) &amp;&amp; ( 1 == mt_rand( 1, 10 ) ) )
-                update_usermeta( $user_id, 'blog_order', array() );
-
-        if ( !is_array( $visible_meta ) &amp;&amp; ( 1 == mt_rand( 1, 10 ) ) )
-                update_usermeta( $user_id, 'blog_visibility', array() );
-*/
-
-        return apply_filters( 'ordered_blogs', $ordered );
-}
-
-function set_blog_visibility( $blog_id, $visible ) {
-        global $current_user;
-
-        if ( is_blog_user( $blog_id ) ) {
-                $visibility = get_user_meta( $current_user-&gt;ID, 'blog_visibility' );
-                if ( !is_array( $visibility ) )
-                        $visibility = array();
-
-                $visibility[$blog_id] = $visible;
-
-                update_user_meta( $current_user-&gt;ID, 'blog_visibility', $visibility );
-        }
-}
-
</del><span class="cx"> /**
</span><span class="cx">  * Checks if the current user belong to a given blog.
</span><span class="cx">  *
</span></span></pre>
</div>
</div>

</body>
</html>