I want to add an extra table during the signup/activate process..
I've added the table in schema.php but that doesn't seem to work. I can't find any other CREATE statements in the code.
Where can I add this extra table?
I want to add an extra table during the signup/activate process..
I've added the table in schema.php but that doesn't seem to work. I can't find any other CREATE statements in the code.
Where can I add this extra table?
I would write a php function and drop the file in mu-plugins
use add_action()
to execute your function when the user registers
see http://codex.wordpress.org/Function_Reference/add_action
for more info on add_action
That looks so simple! Thanks for pointing it out!
This works for me. Thanks!
<?php
// add the mailer tables after signup
function mailer_make_tables($ID) {
global $wpdb;
$table_name = "wp_" . $ID . "_mailer";
$query = "CREATE TABLE $table_name
(
mail_id
bigint(20) NOT NULL auto_increment,
mail_address
varchar(255) NOT NULL,
mail_name
varchar(255) NOT NULL,
PRIMARY KEY (mail_id
))
ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=33";
$wpdb->query($query);
return true;
}
add_action('user_register', 'mailer_make_tables');
?>