[wp-trac] [WordPress Trac] #18458: calling is_user_logged_in() when logged-out throws PHP notice

WordPress Trac wp-trac at lists.automattic.com
Wed Aug 17 08:46:06 UTC 2011


#18458: calling is_user_logged_in() when logged-out throws PHP notice
------------------------------+-----------------------
 Reporter:  wonderboymusic    |       Owner:  dd32
     Type:  defect (bug)      |      Status:  accepted
 Priority:  normal            |   Milestone:  3.3
Component:  Warnings/Notices  |     Version:
 Severity:  normal            |  Resolution:
 Keywords:  has-patch         |
------------------------------+-----------------------
Changes (by dd32):

 * owner:   => dd32
 * status:  new => accepted
 * milestone:  Awaiting Review => 3.3


Comment:

 On non-XML-RPC pageloads, That shouldn't produce a notice, as
 $current_user should be an object similar to this:
 {{{
 object(WP_User)[723]
   public 'data' => null
   public 'ID' => int 0
   public 'caps' =>
     array
       empty
   public 'cap_key' => null
   public 'roles' =>
     array
       empty
   public 'allcaps' =>
     array
       empty
   public 'filter' => null
 }}}

 However, XML-RPC does have that issue.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/18458#comment:1>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list