WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )apply_filters( "hook_name", "what_to_filter" ).Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
This hook occurs 2 times in this file.
| Line | Code |
|---|---|
| 2349 | * Filters whether the plaintext password matches the encrypted password. |
| 2350 | * |
| 2351 | * @since 2.5.0 |
| 2352 | * |
| 2353 | * @param bool $check Whether the passwords match. |
| 2354 | * @param string $password The plaintext password. |
| 2355 | * @param string $hash The hashed password. |
| 2356 | * @param string|int $user_id User ID. Can be empty. |
| 2357 | */ |
| 2358 | return apply_filters( 'check_password', $check, $password, $hash, $user_id ); |
| 2359 | } |
| 2360 | |
| 2361 | // If the stored hash is longer than an MD5, presume the |
| 2362 | // new style phpass portable hash. |
| 2363 | if ( empty( $wp_hasher ) ) { |
| 2364 | require_once( ABSPATH . WPINC . '/class-phpass.php' ); |
| 2365 | // By default, use the portable hash from phpass |
| 2366 | $wp_hasher = new PasswordHash( 8, true ); |
| 2367 | } |
| 2368 | |
| 2369 | $check = $wp_hasher->CheckPassword( $password, $hash ); |
| 2370 | |
| 2371 | /** This filter is documented in wp-includes/pluggable.php */ |
| 2372 | return apply_filters( 'check_password', $check, $password, $hash, $user_id ); |
| 2373 | } |
| 2374 | endif; |
| 2375 | |
| 2376 | if ( ! function_exists( 'wp_generate_password' ) ) : |
| 2377 | /** |
| 2378 | * Generates a random password drawn from the defined set of characters. |
| 2379 | * |
| 2380 | * Uses wp_rand() is used to create passwords with far less predictability |
| 2381 | * than similar native PHP functions like `rand()` or `mt_rand()`. |