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
2062            * Filters whether the plaintext password matches the encrypted password.
2063            *
2064            * @since 2.5.0
2065            *
2066            * @param bool       $check    Whether the passwords match.
2067            * @param string     $password The plaintext password.
2068            * @param string     $hash     The hashed password.
2069            * @param string|int $user_id  User ID. Can be empty.
2070            */
2071           return apply_filters( 'check_password', $check, $password, $hash, $user_id );
2072      }
2073
2074      // If the stored hash is longer than an MD5, presume the
2075      // new style phpass portable hash.
2076      if ( empty($wp_hasher) ) {
2077           require_once( ABSPATH . WPINC . '/class-phpass.php');
2078           // By default, use the portable hash from phpass
2079           $wp_hasher = new PasswordHash(8, true);
2080      }
2081
2082      $check = $wp_hasher->CheckPassword($password, $hash);
2083
2084      /** This filter is documented in wp-includes/pluggable.php */
2085      return apply_filters( 'check_password', $check, $password, $hash, $user_id );
2086 }
2087 endif;
2088
2089 if ( !function_exists('wp_generate_password') ) :
2090 /**
2091  * Generates a random password drawn from the defined set of characters.
2092  *
2093  * @since 2.5.0
2094  *