Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
09/07/2011 03:57:53 PM (15 years ago)
Author:
boonebgorges
Message:

Clarifies how plugins should use BP_Component::includes() in the inline docs. Fixes #3552

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core/bp-core-component.php

    r5099 r5122  
    152152         * Include required files
    153153         *
     154         * Please note that, by default, this method is fired on the bp_include hook, with priority
     155         * 8. This is necessary so that core components are loaded in time to be available to
     156         * third-party plugins. However, this load order means that third-party plugins whose main
     157         * files are loaded at bp_include with priority 10 (as recommended), will not be loaded in
     158         * time for their includes() method to fire automatically.
     159         *
     160         * For this reason, it is recommended that your plugin has its own method or function for
     161         * requiring necessary files. If you must use this method, you will have to call it manually
     162         * in your constructor class, ie
     163         *   $this->includes();
     164         *
     165         * Note that when you pass an array value like 'actions' to includes, it looks for the
     166         * following three files (assuming your component is called 'my_component'):
     167         *   - ./actions
     168         *   - ./bp-my_component/actions
     169         *   - ./bp-my_component/bp-my_component-actions.php
     170         *
    154171         * @since 1.5
    155172         * @access private
    … …  
    193210        function setup_actions() {
    194211
    195                 // Setup globals 
     212                // Setup globals
    196213                add_action( 'bp_setup_globals',          array ( $this, 'setup_globals'          ), 10 );
    197214
Note: See TracChangeset for help on using the changeset viewer.