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 am currently developing a multi-site plug-in for WordPress. I need to run a function when a new site is created.

share|improve this question

1 Answer 1

I guess you are looking for an action/filter.

wpmu_new_blog this action is fired in wpmu_create_blog function (wp-includes/ms-functions.php)

do_action( 'wpmu_new_blog', $blog_id, $user_id, $domain, $path, $site_id, $meta );
share|improve this answer
I need to run my custom function when a new site is created –  S.Varun Feb 25 '13 at 6:02
I need to teach you how to hook action? –  Jesse Feb 25 '13 at 6:02
if possible can u ? –  S.Varun Feb 25 '13 at 6:04
Actions and filters are the fundamental knowledge of wordpress plugin development. Hooking an action is the most basic stuff. If you have no idea what they idea, I would suggest googling about add_action first. –  Jesse Feb 25 '13 at 6:12

Your Answer


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.