• Resolved Jan K.

    (@90jkrug)


    Hi,

    i would like to create a new blog using my plugin.
    The following lines of code just result in “Fatal error: Call to a member function init() on a non-object in /wp-admin/includes/upgrade.php on line 293” .

    But when i look into my blog overview the new blog has been added successfully..
    After refreshing my website the error message is not visible anymore.

    $name = 'testblog';
    $title = 'this is my testblog';
    $user_id = '1';
    wpmu_create_blog($current_site->domain, $current_site->path . $name .'/', $itle, $user_id);

    So there is only an error message when wpmu_create_blog is executed.

    Do u know why? :S
    Thanks a lot!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Jan K.

    (@90jkrug)

    upgrade.php lines 291 – 293

    if ( is_multisite() ) {
    	// Flush rules to pick up the new page.
    	$wp_rewrite->init();

    I’ve already written global $wp_rewrite; but it has no effect.. :S

    Any ideas?

    Thread Starter Jan K.

    (@90jkrug)

    $wp_rewrite = new wp_rewrite(); solves the problem..

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘wpmu_create_blog() => Call to a member function init() on a non-object’ is closed to new replies.