Changeset 4775 for trunk/bp-core/bp-core-component.php
- Timestamp:
- 07/22/2011 07:32:48 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/bp-core-component.php
r4631 r4775 69 69 * - query: The loop for this component (WP_Query) 70 70 * - current_id: The current ID of the queried object 71 * @uses bp_Component:: _setup_globals() Setup the globals needed72 * @uses bp_Component:: _includes() Include the required files73 * @uses bp_Component:: _setup_actions() Setup the hooks and actions71 * @uses bp_Component::setup_globals() Setup the globals needed 72 * @uses bp_Component::includes() Include the required files 73 * @uses bp_Component::setup_actions() Setup the hooks and actions 74 74 */ 75 75 function start( $id, $name, $path ) { … … 84 84 85 85 // Move on to the next step 86 $this-> _setup_actions();86 $this->setup_actions(); 87 87 } 88 88 … … 98 98 * @param arr $args Used to 99 99 */ 100 function _setup_globals( $args = '' ) {100 function setup_globals( $args = '' ) { 101 101 global $bp; 102 102 … … 135 135 136 136 // Call action 137 do_action( 'bp_' . $this->id . ' _setup_globals' );137 do_action( 'bp_' . $this->id . 'setup_globals' ); 138 138 } 139 139 … … 144 144 * @access private 145 145 * 146 * @uses do_action() Calls 'bp_{@link bp_Component::name} _includes'147 */ 148 function _includes( $includes = '' ) {146 * @uses do_action() Calls 'bp_{@link bp_Component::name}includes' 147 */ 148 function includes( $includes = '' ) { 149 149 if ( empty( $includes ) ) 150 150 return; … … 155 155 // Check path + file 156 156 if ( @is_file( $this->path . '/' . $file ) ) 157 require _once( $this->path . '/' . $file );157 require( $this->path . '/' . $file ); 158 158 159 159 // Check path + /bp-component/ + file 160 160 elseif ( @is_file( $this->path . '/bp-' . $this->id . '/' . $file ) ) 161 require _once( $this->path . '/bp-' . $this->id . '/' . $file );161 require( $this->path . '/bp-' . $this->id . '/' . $file ); 162 162 163 163 // Check buddypress/bp-component/bp-component-$file.php 164 164 elseif ( @is_file( $this->path . '/bp-' . $this->id . '/bp-' . $this->id . '-' . $file . '.php' ) ) 165 require _once( $this->path . '/bp-' . $this->id . '/bp-' . $this->id . '-' . $file . '.php' );165 require( $this->path . '/bp-' . $this->id . '/bp-' . $this->id . '-' . $file . '.php' ); 166 166 167 167 } 168 168 169 169 // Call action 170 do_action( 'bp_' . $this->id . ' _includes' );170 do_action( 'bp_' . $this->id . 'includes' ); 171 171 } 172 172 … … 178 178 * 179 179 * @uses add_action() To add various actions 180 * @uses do_action() Calls 'bp_{@link BP_Component::name} _setup_actions'181 */ 182 function _setup_actions() {183 // Register post types 184 add_action( 'bp_setup_globals', array ( $this, ' _setup_globals'), 10 );180 * @uses do_action() Calls 'bp_{@link BP_Component::name}setup_actions' 181 */ 182 function setup_actions() { 183 // Register post types 184 add_action( 'bp_setup_globals', array ( $this, 'setup_globals' ), 10 ); 185 185 186 186 // Include required files. Called early to ensure that BP core components are … … 188 188 // the default priority of 10. This is for backwards compatibility; henceforth, 189 189 // plugins should register themselves by extending this base class. 190 add_action( 'bp_include', array ( $this, ' _includes'), 8 );191 192 // Register post types 193 add_action( 'bp_setup_nav', array ( $this, ' _setup_nav'), 10 );194 195 // Register post types 196 add_action( 'bp_setup_admin_bar', array ( $this, ' _setup_admin_bar'), 10 );197 198 // Register post types 199 add_action( 'bp_setup_title', array ( $this, ' _setup_title'), 10 );190 add_action( 'bp_include', array ( $this, 'includes' ), 8 ); 191 192 // Register post types 193 add_action( 'bp_setup_nav', array ( $this, 'setup_nav' ), 10 ); 194 195 // Register post types 196 add_action( 'bp_setup_admin_bar', array ( $this, 'setup_admin_bar' ), 10 ); 197 198 // Register post types 199 add_action( 'bp_setup_title', array ( $this, 'setup_title' ), 10 ); 200 200 201 201 // Register post types … … 212 212 213 213 // Additional actions can be attached here 214 do_action( 'bp_' . $this->id . ' _setup_actions' );214 do_action( 'bp_' . $this->id . 'setup_actions' ); 215 215 } 216 216 … … 221 221 * @param arr $sub_nav Optional 222 222 */ 223 function _setup_nav( $main_nav = '', $sub_nav = '' ) {223 function setup_nav( $main_nav = '', $sub_nav = '' ) { 224 224 225 225 // No sub nav items without a main nav item … … 236 236 237 237 // Call action 238 do_action( 'bp_' . $this->id . ' _setup_nav' );238 do_action( 'bp_' . $this->id . 'setup_nav' ); 239 239 } 240 240 … … 245 245 * @param array $wp_admin_menus 246 246 */ 247 function _setup_admin_bar( $wp_admin_nav = '' ) {247 function setup_admin_bar( $wp_admin_nav = '' ) { 248 248 249 249 // Bail if this is an ajax request … … 270 270 271 271 // Call action 272 do_action( 'bp_' . $this->id . ' _setup_admin_bar' );272 do_action( 'bp_' . $this->id . 'setup_admin_bar' ); 273 273 } 274 274 … … 278 278 * @since Buddypress {unknown} 279 279 * 280 * @uses do_action() Calls 'bp_{@link bp_Component::name} _setup_title'281 */ 282 function _setup_title( ) {283 do_action( 'bp_' . $this->id . ' _setup_title' );280 * @uses do_action() Calls 'bp_{@link bp_Component::name}setup_title' 281 */ 282 function setup_title( ) { 283 do_action( 'bp_' . $this->id . 'setup_title' ); 284 284 } 285 285
Note: See TracChangeset
for help on using the changeset viewer.