register_activation_hook
-
Hi,
i′m writing a plugin. But i have a problem with the install routine.
When i want to activate the plugin, i get the error “Das Plugin kann nicht aktiviert werden, da es einen fatalen Fehler erzeugt.” that means “The plugin cannot be activated. It caused a fatal error.”
But i see no error message.
I′ve tried a lot.// multiside installation function ecp_activate($networkwide) { global $wpdb; if (function_exists('is_multisite') && is_multisite()) { if ($networkwide) { $old_blog = $wpdb->blogid; $blogids = $wpdb->get_col("SELECT blog_id FROM $wpdb->blogs"); foreach ($blogids as $blog_id) { switch_to_blog($blog_id); ecp_install(); } switch_to_blog($old_blog); return; } } // single installation ecp_install(); } // install function function ecp_install(){ global $wpdb; $ecp_table = "CREATE TABLE IF NOT******and so on***** $wpdb->query($ecp_table); } register_activation_hook( __FILE__, 'ecp_activate' );
Whats wrong?
Best regards
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘register_activation_hook’ is closed to new replies.