Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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.

share|improve this question
2  
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 '12 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! –  Ghost1227 Aug 30 '12 at 6:47
add comment

2 Answers

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.

share|improve this answer
add comment

This plugin by WPMU can help you for sure.

share|improve this answer
4  
Welcome to WordPress Answers! An answer should be more than just a link to an external site. Please add a solution. –  toscho Aug 30 '12 at 2:02
    
While I am a member of wpmudev, I'm not seeing how that particular plugin would resolve my issue... –  Ghost1227 Aug 30 '12 at 6:45
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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