WordPress.org

Make WordPress Core


Ignore:
Timestamp:
04/06/2012 07:18:45 PM (10 years ago)
Author:
ryan
Message:

Introduce WP_User::exists(). see #20372

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-comments-post.php

    r19712 r20378  
    5555// If the user is logged in
    5656$user = wp_get_current_user();
    57 if ( $user->ID ) {
     57if ( $user->exists() ) {
    5858    if ( empty( $user->display_name ) )
    5959        $user->display_name=$user->user_login;
     
    7474$comment_type = '';
    7575
    76 if ( get_option('require_name_email') && !$user->ID ) {
     76if ( get_option('require_name_email') && !$user->exists() ) {
    7777    if ( 6 > strlen($comment_author_email) || '' == $comment_author )
    7878        wp_die( __('<strong>ERROR</strong>: please fill the required fields (name, email).') );
Note: See TracChangeset for help on using the changeset viewer.