views:

728

answers:

4

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 hope is to get this script running as a cron job from command line and pick up new blog creation requests from an external db, create a new blog using the wordpress functions and update the db with new blog info.

Any help/suggestions are highly appreciated.

Sid.

A: 

include wp-load.php file (in the root of your wordpress installation) in your php script file like so,

require_once("/path/to/wordpress/wp-load.php");

you will have to provide the abspath of the wp-load file, now you can use all the functions of wordpress in your php script

Pragati Sureka
Although that will run Wordpress too....
Chacha102
yes it will load wordpress too... but will make all the functions avaliable for use
Pragati Sureka
i tried the above solution. Works in one file but not in the consequent files.
Hemanshu Bhojak
well ofcourse it wont... if you are not including that fle in your main script(in which you included wp-load.php) it wont work... then you will have to include it in all the files.
Pragati Sureka
A: 
sid.sri
A: 

Thanks its very useful tips.

abdullah.okm
A: 

coach handbags

coach outlet