Skip to:
Content

BuddyPress.org

Changeset 9597


Ignore:
Timestamp:
03/05/2015 05:08:16 AM (7 years ago)
Author:
tw2113
Message:

Adds hooks documentation for bp-core-loader.php.

See #5940.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/bp-core-loader.php

    r9351 r9597  
    4444
    4545        /**
    46          * At this point in the stack, BuddyPress core has been loaded but
    47          * individual components (friends/activity/groups/etc...) have not.
    48          *
    49          * The 'bp_core_loaded' action lets you execute code ahead of the
    50          * other components.
     46         * Fires before the loading of individual components and after BuddyPress Core.
     47         *
     48         * Allows plugins to run code ahead of the other components.
     49         *
     50         * @since BuddyPress (1.2.0)
    5151         */
    5252        do_action( 'bp_core_loaded' );
     
    5454        /** Components ********************************************************/
    5555
    56         // Set the included and optional components.
     56        /**
     57         * Filters the included and optional components.
     58         *
     59         * @since BuddyPress (1.5.0)
     60         *
     61         * @param array $value Array of included and optional components.
     62         */
    5763        $bp->optional_components = apply_filters( 'bp_optional_components', array( 'activity', 'blogs', 'forums', 'friends', 'groups', 'messages', 'notifications', 'settings', 'xprofile' ) );
    5864
    59         // Set the required components
     65        /**
     66         * Filters the required components.
     67         *
     68         * @since BuddyPress (1.5.0)
     69         *
     70         * @param array $value Array of required components.
     71         */
    6072        $bp->required_components = apply_filters( 'bp_required_components', array( 'members' ) );
    6173
    6274        // Get a list of activated components
    6375        if ( $active_components = bp_get_option( 'bp-active-components' ) ) {
     76
     77            /** This filter is documented in bp-core/admin/bp-core-admin-components.php */
    6478            $bp->active_components      = apply_filters( 'bp_active_components', $active_components );
     79
     80            /**
     81             * Filters the deactivated components.
     82             *
     83             * @since BuddyPress (1.0.0)
     84             *
     85             * @param array $value Array of deactivated components.
     86             */
    6587            $bp->deactivated_components = apply_filters( 'bp_deactivated_components', array_values( array_diff( array_values( array_merge( $bp->optional_components, $bp->required_components ) ), array_keys( $bp->active_components ) ) ) );
    6688
     
    7395            }
    7496
    75             // Set globals
     97            /** This filter is documented in bp-core/bp-core-loader.php */
    7698            $bp->deactivated_components = apply_filters( 'bp_deactivated_components', $trimmed );
    7799
     
    79101            $active_components     = array_fill_keys( array_diff( array_values( array_merge( $bp->optional_components, $bp->required_components ) ), array_values( $bp->deactivated_components ) ), '1' );
    80102
    81             // Set the active component global
     103            /** This filter is documented in bp-core/admin/bp-core-admin-components.php */
    82104            $bp->active_components = apply_filters( 'bp_active_components', $bp->active_components );
    83105
     
    91113            $active_components     = array_fill_keys( array_values( array_merge( $bp->optional_components, $bp->required_components ) ), '1' );
    92114
    93             // Set the active component global
     115            /** This filter is documented in bp-core/admin/bp-core-admin-components.php */
    94116            $bp->active_components = apply_filters( 'bp_active_components', $bp->active_components );
    95117        }
     
    112134        $bp->required_components[] = 'core';
    113135
     136        /**
     137         * Fires after the loading of individual components.
     138         *
     139         * @since BuddyPress (2.0.0)
     140         */
    114141        do_action( 'bp_core_components_included' );
    115142    }
     
    180207        // Fetches the default Gravatar image to use if the user/group/blog has no avatar or gravatar
    181208        $bp->grav_default        = new stdClass;
     209
     210        /**
     211         * Filters the default user Gravatar.
     212         *
     213         * @since BuddyPress (1.1.0)
     214         *
     215         * @param string $value Default user Gravatar.
     216         */
    182217        $bp->grav_default->user  = apply_filters( 'bp_user_gravatar_default',  $bp->site_options['avatar_default'] );
     218
     219        /**
     220         * Filters the default group Gravatar.
     221         *
     222         * @since BuddyPress (1.1.0)
     223         *
     224         * @param string $value Default group Gravatar.
     225         */
    183226        $bp->grav_default->group = apply_filters( 'bp_group_gravatar_default', $bp->grav_default->user );
     227
     228        /**
     229         * Filters the default blog Gravatar.
     230         *
     231         * @since BuddyPress (1.1.0)
     232         *
     233         * @param string $value Default blog Gravatar.
     234         */
    184235        $bp->grav_default->blog  = apply_filters( 'bp_blog_gravatar_default',  $bp->grav_default->user );
    185236
     
    201252        bp_update_is_item_mod( false,                  'core' );
    202253
     254        /**
     255         * Fires at the end of the setup of bp-core globals setting.
     256         *
     257         * @since BuddyPress (1.1.0)
     258         */
    203259        do_action( 'bp_core_setup_globals' );
    204260    }
Note: See TracChangeset for help on using the changeset viewer.