How to call WordPress functions in a custom PHP script

后端 未结 7 482
小蘑菇
小蘑菇 2020-12-07 16:52

I have a PHP script I want to use for creating a new blog in WPMU. I am having trouble calling WordPress functions like wpmu_create_user and wpmu_create_blog.

My hop

7条回答
  •  借酒劲吻你
    2020-12-07 17:30

    Following is the code I am using:


     1);
        if (constant('VHOST') == 'yes')
        {
                $newdomain = $domain . "." . $current_site->domain;
                $path = $base;
        }
        else
        {
                $newdomain = $current_site->domain; $path = $base . $domain . '/';
        }
        $domain = strtolower($domain);
        $newdomain = strtolower($newdomain);
        $path = strtolower($path);
        $meta = apply_filters('signup_create_blog_meta', array('lang_id' => 1, $public));
        $meta = apply_filters("add_singup_meta", $meta);
        wpmu_create_blog($newdomain, $path, $title, $user_id , $meta, $current_site->id);
        do_action('wpmu_activate_blog', $blog_id, $user_id, $password, $title, $meta);
    
    
        // Update external DB  with BlogUrl, NewBlogName, AdminPassword, 
    
    OrderStatus=Complete.
    
    mysql_close($con);
    
    ?>
    

提交回复
热议问题