Ticket #3769: 3769.02.patch
| File 3769.02.patch, 2.3 KB (added by , 13 years ago) |
|---|
-
bp-core/bp-core-component.php
class BP_Component { 89 89 * - id: Unique ID (for internal identification). Letters, numbers, and underscores only 90 90 * - name: Unique name. This should be a translatable name, eg __( 'Groups', 'buddypress' ) 91 91 * - path: The file path for the component's files. Used by BP_Component::includes() 92 * - params: Array of additional parameters used for the component loader. Currently accepts 'adminbar_position'. 92 93 * @uses bp_Component::setup_actions() Setup the hooks and actions 93 94 */ 94 function start( $id, $name, $path ) {95 function start( $id, $name, $path, $params = false ) { 95 96 // Internal identifier of component 96 97 $this->id = $id; 97 98 … … class BP_Component { 101 102 // Path for includes 102 103 $this->path = $path; 103 104 105 // Miscellaneous component params 106 if ( ! empty( $params ) ) { 107 // set the priority of the component's menu under the WP Toolbar's "My Account" menu 108 if ( ! empty( $params['adminbar_position'] ) && is_numeric( $params['adminbar_position'] ) ) 109 $this->adminbar_position = $params['adminbar_position']; 110 } 111 // Set defaults if not passed 112 else { 113 $this->adminbar_position = 10; 114 } 115 104 116 // Move on to the next step 105 117 $this->setup_actions(); 106 118 } … … class BP_Component { 250 262 add_action( 'bp_setup_nav', array ( $this, 'setup_nav' ), 10 ); 251 263 252 264 // Setup WP Toolbar menus 253 add_action( 'bp_setup_admin_bar', array ( $this, 'setup_admin_bar' ), 10);265 add_action( 'bp_setup_admin_bar', array ( $this, 'setup_admin_bar' ), $this->adminbar_position ); 254 266 255 267 // Setup component title 256 268 add_action( 'bp_setup_title', array ( $this, 'setup_title' ), 10 ); -
bp-friends/bp-friends-loader.php
class BP_Friends_Component extends BP_Component { 22 22 parent::start( 23 23 'friends', 24 24 __( 'Friend Connections', 'buddypress' ), 25 BP_PLUGIN_DIR 25 BP_PLUGIN_DIR, 26 array( 27 'adminbar_position' => 30 28 ) 26 29 ); 27 30 } 28 31