WordPress.org

Make WordPress Core

Ticket #11395: 11395.diff

File 11395.diff, 563 bytes (added by Denis-de-Bernardy, 4 years ago)
  • wp-includes/pluggable.php

     
    716716 * 
    717717 * @since 2.0.0 
    718718 * 
    719  * @return bool True if user is logged in, false if not logged in. 
     719 * @return int the user's ID if user is logged in, false if not logged in. 
    720720 */ 
    721721function is_user_logged_in() { 
    722722        $user = wp_get_current_user(); 
     
    724724        if ( $user->id == 0 ) 
    725725                return false; 
    726726 
    727         return true; 
     727        return $user->id; 
    728728} 
    729729endif; 
    730730