Multisite table creation during activation hook
-
Hello. First of all thanks for the plugin, it’s great.
I have a multisite installation. Your plugin in
DIntegrationPlugin::activatecreate its own table (wp_adintegration) but it should create a table for every blog in the network.WordPress complains about the lacking of tables like
wp_X_adintegrationwhere X is the ID of the network blog. It can be easily fixed looping the blogs during the activation:$blogids = $wpdb->get_col("SELECT blog_id FROM $wpdb->blogs"); foreach($blogids as $blog_id) { switch_to_blog($blog_id); // create your table here as usual restore_current_blog(); } }Have a nice day
The topic ‘Multisite table creation during activation hook’ is closed to new replies.