Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




wp_set_password [ WordPress Function ]

wp_set_password ( $password, $user_id )
Parameters:
  • (string) $password The plaintext new user password
  • (int) $user_id User ID
Uses:
Defined at:



Updates the user's password with a new encrypted one.

For integration with other applications, this function can be overwritten to instead use the other package password checking algorithm.

Source


<?php
function wp_set_password$password$user_id ) {
    global 
$wpdb;

    
$hash wp_hash_password($password);
    
$wpdb->update($wpdb->users, array('user_pass' => $hash'user_activation_key' => ''), array('ID' => $user_id) );

    
wp_cache_delete($user_id'users');
}
?>

Examples [ wp-snippets.com ]

Google Arama Sonuçlarý

Dahasý ...

Kullanýcý Tartýþmalarý [ wordpress.org ]

- Bulunamadý -

Yeni bir konu yaz ...

0 User Note(s)

Henüz yok. Ýlk sen ol!

Yeni Ekle ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics