Action Hook Upon Blog/Site Creation in Multisite

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Action Hook Upon Blog/Site Creation in Multisite

CloudPress Hosting
I have WordPress setup as a multisite. I am looking for a hook that fires
right after the creation of a new blog/site and I can get the blog_id for
the newly created blog from. I could not find any hook that looked like it
would do this in the action hook reference of the codex but I know that's
not a complete list. So I was curious if anyone here knew about such a hook.

Thanks.
_______________________________________________
wp-hackers mailing list
[hidden email]
http://lists.automattic.com/mailman/listinfo/wp-hackers
Reply | Threaded
Open this post in threaded view
|

Re: Action Hook Upon Blog/Site Creation in Multisite

Matthias Breuer
Hello Mark,

I am pretty sure the action 'wpmu_new_blog' is what you are looking for. This is what 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.

The action is called with the following parameters:

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

I often use http://adambrown.info/p/wp_hooks to find hooks that are not in the codex.

Best,
Matthias


Am 18.04.2013 um 21:44 schrieb Mark Smith <[hidden email]>:

> I have WordPress setup as a multisite. I am looking for a hook that fires
> right after the creation of a new blog/site and I can get the blog_id for
> the newly created blog from. I could not find any hook that looked like it
> would do this in the action hook reference of the codex but I know that's
> not a complete list. So I was curious if anyone here knew about such a hook.
>
> Thanks.
> _______________________________________________
> wp-hackers mailing list
> [hidden email]
> http://lists.automattic.com/mailman/listinfo/wp-hackers

_______________________________________________
wp-hackers mailing list
[hidden email]
http://lists.automattic.com/mailman/listinfo/wp-hackers
Reply | Threaded
Open this post in threaded view
|

Re: Action Hook Upon Blog/Site Creation in Multisite

Simon Vart
In reply to this post by CloudPress Hosting
Hi,

not sure but it looks like it :
http://gregorygrubbs.com/wordpress/how-to-give-wpmu-blogs-default-properties-theme-and-pages/

Regards

--
---------------------
Simon Vart
studio de communication exigences
10 Rue Amiral Ronarch
29660 Carantec
----
02.98.67.92.70
06.09.97.82.91
www.exigences.biz
linkedin : http://www.linkedin.com/profile/view?id=87258047
twitter : @simonvart
skype: carantecinfo
---------------------

Le 18/04/2013 21:44, Mark Smith a écrit :

> I have WordPress setup as a multisite. I am looking for a hook that fires
> right after the creation of a new blog/site and I can get the blog_id for
> the newly created blog from. I could not find any hook that looked like it
> would do this in the action hook reference of the codex but I know that's
> not a complete list. So I was curious if anyone here knew about such a hook.
>
> Thanks.
> _______________________________________________
> wp-hackers mailing list
> [hidden email]
> http://lists.automattic.com/mailman/listinfo/wp-hackers

_______________________________________________
wp-hackers mailing list
[hidden email]
http://lists.automattic.com/mailman/listinfo/wp-hackers