[wp-trac] [WordPress Trac] #14728: capabilities.php does not include pluggable.php

WordPress Trac wp-trac at lists.automattic.com
Sun Aug 29 21:38:17 UTC 2010


#14728: capabilities.php does not include pluggable.php
--------------------------+-------------------------------------------------
 Reporter:  BlaenkDenum   |       Owner:                         
     Type:  defect (bug)  |      Status:  new                    
 Priority:  normal        |   Milestone:  Awaiting Review        
Component:  General       |     Version:  3.0.1                  
 Severity:  normal        |    Keywords:  reporter-feedback close
--------------------------+-------------------------------------------------

Comment(by BlaenkDenum):

 Replying to [comment:1 nacin]:
 > You're calling is_super_admin() too early. The function may exist, but
 you can't reliably perform any user actions until the initialization hook.

 Is the call to is_super_admin the problem though? From what I can tell,
 the function is being correctly called, it's when it gets to within the
 function that it calls wp_get_current_user that it crashes.

 Is there any way I can resolve this? I tried passing in the user id myself
 so that it didn't take that conditional path. I did something like this:

 {{{
 global $current_user;
 $current_user = wp_get_current_user();
 if (function_exists('is_super_admin')) {
     return is_super_admin($current_user->ID);
 }
 }}}

 But even then, now ''my'' plugin can't find the function (I would have to
 include pluggable.php myself).

 Is there any solution to this problem?

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


More information about the wp-trac mailing list