- Timestamp:
- 05/03/2023 06:18:23 AM (19 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-groups/classes/class-bp-groups-component.php
r13464 r13468 179 179 in_array( bp_current_action(), array( 'create', 'join', 'leave-group' ), true ) 180 180 ) { 181 require $this->path . 'bp-groups/actions/' . bp_current_action() . '.php';181 require_once $this->path . 'bp-groups/actions/' . bp_current_action() . '.php'; 182 182 } 183 183 184 184 // Actions - RSS feed handler. 185 185 if ( bp_is_active( 'activity' ) && bp_is_current_action( 'feed' ) ) { 186 require $this->path . 'bp-groups/actions/feed.php';186 require_once $this->path . 'bp-groups/actions/feed.php'; 187 187 } 188 188 189 189 // Actions - Random group handler. 190 190 if ( isset( $_GET['random-group'] ) ) { 191 require $this->path . 'bp-groups/actions/random.php';191 require_once $this->path . 'bp-groups/actions/random.php'; 192 192 } 193 193 194 194 // Screens - Directory. 195 195 if ( bp_is_groups_directory() ) { 196 require $this->path . 'bp-groups/screens/directory.php';196 require_once $this->path . 'bp-groups/screens/directory.php'; 197 197 } 198 198 199 199 // Screens - User profile integration. 200 200 if ( bp_is_user() ) { 201 require $this->path . 'bp-groups/screens/user/my-groups.php';201 require_once $this->path . 'bp-groups/screens/user/my-groups.php'; 202 202 203 203 if ( bp_is_current_action( 'invites' ) ) { 204 require $this->path . 'bp-groups/screens/user/invites.php';204 require_once $this->path . 'bp-groups/screens/user/invites.php'; 205 205 } 206 206 } … … 209 209 if ( bp_is_group() ) { 210 210 // Actions - Access protection. 211 require $this->path . 'bp-groups/actions/access.php';211 require_once $this->path . 'bp-groups/actions/access.php'; 212 212 213 213 // Public nav items. 214 214 if ( in_array( bp_current_action(), array( 'home', 'request-membership', 'activity', 'members', 'send-invites' ), true ) ) { 215 require $this->path . 'bp-groups/screens/single/' . bp_current_action() . '.php';215 require_once $this->path . 'bp-groups/screens/single/' . bp_current_action() . '.php'; 216 216 } 217 217 218 218 // Admin nav items. 219 219 if ( bp_is_item_admin() && is_user_logged_in() ) { 220 require $this->path . 'bp-groups/screens/single/admin.php';220 require_once $this->path . 'bp-groups/screens/single/admin.php'; 221 221 222 222 if ( in_array( bp_get_group_current_admin_tab(), array( 'edit-details', 'group-settings', 'group-avatar', 'group-cover-image', 'manage-members', 'membership-requests', 'delete-group' ), true ) ) { 223 require $this->path . 'bp-groups/screens/single/admin/' . bp_get_group_current_admin_tab() . '.php';223 require_once $this->path . 'bp-groups/screens/single/admin/' . bp_get_group_current_admin_tab() . '.php'; 224 224 } 225 225 } … … 554 554 // Prepare for a redirect to the canonical URL. 555 555 $bp->canonical_stack['base_url'] = bp_get_group_url( $this->current_group ); 556 557 if ( bp_current_action() ) { 558 $bp->canonical_stack['action'] = bp_current_action(); 559 } 556 $current_action = bp_current_action(); 560 557 561 558 /** … … 567 564 */ 568 565 if ( ! $this->current_group->front_template && ( bp_is_current_action( 'activity' ) || ( ! bp_is_active( 'activity' ) && bp_is_current_action( 'members' ) ) ) ) { 569 $bp->canonical_stack['action'] = 'home'; 570 } 571 572 if ( ! empty( $bp->action_variables ) ) { 573 $bp->canonical_stack['action_variables'] = bp_action_variables(); 574 } 575 576 // When viewing the default extension, the canonical URL should not have 577 // that extension's slug, unless more has been tacked onto the URL via 578 // action variables. 566 $current_action = 'home'; 567 } 568 569 if ( $current_action ) { 570 $context = 'read'; 571 $path_chunks = bp_groups_get_path_chunks( array( $current_action ), $context ); 572 $bp->canonical_stack['action'] = $current_action; 573 574 if ( isset( $path_chunks['single_item_action'] ) ) { 575 $bp->canonical_stack['action'] = $path_chunks['single_item_action']; 576 } 577 578 if ( ! empty( $bp->action_variables ) ) { 579 $key_action_variables = 'single_item_action_variables'; 580 581 if ( bp_is_group_admin_page() ) { 582 $context = 'manage'; 583 } elseif ( bp_is_group_create() ) { 584 $context = 'create'; 585 $key_action_variables = 'create_single_item_variables';; 586 } 587 588 $path_chunks = bp_groups_get_path_chunks( $bp->action_variables, $context ); 589 $bp->canonical_stack['action_variables'] = bp_action_variables(); 590 591 if ( isset( $path_chunks[ $key_action_variables ] ) ) { 592 $bp->canonical_stack['action_variables'] = $path_chunks[ $key_action_variables ]; 593 } 594 } 595 } 596 597 /* 598 * When viewing the default extension, the canonical URL should not have 599 * that extension's slug, unless more has been tacked onto the URL via 600 * action variables. 601 */ 579 602 if ( bp_is_current_action( $this->default_extension ) && empty( $bp->action_variables ) ) { 580 603 unset( $bp->canonical_stack['action'] ); … … 1125 1148 $bp->action_variables = array( $group_type_slug ); 1126 1149 } else { 1127 $bp->current_component = false; 1150 $bp->current_component = false; 1151 $this->current_directory_type = ''; 1128 1152 bp_do_404(); 1129 1153 return;
Note: See TracChangeset
for help on using the changeset viewer.