Plugin Directory

Changeset 2690954


Ignore:
Timestamp:
03/08/2022 05:30:03 PM (4 years ago)
Author:
aaf017
Message:

Replace deprecated method wp_get_sites() by get_sites()

Location:
wp-cassify/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • wp-cassify/trunk/admin/admin-menu.php

    r2688856 r2690954  
    739739                    </select>
    740740                    <?php if ( $this->wp_cassify_network_activated ) : ?>
    741                     <?php $blogs = wp_get_sites();?>   
     741                    <?php $blogs = get_sites();?>   
    742742                    <select id="wp_cassify_user_role_blog_id" name="wp_cassify_user_role_blog_id" class="post_form">
    743743                        <?php echo '<option value="0">(0)&nbsp;ALL BLOGS</option>'; ?>     
    744744                        <?php for( $i = 0; $i <= count( $blogs ) - 1; $i++ ) : ?>
    745                             <?php echo '<option value="' . $blogs[ $i ][ 'blog_id' ] . '">(' . $blogs[ $i ][ 'blog_id' ] . ')&nbsp;' . $blogs[ $i ][ 'domain' ] . $blogs[ $i ][ 'path' ] . '</option>'; ?> 
     745                            <?php echo '<option value="' . $blogs[ $i ]->blog_id . '">(' . $blogs[ $i ]->blog_id . ')&nbsp;' . $blogs[ $i ]->domain . $blogs[ $i ]->path . '</option>'; ?> 
    746746                        <?php endfor; ?>                           
    747747                    </select>
  • wp-cassify/trunk/wp-cassify.php

    r2688827 r2690954  
    4747   
    4848    // Delete network activated options
    49     if( $wpdb->get_var("SHOW TABLES LIKE '{$wpdb->prefix}sitemeta'") != '{$wpdb->prefix}sitemeta' ) {   
    50         $wpdb->query( "DELETE FROM {$wpdb->prefix}sitemeta WHERE `meta_key` LIKE 'wp_cassify%'" );
     49    if( $wpdb->get_var("SHOW TABLES LIKE '{$wpdb->base_prefix}sitemeta'") != '{$wpdb->base_prefix}sitemeta' ) {   
     50        $wpdb->query( "DELETE FROM {$wpdb->base_prefix}sitemeta WHERE `meta_key` LIKE 'wp_cassify%'" );
    5151    }
    5252
    5353    // Delete blog options
    54     $blogs = wp_get_sites();
     54    $blogs = get_sites();
     55
    5556    for( $i = 0; $i <= count( $blogs ) - 1; $i++ ) {
    5657        // 1 is network
    57         if ( $blogs[ $i ][ 'blog_id' ] > 1 ) {
    58             $_tbl_name = "{$wpdb->prefix}" . $blogs[ $i ][ 'blog_id' ] . "_options";
     58        if ( $blogs[ $i ]->blog_id > 1 ) {
     59            $_tbl_name = "{$wpdb->base_prefix}" . $blogs[ $i ]->blog_id . "_options";
    5960            if( $wpdb->get_var("SHOW TABLES LIKE '{$_tbl_name}'") != '{$_tbl_name}' ) {   
    6061                $wpdb->query( "DELETE FROM {$_tbl_name} WHERE `option_name` LIKE 'wp_cassify%'" );
Note: See TracChangeset for help on using the changeset viewer.