Changeset 5990
- Timestamp:
- 04/14/2012 07:54:22 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/bp-core-buddybar.php
r5935 r5990 79 79 // (eg: http://example.com/members/membername/activity/just-me/) 80 80 // The canonical version will not contain this subnav slug. 81 if ( !empty( $default_subnav_slug ) && bp_is_current_action( $default_subnav_slug ) ) { 82 83 // bbPress 2.x uses pretty pagination, so whitelist 'page' 84 if ( ! bp_is_action_variable( 'page', 0 ) && ! bp_action_variable( 1 ) ) { 85 unset( $bp->canonical_stack['action'] ); 86 } 81 if ( !empty( $default_subnav_slug ) && bp_is_current_action( $default_subnav_slug ) && !bp_action_variable( 0 ) ) { 82 unset( $bp->canonical_stack['action'] ); 87 83 } elseif ( ! bp_current_action() ) { 88 84 $func = is_object( $screen_function[0] ) ? array( &$screen_function[0], $screen_function[1] ) : $screen_function; … … 115 111 $r = wp_parse_args( $args, $defaults ); 116 112 extract( $r, EXTR_SKIP ); 117 113 118 114 if ( $function = $bp->bp_nav[$parent_slug]['screen_function'] ) { 119 115 if ( is_object( $function[0] ) ) { … … 127 123 128 124 if ( bp_is_current_component( $parent_slug ) ) { 129 125 130 126 // The only way to tell whether to set the subnav is to peek at the unfiltered_uri 131 127 // Find the component 132 128 $component_uri_key = array_search( $parent_slug, $bp->unfiltered_uri ); 133 129 134 130 if ( false !== $component_uri_key ) { 135 131 if ( !empty( $bp->unfiltered_uri[$component_uri_key + 1] ) ) { … … 146 142 add_action( 'bp_screens', $screen_function, 3 ); 147 143 } 148 144 149 145 $bp->current_action = $subnav_slug; 150 146 unset( $bp->canonical_stack['action'] ); … … 302 298 $redirect_to = trailingslashit( bp_displayed_user_domain() . ( 'xprofile' == $bp->profile->id ? 'profile' : $bp->profile->id ) ); 303 299 } 304 300 305 301 $message = ''; 306 302 } else { … … 308 304 $redirect_to = bp_displayed_user_domain(); 309 305 } 310 306 311 307 // Off-limits to this user. Throw an error and redirect to the displayed user's domain 312 308 bp_core_no_access( array( -
trunk/bp-groups/bp-groups-loader.php
r5989 r5990 172 172 if ( bp_is_groups_component() && !empty( $this->current_group ) ) { 173 173 174 $this->default_extension = apply_filters( 'bp_groups_default_extension', defined( 'BP_GROUPS_DEFAULT_EXTENSION' ) ? BP_GROUPS_DEFAULT_EXTENSION : 'home' ); 175 176 if ( !bp_current_action() ) { 177 $bp->current_action = $this->default_extension; 178 } 179 174 180 // Prepare for a redirect to the canonical URL 175 181 $bp->canonical_stack['base_url'] = bp_get_group_permalink( $this->current_group ); … … 183 189 } 184 190 185 $this->default_extension = apply_filters( 'bp_groups_default_extension', defined( 'BP_GROUPS_DEFAULT_EXTENSION' ) ? BP_GROUPS_DEFAULT_EXTENSION : 'home' ); 186 187 if ( !bp_current_action() ) { 188 $bp->current_action = $this->default_extension; 189 } else if ( bp_is_current_action( $this->default_extension ) && !empty( $bp->action_variables ) ) { 191 // When viewing the default extension, the canonical URL should not have 192 // that extension's slug, unless more has been tacked onto the URL via 193 // action variables 194 if ( bp_is_current_action( $this->default_extension ) && empty( $bp->action_variables ) ) { 190 195 unset( $bp->canonical_stack['action'] ); 191 196 } 197 192 198 } 193 199
Note: See TracChangeset
for help on using the changeset viewer.