Strange switch_to_blog() issue

You might be running up against WordPress’s global $blog_id variable in test case #2.

Try this:

foreach($sites as $my_blog_id => $name) {

    switch_to_blog($my_blog_id);

    $sites[$my_blog_id] = get_bloginfo('name');

    restore_current_blog();
}

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)