title: Get user ID on user registering WordPress
body: <p>Im building a plugin for wordpress. I want to creat a row in a custom database table i have created called jp_test. I need the wordpress user ID in my custom table. My code do far is in the plugin index file but I have tried it in the theme functions.php too and it still doesnt work. can anyone suggest anything?</p>
  
  <pre><code>    function add_to_jp( $user_id ) {        
  
      global $wpdb;
  
      $jp_data = array( 
          'wp_user_ID' =&gt; $user_id,
          'jp_email' =&gt; '',
          'jp_telephone' =&gt; '',
          'extra' =&gt; ''
      );
  
      $wpdb-&gt;insert(  'jp_test', $jp_data); 
  
  }
  
  add_action( 'user_register', 'add_to_jp)');
  </code></pre>