title: How to hook in wp_set_password WordPress function with WooCommerce?
body: <p>Im trying to change <code>wp_set_password</code> pluggable function and add custom action to it:</p>
  
  <pre><code>function wp_set_password( $password, $user_id ) {
      // Keep original WP code
      global $wpdb;
  
      $hash = wp_hash_password( $password );
      $wpdb-&gt;update(
          $wpdb-&gt;users,
          array(
              'user_pass'           =&gt; $hash,
              'user_activation_key' =&gt; '',
          ),
          array( 'ID' =&gt; $user_id )
      );
  
      wp_cache_delete( $user_id, 'users' );
  
      // and now add your own
      $custom_hash = password_hash( $password, PASSWORD_DEFAULT );
      update_user_meta($user_id, 'user_pass2', $custom_hash);
  }
  </code></pre>
  
  <p>I put this code in my custom plugin, but it doesnt run the custom action I wrote inside of it. I'm not sure what the problem is.</p>
  
  <p>Maybe I put it in on the wrong location or I should call it somewhere?</p>
  
  <p>How to hook in <code>wp_set_password()</code> WordPress function with WooCommerce?</p>
  
  <hr>
  
  <p><strong>Edit</strong></p>
  
  <p>This code doesn't fire at all, I tried to put the same password in users table but it doesn't care about my code and do the default action.</p>
  
  <hr>
  
  <p><strong>Edit 2</strong></p>
  
  <p>I comment the code in the plugin and changed the main <code>pluggable.php</code> file in the <code>wp-includes</code> folder, and added these 2 lines.</p>
  
  <pre><code>$custom_hash = $password;
  update_user_meta($user_id, 'user_pass2', $custom_hash);
  </code></pre>
  
  <p>But it still doesn't work.</p>
  
  <hr>
  
  <p><strong>Edit 3</strong></p>
  
  <p>I even removed the whole function from <code>pluggable.php</code>, It still works! I have created a username and password for new users.</p>
  
  <p>It should be WooCommerce registration. I use WooCommerce login system.</p>
  
  <hr>
  
  <p><strong>Edit 4</strong></p>
  
  <p>I used the WordPress registration system <code>/wp-login.ph</code>p and this code works finally.</p>
  
  <p>Now I'm wondering regarding WooCommerce where and how I could achieve something like this, updating the <code>wp_usermeta</code> table with something custom.</p>