The MU forums have moved to WordPress.org

Creating new blogs w/o Dashboard (1 post)

  1. plaverty
    Member
    Posted 12 years ago #

    Shouldn't this work? I have my own php script where I am trying to create a blog using the wpmu_create_blog function. I use:

    $domain = "******.brown.edu";
    $path = "blogs/abc123";
    $user_id = 107;
    $title = "A new blog";
    $meta = Array("public"=>1);

    wpmu_create_blog($domain, $path, $title, $user_id, $meta = '', $site_id = 1);

    But when I run it, I get:

    Fatal error: Call to undefined function add_action() in /opt/local/apache2/htdocs/blogs/wp-includes/wpmu-functions.php on line 1781

    So I look at that line in the code and I see:

    <p class="message">%s</p>

    It is true that add_action() is not defined in this file, but it is defined in plugin.php. I see the doc for add_action, but am I supposed to link up wpmu_create_blog with add_action? Is that how this is supposed to work?

    I'm looking through the Codex for how to create blogs. Anyone got it bookmarked or something?

About this Topic

  • Started 12 years ago by plaverty