Is there a way to add a function that will get run after a blog is created?

Have you tried the action ‘wpmu_new_blog’ .

The docstring for the function ‘wpmu_create_blog’ says:

  • This function runs when a user self-registers a new site as well
  • as when a Super Admin creates a new site. Hook to ‘wpmu_new_blog’
  • for events that should affect all new sites.

wpmu_new_blog is called with the following parameters:

do_action( 'wpmu_new_blog', $blog_id, $user_id, $domain, $path, $site_id, $meta ); 

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)