[wp-trac] [WordPress Trac] #24962: Return the allcaps array from the get_role_caps() function

WordPress Trac noreply at wordpress.org
Mon Sep 16 08:04:28 UTC 2013


#24962: Return the allcaps array from the get_role_caps() function
-----------------------------------+--------------------
 Reporter:  nofearinc              |       Owner:
     Type:  defect (bug)           |      Status:  new
 Priority:  normal                 |   Milestone:  3.7
Component:  Users                  |     Version:  trunk
 Severity:  normal                 |  Resolution:
 Keywords:  has-patch 2nd-opinion  |
-----------------------------------+--------------------

Comment (by nofearinc):

 The Core usage of the function is only in capabilities.php and only to
 flush the caps, so the naming is incorrect. However the function code is
 helpful outside of the core in plugins, and personally I don't see a
 reason to call a `get` function and then use a separate field (I generally
 consider accessing fields through properties an encapsulation best
 practice).

 I would also consider renaming the function but it's since 2.0.0 and who
 knows how many plugins/scripts have been using that already.

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


More information about the wp-trac mailing list