Title: Error in codex example ?
Last modified: August 20, 2016

---

# Error in codex example ?

 *  [Boulli](https://wordpress.org/support/users/boulli/)
 * (@boulli)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/error-in-codex-example/)
 * Hi,
 * In [wp_check_password](http://codex.wordpress.org/Function_Reference/wp_check_password),
   should the example :
 * if ( $user = get_user_by(‘login’, $username) && wp_check_password( $pass, $user-
   >data->user_pass, $user->ID))
    echo “That’s it”;
 * not be
 * if (**(** $user = get_user_by(‘login’, $username) **)** && wp_check_password(
   $pass, $user->data->user_pass, $user->ID))
    echo “That’s it”;
 * or just
 * if ( $user = get_user_by(‘login’, $username) **and** wp_check_password( $pass,
   $user->data->user_pass, $user->ID))
    echo “That’s it”;
 * because of operators precedences?
 * If not why am I wrong? It works only like this for me…

Viewing 1 replies (of 1 total)

 *  Moderator [keesiemeijer](https://wordpress.org/support/users/keesiemeijer/)
 * (@keesiemeijer)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/error-in-codex-example/#post-3445876)
 * If you want you can edit the codex yourself by logging in with your WordPress
   forum username and password:
 * [http://make.wordpress.org/support/handbook/contributing-to-the-wordpress-codex/](http://make.wordpress.org/support/handbook/contributing-to-the-wordpress-codex/)
   
   [http://codex.wordpress.org/index.php?title=Special:UserLogin&returnto=Main_Page](http://codex.wordpress.org/index.php?title=Special:UserLogin&returnto=Main_Page)

Viewing 1 replies (of 1 total)

The topic ‘Error in codex example ?’ is closed to new replies.

 * In: [Requests and Feedback](https://wordpress.org/support/forum/requests-and-feedback/)
 * 1 reply
 * 2 participants
 * Last reply from: [keesiemeijer](https://wordpress.org/support/users/keesiemeijer/)
 * Last activity: [13 years, 4 months ago](https://wordpress.org/support/topic/error-in-codex-example/#post-3445876)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
