Changeset 4091 for trunk/bp-core/bp-core-catchuri.php
- Timestamp:
- 03/10/2011 06:09:46 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/bp-core-catchuri.php
r3947 r4091 117 117 $bp_unfiltered_uri = $bp_uri; 118 118 119 // Find a match within registered BuddyPress controlled WP pages (check members first) 120 foreach ( (array)$bp->pages as $page_key => $bp_page ) { 121 if ( in_array( $bp_page->name, (array)$bp_uri ) ) { 119 // Loop through each page in the global 120 foreach ( (array) $bp->pages as $page_key => $bp_page ) { 121 122 // Look for a match (check members first) 123 if ( in_array( $bp_page->name, (array) $bp_uri ) ) { 124 122 125 // Match found, now match the slug to make sure. 123 126 $uri_chunks = explode( '/', $bp_page->slug ); 124 127 125 foreach ( (array)$uri_chunks as $key => $uri_chunk ) { 126 if ( $bp_uri[$key] == $uri_chunk ) { 128 // Loop through uri_chunks 129 foreach ( (array) $uri_chunks as $key => $uri_chunk ) { 130 131 // Make sure chunk is in the correct position 132 if ( !empty( $bp_uri[$key] ) && ( $bp_uri[$key] == $uri_chunk ) ) { 127 133 $matches[] = 1; 134 135 // No match 128 136 } else { 129 137 $matches[] = 0; … … 131 139 } 132 140 141 // Have a match 133 142 if ( !in_array( 0, (array) $matches ) ) { 134 143 $match = $bp_page; … … 137 146 }; 138 147 148 // Unset matches 139 149 unset( $matches ); 140 150 } 141 151 152 // Unset uri chunks 142 153 unset( $uri_chunks ); 143 154 }
Note: See TracChangeset
for help on using the changeset viewer.