Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: check_password

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

This hook occurs 2 times in this file.

Line Code
1394      // If the hash is still md5...
1395      if ( strlen($hash) <= 32 ) {
1396           $check = ( $hash == md5($password) );
1397           if ( $check && $user_id ) {
1398                // Rehash using new hash.
1399                wp_set_password($password, $user_id);
1400                $hash = wp_hash_password($password);
1401           }
1402
1403           return apply_filters('check_password', $check, $password, $hash, $user_id);
1404      }
1405
1406      // If the stored hash is longer than an MD5, presume the
1407      // new style phpass portable hash.
1408      if ( empty($wp_hasher) ) {
1409           require_once( ABSPATH . 'wp-includes/class-phpass.php');
1410           // By default, use the portable hash from phpass
1411           $wp_hasher = new PasswordHash(8, TRUE);
1412      }
1413
1414      $check = $wp_hasher->CheckPassword($password, $hash);
1415
1416      return apply_filters('check_password', $check, $password, $hash, $user_id);
1417 }
1418 endif;
1419
1420 if ( !function_exists('wp_generate_password') ) :
1421 /**
1422  * Generates a random password drawn from the defined set of characters.
1423  *
1424  * @since 2.5
1425  *