Skip to content

Instantly share code, notes, and snippets.

@fritids
Forked from speedguy/wishlist-user-register
Last active August 29, 2015 14:10
Show Gist options
  • Save fritids/84c5f008f065d2007395 to your computer and use it in GitHub Desktop.
Save fritids/84c5f008f065d2007395 to your computer and use it in GitHub Desktop.
add_action('user_register', 'my_new_member');
function my_new_member($user_id) {
global $wpdb;
//Example of how to get the fields submitted via the form
if (isset($_POST['first_name'])) {
$firstname = $_POST['first_name'];
}
else {
$firstname = '';
}
//Adjust based on your specific columns
$data = array (
'user_id' => $user_id,
'first_name' => $firstname,
);
//Adjust with name of your database table
$wpdb->insert('wp_my_crm_data', $data);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment