[buddypress-trac] [BuddyPress] #3552: BP_Component::includes() loaded too early for plugins to extend

buddypress-trac at lists.automattic.com buddypress-trac at lists.automattic.com
Mon Sep 5 17:58:48 UTC 2011


#3552: BP_Component::includes() loaded too early for plugins to extend
--------------------------+-----------------
 Reporter:  boonebgorges  |      Owner:
     Type:  defect        |     Status:  new
 Priority:  normal        |  Milestone:  1.5
Component:  Core          |    Version:
 Severity:  normal        |   Keywords:
--------------------------+-----------------
 We currently recommend that BP plugins load themselves at 'bp_include'
 (implied priority 10). However, this means that they can't take advantage
 of BP_Component::includes(), which is hooked to bp_include with priority
 8. The reason the latter is the case is because core components (in
 particular, groups) have to be loaded before certain kinds of plugins are
 loaded (in particular, BP_Group_Extension plugins).

 So, a conundrum. A few options:
 - Recommend that plugins authors write their own methods for including
 files in their BP_Component plugins. In other words, don't use
 parent::includes( $includes ).
 - Add a new property to core components (like is_core_component or
 _builtin). If a component is_core_component, hook its include() method to
 bp_include with priority 8, as it is at present. Otherwise hook with
 priority 10. There is some precedent for this; WP post types have a
 _builtin flag.

-- 
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/3552>
BuddyPress <http://buddypress.org/>
BuddyPress


More information about the buddypress-trac mailing list