[wp-trac] [WordPress Trac] #25030: Overlapping upload paths with multiple networks

WordPress Trac noreply at wordpress.org
Thu Aug 15 15:55:12 UTC 2013


#25030: Overlapping upload paths with multiple networks
--------------------------+------------------
 Reporter:  ddean         |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  3.7
Component:  Multisite     |     Version:
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |
--------------------------+------------------

Comment (by cgrymala):

 I love this discussion. It's going to make a huge difference for the way
 we're using things at UMW (where we have a multi-network install with ~250
 sites spread across ~50 networks), and I would love it if plugin authors
 began accounting for this type of system (of course, we also still need to
 train some plugin authors to even account for the fact that we have
 multisite).

 This may be something to bring up in a separate ticket, but since we've
 begun discussing `is_multisite()` in the discussion about
 `is_main_network()`, it would be great to also have a core function to
 check to see if there is more than one network in the installation
 (`is_multinetwork()` maybe?). I have a custom `is_multinetwork()` function
 that we're using at UMW, which does a lot more checks than a core function
 would probably need to do (in addition to counting the rows in the `site`
 table, my function currently checks to see if any of the 3 known multi-
 network plugins are active, etc.), but I would imagine a core function
 probably wouldn't need to do much more but to check to see if there is
 more than one row in the `site` table. That could look something like:


 {{{
 if ( ! function_exists( 'is_multinetwork' ) ) {
     function is_multinetwork() {
         if ( ! is_multisite() )
             return false;
         global $wpdb;
         $networks = $wpdb->get_var( "SELECT COUNT(site_id) FROM
 {$wpdb->site}" );
         return is_numeric( $networks ) && $networks > 1;
     }
 }
 }}}

--
Ticket URL: <http://core.trac.wordpress.org/ticket/25030#comment:17>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list