Changeset 9844 for trunk/src/bp-core/bp-core-component.php
- Timestamp:
- 05/06/2015 11:01:27 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/bp-core-component.php
r9819 r9844 132 132 * 133 133 * @since BuddyPress (1.5.0) 134 * 135 * @uses BP_Component::setup_actions() Set up the hooks and actions. 136 * 137 * @param string $id Unique ID (for internal identification). Letters, 138 * numbers, and underscores only. 139 * @param string $name Unique name. This should be a translatable name, 140 * eg __( 'Groups', 'buddypress' ). 141 * @param string $path The file path for the component's files. Used by 142 * {@link BP_Component::includes()}. 143 * @param array $params Additional parameters used by the component. 144 * The config array supports the following values: 145 * - 'adminbar_myaccount_order' Sets the position for our 146 * component menu under the WP Toolbar's "My Account" menu. 134 * @since BuddyPress (1.9.0) Added $params as a parameter. 135 * @since BuddyPress (2.3.0) Added $params['features'] as a configurable value. 136 * 137 * @param string $id Unique ID. Letters, numbers, and underscores only. 138 * @param string $name Unique name. This should be a translatable name, eg. 139 * __( 'Groups', 'buddypress' ). 140 * @param string $path The file path for the component's files. Used by {@link BP_Component::includes()}. 141 * @param array $params { 142 * Additional parameters used by the component. 143 * @type int $adminbar_myaccount_order Set the position for our menu under the WP Toolbar's "My Account menu" 144 * @type array $features An array of feature names. This is used to load additional files from your 145 * component directory and for feature active checks. eg. array( 'awesome' ) 146 * would look for a file called "bp-{$this->id}-awesome.php" and you could use 147 * bp_is_active( $this->id, 'awesome' ) to determine if the feature is active. 148 * } 147 149 */ 148 150 public function start( $id = '', $name = '', $path = '', $params = array() ) { … … 162 164 if ( ! empty( $params['adminbar_myaccount_order'] ) ) { 163 165 $this->adminbar_myaccount_order = (int) $params['adminbar_myaccount_order']; 166 } 167 168 // Register features 169 if ( ! empty( $params['features'] ) ) { 170 $this->features = array_map( 'sanitize_title', (array) $params['features'] ); 164 171 } 165 172
Note: See TracChangeset
for help on using the changeset viewer.