Changeset 8610 for trunk/src/bp-groups/bp-groups-loader.php
- Timestamp:
- 07/12/2014 03:01:27 AM (11 years ago)
- File:
-
- 1 edited
-
trunk/src/bp-groups/bp-groups-loader.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-groups/bp-groups-loader.php
r8605 r8610 241 241 } 242 242 243 if ( bp_is_groups_component() && !empty( $this->current_group ) ) {244 245 $this->default_extension = apply_filters( 'bp_groups_default_extension', defined( 'BP_GROUPS_DEFAULT_EXTENSION' ) ? BP_GROUPS_DEFAULT_EXTENSION : 'home' );246 247 if ( !bp_current_action() ) {248 $bp->current_action = $this->default_extension;249 }250 251 // Prepare for a redirect to the canonical URL252 $bp->canonical_stack['base_url'] = bp_get_group_permalink( $this->current_group );253 254 if ( bp_current_action() ) {255 $bp->canonical_stack['action'] = bp_current_action();256 }257 258 if ( !empty( $bp->action_variables ) ) {259 $bp->canonical_stack['action_variables'] = bp_action_variables();260 }261 262 // When viewing the default extension, the canonical URL should not have263 // that extension's slug, unless more has been tacked onto the URL via264 // action variables265 if ( bp_is_current_action( $this->default_extension ) && empty( $bp->action_variables ) ) {266 unset( $bp->canonical_stack['action'] );267 }268 269 }270 271 243 // Preconfigured group creation steps 272 244 $this->group_creation_steps = apply_filters( 'groups_create_group_steps', array( … … 306 278 // Auto join group when non group member performs group activity 307 279 $this->auto_join = defined( 'BP_DISABLE_AUTO_GROUP_JOIN' ) && BP_DISABLE_AUTO_GROUP_JOIN ? false : true; 280 } 281 282 /** 283 * Set up canonical stack for this component. 284 * 285 * @since BuddyPress (2.1.0) 286 */ 287 public function setup_canonical_stack() { 288 if ( ! bp_is_groups_component() ) { 289 return; 290 } 291 292 if ( empty( $this->current_group ) ) { 293 return; 294 } 295 296 297 $this->default_extension = apply_filters( 'bp_groups_default_extension', defined( 'BP_GROUPS_DEFAULT_EXTENSION' ) ? BP_GROUPS_DEFAULT_EXTENSION : 'home' ); 298 299 if ( !bp_current_action() ) { 300 buddypress()->current_action = $this->default_extension; 301 } 302 303 // Prepare for a redirect to the canonical URL 304 buddypress()->canonical_stack['base_url'] = bp_get_group_permalink( $this->current_group ); 305 306 if ( bp_current_action() ) { 307 buddypress()->canonical_stack['action'] = bp_current_action(); 308 } 309 310 if ( !empty( buddypress()->action_variables ) ) { 311 buddypress()->canonical_stack['action_variables'] = bp_action_variables(); 312 } 313 314 // When viewing the default extension, the canonical URL should not have 315 // that extension's slug, unless more has been tacked onto the URL via 316 // action variables 317 if ( bp_is_current_action( $this->default_extension ) && empty( buddypress()->action_variables ) ) { 318 unset( buddypress()->canonical_stack['action'] ); 319 } 308 320 } 309 321
Note: See TracChangeset
for help on using the changeset viewer.