I’m looking for a way to have users register on a multisite setup and have a blog automatically created for them… no, not the way the standard ms registration system handles it. I want to get rid of the second step in the process completely. They register as ‘user’, and a blog is automatically created at http://my.site.com/user for them.
Followup question… anyone know of a way of automatically pruning the multisite platform? IE, users who don’t login for ‘x’ timeframe (or after a certain time period has elapsed) automatically have their site deleted.
I guess you are searching for the
wpmu_create_blog()
function. Just disable the standard registration process and attach this function to the regular registration.user_register
is a good action hook to do this.Regarding your second question I don’t think there is a built in way. A good start is the
wpmu_delete_blog()
function. You could trigger this function on a regular base using wp-cron. The information when a blog was updated the last time is stored inwp_blogs
in thelast_updated
column, but I don’t think there is an API function to retrieve this either. So you’ll maybe need a custom SQL query to get it.This plugin by WPMU can help you for sure.