File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -371,3 +371,20 @@ function wpum_register_profile_privacy_fields() {
371371 ) );
372372}
373373add_action ( 'carbon_fields_register_fields ' , 'wpum_register_profile_privacy_fields ' );
374+
375+ /**
376+ * Install default data when new site is added.
377+ * @param object $site
378+ * @return void
379+ */
380+ function wpum_multisite_new_site ( $ site ){
381+ if ( ! function_exists ( 'is_plugin_active_for_network ' ) ) {
382+ require_once ( ABSPATH . '/wp-admin/includes/plugin.php ' );
383+ }
384+ if ( is_plugin_active_for_network ( 'wp-user-manager/wp-user-manager.php ' ) ) {
385+ switch_to_blog ( $ site ->blog_id );
386+ wpum_run_install ();
387+ restore_current_blog ();
388+ }
389+ }
390+ add_action ( 'wp_initialize_site ' , 'wpum_multisite_new_site ' );
You can’t perform that action at this time.
0 commit comments