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
1992            * Filter whether the plaintext password matches the encrypted password.
1993            *
1994            * @since 2.5.0
1995            *
1996            * @param bool   $check    Whether the passwords match.
1997            * @param string $password The plaintext password.
1998            * @param string $hash     The hashed password.
1999            * @param int    $user_id  User ID.
2000            */
2001           return apply_filters( 'check_password', $check, $password, $hash, $user_id );
2002      }
2003
2004      // If the stored hash is longer than an MD5, presume the
2005      // new style phpass portable hash.
2006      if ( empty($wp_hasher) ) {
2007           require_once( ABSPATH . WPINC . '/class-phpass.php');
2008           // By default, use the portable hash from phpass
2009           $wp_hasher = new PasswordHash(8, true);
2010      }
2011
2012      $check = $wp_hasher->CheckPassword($password, $hash);
2013
2014      /** This filter is documented in wp-includes/pluggable.php */
2015      return apply_filters( 'check_password', $check, $password, $hash, $user_id );
2016 }
2017 endif;
2018
2019 if ( !function_exists('wp_generate_password') ) :
2020 /**
2021  * Generates a random password drawn from the defined set of characters.
2022  *
2023  * @since 2.5.0
2024  *