WordPress Development Asked on December 26, 2021
Is there a way to have a function run after a blog is created in WP MU? I think I would need to add a filter or something but I’m not as familiar with the procedure.
Do I set something up like this:
EXAMPLE!!!
add_filter('new_blog_created', 'my_function');
function my_function() {
// do something
}
So far I’m calling wpmu_create_blog()
to create a new blog successfully if that helps.
Here is my code which is inside a function:
function create_site() {
// some code
$meta = apply_filters( 'add_signup_meta', $meta );
$result = wpmu_create_blog( $domain, $path, $blog_title, $current_user->ID, $meta, $wpdb->siteid );
}
Have you tried the action 'wpmu_new_blog' .
The docstring for the function 'wpmu_create_blog' says:
wpmu_new_blog is called with the following parameters:
do_action( 'wpmu_new_blog', $blog_id, $user_id, $domain, $path, $site_id, $meta );
Answered by Madra David on December 26, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP