Making WordPress.org

Changeset 4908


Ignore:
Timestamp:
02/15/2017 02:32:25 PM (8 years ago)
Author:
iandunn
Message:

WordCamp WP-CLI: Skip non-public and deleted sites

It doesn't make sense to flush rules on these sites, and attempting to do so previously produced a warning line, cluttering the command's output.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/wp-cli-commands/rewrite-rules.php

    r4907 r4908  
    2020        $start_timestamp = microtime( true );
    2121        $error           = '';
    22         $sites           = get_sites( array( 'number' => 10000 ) );
     22        $sites           = get_sites( array( 'number' => 10000, 'public' => 1 ) );
    2323        $notify          = new \cli\progress\Bar( sprintf( 'Processing %d sites', count( $sites ) ), count( $sites ) );
    2424
     
    2626
    2727        foreach ( $sites as $site ) {
     28            if ( $site->deleted ) {
     29                continue;
     30            }
     31
    2832            $nonce       = wp_create_nonce( 'flush-rewrite-rules-everywhere-' . $site->blog_id );
    2933            $display_url = $site->domain . rtrim( $site->path, '/' );
Note: See TracChangeset for help on using the changeset viewer.