This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.
BP_Core::load_components()
Load components files
Description
Source
File: bp-core/classes/class-bp-core.php
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 | private function load_components() { $bp = buddypress(); /** * Filters the included and optional components. * * @since BuddyPress 1.5.0 * * @param array $value Array of included and optional components. */ $bp ->optional_components = apply_filters( 'bp_optional_components' , array_keys (bp_core_get_components( 'optional' ))); /** * Filters the required components. * * @since BuddyPress 1.5.0 * * @param array $value Array of required components. */ $bp ->required_components = apply_filters( 'bp_required_components' , array ( 'members' , 'xprofile' )); // Get a list of activated components. if ( $active_components = bp_get_option( 'bp-active-components' )) { /** This filter is documented in bp-core/admin/bp-core-admin-components.php */ $bp ->active_components = apply_filters( 'bp_active_components' , $active_components ); /** * Filters the deactivated components. * * @since BuddyPress 1.0.0 * * @param array $value Array of deactivated components. */ $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)))); // Pre 1.5 Backwards compatibility. } elseif ( $deactivated_components = bp_get_option( 'bp-deactivated-components' )) { // Trim off namespace and filename. foreach ( array_keys (( array ) $deactivated_components ) as $component ) { $trimmed [] = str_replace ( '.php' , '' , str_replace ( 'bp-' , '' , $component )); } /** This filter is documented in bp-core/bp-core-loader.php */ $bp ->deactivated_components = apply_filters( 'bp_deactivated_components' , $trimmed ); // Setup the active components. $active_components = array_fill_keys( array_diff ( array_values ( array_merge ( $bp ->optional_components, $bp ->required_components)), array_values ( $bp ->deactivated_components)), '1' ); /** This filter is documented in bp-core/admin/bp-core-admin-components.php */ $bp ->active_components = apply_filters( 'bp_active_components' , $bp ->active_components); // Default to all components active. } else { // Set globals. $bp ->deactivated_components = array (); // Setup the active components. $active_components = array_fill_keys( array_values ( array_merge ( $bp ->optional_components, $bp ->required_components)), '1' ); /** This filter is documented in bp-core/admin/bp-core-admin-components.php */ $bp ->active_components = apply_filters( 'bp_active_components' , $bp ->active_components); } // Loop through optional components. foreach ( $bp ->optional_components as $component ) { if (bp_is_active( $component ) && file_exists ( $bp ->plugin_dir . '/bp-' . $component . '/bp-' . $component . '-loader.php' )) { include $bp ->plugin_dir . '/bp-' . $component . '/bp-' . $component . '-loader.php' ; } } // Loop through required components. foreach ( $bp ->required_components as $component ) { if ( file_exists ( $bp ->plugin_dir . '/bp-' . $component . '/bp-' . $component . '-loader.php' )) { include $bp ->plugin_dir . '/bp-' . $component . '/bp-' . $component . '-loader.php' ; } } // Add Core to required components. $bp ->required_components[] = 'core' ; /** * Fires after the loading of individual components. * * @since BuddyPress 2.0.0 */ do_action( 'bp_core_components_included' ); } |
Changelog
Version | Description |
---|---|
BuddyBoss 1.0.0 | Introduced. |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.