[buddypress-trac] [BuddyPress Trac] #7140: Class autoloading needs to check if the component is active before including the class

buddypress-trac noreply at wordpress.org
Sat Jun 25 00:30:44 UTC 2016


#7140: Class autoloading needs to check if the component is active before
including the class
--------------------------+--------------------
 Reporter:  r-a-y         |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  2.6.1
Component:  Core          |     Version:  2.6.0
 Severity:  major         |  Resolution:
 Keywords:  has-patch     |
--------------------------+--------------------

Comment (by r-a-y):

 > I'm not sure that calling that "bad code" is fair. It was accurate and
 was a reasonable safety net, right up until we started autoloading, ha ha.

 This.  Definitely not anyone's fault.  We were basically telling people to
 use `class_exists()` calls in the older Skeleton Component plugin.

 > Ha ha, I'm sure some of those on github are mine

 It's not just you :)

 >  based on the examples in Ye Olde Skeleton Plugin sample plugin (maybe
 we should update that to reflect the modern state of things?), and on
 examples in our own Codex:
 > https://codex.buddypress.org/developer/group-extension-api/

 Yes, let's definitely do this in both the codex and the Skeleton
 Component.

 > if ( bp_is_active( 'groups' ) ) {}

 IMO, this should be sufficient.

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/7140#comment:9>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list