Changeset 3160
- Timestamp:
- 08/09/2010 07:49:03 PM (15 years ago)
- Location:
- branches/1.2/bp-core
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.2/bp-core/bp-core-templatetags.php
r3147 r3160 1533 1533 1534 1534 function bp_is_activity_front_page() { 1535 return ( 'page' == get_option('show_on_front') && 'activity' == get_option('page_on_front') && $_SERVER['REQUEST_URI'] == bp_core_get_site_path() ); 1535 global $current_blog; 1536 1537 if ( bp_core_is_main_site() ) 1538 $path = bp_core_get_site_path(); 1539 else 1540 $path = $current_blog->path; 1541 1542 return ( 'page' == get_option('show_on_front') && 'activity' == get_option('page_on_front') && $_SERVER['REQUEST_URI'] == $path ); 1536 1543 } 1537 1544 -
branches/1.2/bp-core/bp-core-wpabstraction.php
r3117 r3160 23 23 24 24 return true; 25 } 26 27 /** 28 * bp_core_is_main_site 29 * 30 * Checks if current blog is root blog of site 31 * 32 * @since 1,2,6 33 * @package BuddyPress 34 * 35 * @param int $blog_id optional blog id to test (default current blog) 36 * @return bool True if not multisite or $blog_id is main site 37 */ 38 function bp_core_is_main_site( $blog_id = '' ) { 39 global $current_site, $current_blog; 40 41 if ( !bp_core_is_multisite() ) 42 return true; 43 44 if ( empty( $blog_id ) ) 45 $blog_id = $current_blog->blog_id; 46 47 return $blog_id == $current_site->blog_id; 25 48 } 26 49
Note: See TracChangeset
for help on using the changeset viewer.