[wp-trac] [WordPress Trac] #14842: Efficiency improvement for is_super_admin()

WordPress Trac wp-trac at lists.automattic.com
Sun Sep 12 09:06:29 UTC 2010

#14842: Efficiency improvement for is_super_admin()
 Reporter:  mdawaffe     |        Owner:          
     Type:  enhancement  |       Status:  reopened
 Priority:  normal       |    Milestone:  3.1     
Component:  Multisite    |      Version:  3.0.1   
 Severity:  normal       |   Resolution:          
 Keywords:  has-patch    |  
Changes (by hakre):

  * status:  closed => reopened
  * resolution:  fixed =>


 Thanks for the initiative. In full respect of the close and honoring the
 fact that the current patch already improves the named topic, I gently re-
 open this ticket because of some minor stuff:

 It's only a small issue, but following the PHP 4 related wordpress coding
 practices, the change makes no use of &new here which is common to prevent
 object clones on PHP4 installs.

 I've added a patch that is reflecting this _really_ minor thing ($user is
 a local variable, so the copy here is limited to one per call until the
 garbage collector removes it again).

 If it's considered to ignore the {{{&new}}} here, I could greatly
 appreciate that. For such alternative case, I've attached a second view on
 the function.

 The second view might me interesting for the &new case as well but it
 needs some changes then.

 Let me know if I should open a new ticket instead of re-opening this one.

 As this ticket is about refactoring that function I thought it's worth to
 add some view. Becasue this is all minor I didn't want to clutter trac
 with a new ticket as there was already one.


 A related question: Why don't we add a {{{is_super_admin()}}} function to
 the user class?

Ticket URL: <http://core.trac.wordpress.org/ticket/14842#comment:4>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software

More information about the wp-trac mailing list