The MU forums have moved to WordPress.org

Backend by blog ID (2 posts)

  1. Dsus4
    Member
    Posted 16 years ago #

    Hey there.

    I'm coding a script to cycle through each blog backend and run a certain command. In an attempt to not involve myself with the DB, I was wondering if it was possible to access the blog backends through blog ID and not username.

    Any ideas?

    --Dsus4

  2. iolaire
    Member
    Posted 16 years ago #

    Here is a snippet from the plugin list_all.php

    $blog_list = $wpdb->get_results( "SELECT blog_id, last_updated FROM " . $wpdb->blogs. " WHERE public = '1' AND archived = '0' AND mature = '0' AND spam = '0' AND deleted ='0' " . $order . " " . $limit . "", ARRAY_A );

    Otherwise the admin/wpmu-upgrade-site.php probably has similar code.

About this Topic