1

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.

2
  • 3
    Please only ask 1 question per ... question. Also: There's a WYSIWYG editor and normally, people use http://example.com for example links. Else: Welcome to WPSE. :)
    – kaiser
    Aug 29, 2012 at 22:07
  • Never really considered a 'proper' format for links... and the second question wasn't really something I'm concerned about at the moment... I really added it more for my benefit than expecting an answer. However, your point is well made. And thanks!
    – Evertiro
    Aug 30, 2012 at 6:47

2 Answers 2

1

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 in wp_blogs in the last_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.

0

This plugin by WPMU can help you for sure.

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.