Changeset 7454 for trunk/bp-core/bp-core-component.php
- Timestamp:
- 10/22/2013 07:31:29 PM (12 years ago)
- File:
-
- 1 edited
-
trunk/bp-core/bp-core-component.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/bp-core-component.php
r7445 r7454 115 115 * @since BuddyPress (1.5.0) 116 116 * 117 * @uses bp_Component::setup_actions() Set up the hooks and actions.117 * @uses BP_Component::setup_actions() Set up the hooks and actions. 118 118 * 119 119 * @param string $id Unique ID (for internal identification). Letters, … … 123 123 * @param string $path The file path for the component's files. Used by 124 124 * {@link BP_Component::includes()}. 125 */ 126 public function start( $id = '', $name = '', $path = '' ) { 125 * @param array $params Additional parameters used by the component. 126 * The config array supports the following values: 127 * - 'adminbar_myaccount_order' Sets the position for our 128 * component menu under the WP Toolbar's "My Account" menu. 129 */ 130 public function start( $id = '', $name = '', $path = '', $params = array() ) { 127 131 128 132 // Internal identifier of component … … 134 138 // Path for includes 135 139 $this->path = $path; 140 141 // Miscellaneous component parameters that need to be set early on 142 if ( ! empty( $params ) ) { 143 // Sets the position for our menu under the WP Toolbar's "My Account" menu 144 if ( ! empty( $params['adminbar_myaccount_order'] ) ) { 145 $this->adminbar_myaccount_order = (int) $params['adminbar_myaccount_order']; 146 } 147 148 // Set defaults if not passed 149 } else { 150 // new component menus are added before the settings menu if not set 151 $this->adminbar_myaccount_order = 90; 152 } 136 153 137 154 // Move on to the next step … … 305 322 306 323 // Setup WP Toolbar menus 307 add_action( 'bp_setup_admin_bar', array( $this, 'setup_admin_bar' ), 10);324 add_action( 'bp_setup_admin_bar', array( $this, 'setup_admin_bar' ), $this->adminbar_myaccount_order ); 308 325 309 326 // Setup component title
Note: See TracChangeset
for help on using the changeset viewer.