Changeset 5316 for trunk/bp-core/bp-core-catchuri.php
- Timestamp:
- 11/09/2011 05:43:09 AM (15 years ago)
- File:
-
- 1 edited
-
trunk/bp-core/bp-core-catchuri.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/bp-core-catchuri.php
r5314 r5316 30 30 */ 31 31 function bp_core_set_uri_globals() { 32 global $bp, $bp_unfiltered_uri, $bp_unfiltered_uri_offset; 33 global $current_blog, $wpdb; 34 35 // Create global component, action, and item variables 36 $bp->current_component = $bp->current_item = ''; 37 $bp->current_action = $bp->action_variables = ''; 32 global $bp, $current_blog, $wpdb; 38 33 39 34 // Don't catch URIs on non-root blogs unless multiblog mode is on … … 121 116 122 117 // Keep the unfiltered URI safe 123 $bp _unfiltered_uri = $bp_uri;118 $bp->unfiltered_uri = $bp_uri; 124 119 125 120 // Get slugs of pages into array … … 223 218 // Global the unfiltered offset to use in bp_core_load_template(). 224 219 // To avoid PHP warnings in bp_core_load_template(), it must always be >= 0 225 $bp _unfiltered_uri_offset = $uri_offset >= 0 ? $uri_offset : 0;220 $bp->unfiltered_uri_offset = $uri_offset >= 0 ? $uri_offset : 0; 226 221 227 222 // We have an exact match … … 315 310 */ 316 311 function bp_core_load_template( $templates ) { 317 global $post, $bp, $wpdb, $wp_query , $bp_unfiltered_uri, $bp_unfiltered_uri_offset;312 global $post, $bp, $wpdb, $wp_query; 318 313 319 314 // Determine if the root object WP page exists for this request (TODO: is there an API function for this? 320 if ( !empty( $bp _unfiltered_uri_offset ) && !$page_exists = $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM {$wpdb->posts} WHERE post_name = %s", $bp_unfiltered_uri[$bp_unfiltered_uri_offset] ) ) )315 if ( !empty( $bp->unfiltered_uri_offset ) && !$page_exists = $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM {$wpdb->posts} WHERE post_name = %s", $bp->unfiltered_uri[$bp->unfiltered_uri_offset] ) ) ) 321 316 return false; 322 317 … … 324 319 $object_id = 0; 325 320 foreach ( (array)$bp->pages as $page ) { 326 if ( isset( $bp _unfiltered_uri[$bp_unfiltered_uri_offset] ) && $page->name == $bp_unfiltered_uri[$bp_unfiltered_uri_offset]) {321 if ( isset( $bp->unfiltered_uri[$bp->unfiltered_uri_offset] ) && ( $page->name == $bp->unfiltered_uri[$bp->unfiltered_uri_offset] ) ) { 327 322 $object_id = $page->id; 328 323 }
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)