user_pass_ok

Check that the user login name and password is correct.

Description

user_pass_ok( (string) $user_login, (string) $user_pass ); 

Parameters (2)

0. $user_login (string)
The user login.
1. $user_pass (string)
The user pass.

Usage

  1. if ( !function_exists( 'user_pass_ok' ) ) { 
  2. require_once ABSPATH . WPINC . '/deprecated.php'; 
  3.  
  4. // The user login. 
  5. $user_login = ''; 
  6.  
  7. // The user pass. 
  8. $user_pass = ''; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = user_pass_ok($user_login, $user_pass); 
  12.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/deprecated.php  
  1. function user_pass_ok($user_login, $user_pass) { 
  2. _deprecated_function( __FUNCTION__, '3.5.0', 'wp_authenticate()' ); 
  3. $user = wp_authenticate( $user_login, $user_pass ); 
  4. if ( is_wp_error( $user ) ) 
  5. return false; 
  6.  
  7. return true;