I am currently developing a multi-site plug-in for WordPress. I need to run a function when a new site is created.


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 );
  • I need to run my custom function when a new site is created – Varun Sridharan 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 ? – Varun Sridharan Feb 25 '13 at 6:04
  • 1
    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 clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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