Changeset 8182
- Timestamp:
- 03/27/2014 10:52:19 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/bp-core-functions.php
r8181 r8182 576 576 */ 577 577 function bp_core_create_root_component_page() { 578 global $bp; 578 579 // Get BuddyPress 580 $bp = buddypress(); 579 581 580 582 $new_page_ids = array(); 581 583 582 foreach ( (array) $bp->add_root as $slug ) 583 $new_page_ids[$slug] = wp_insert_post( array( 'comment_status' => 'closed', 'ping_status' => 'closed', 'post_title' => ucwords( $slug ), 'post_status' => 'publish', 'post_type' => 'page' ) ); 584 foreach ( (array) $bp->add_root as $slug ) { 585 $new_page_ids[ $slug ] = wp_insert_post( array( 586 'comment_status' => 'closed', 587 'ping_status' => 'closed', 588 'post_title' => ucwords( $slug ), 589 'post_status' => 'publish', 590 'post_type' => 'page' 591 ) ); 592 } 584 593 585 594 $page_ids = array_merge( (array) $new_page_ids, (array) bp_core_get_directory_page_ids() ); … … 1161 1170 * 1162 1171 * @since BuddyPress (1.5.0) 1163 *1164 * @global BuddyPress $bp BuddyPress global settings.1165 1172 */ 1166 1173 function bp_embed_init() { 1167 global $bp; 1168 1169 if ( empty( $bp->embed ) ) 1174 1175 // Get BuddyPress 1176 $bp = buddypress(); 1177 1178 if ( empty( $bp->embed ) ) { 1170 1179 $bp->embed = new BP_Embed(); 1180 } 1171 1181 } 1172 1182 add_action( 'bp_init', 'bp_embed_init', 9 ); … … 1347 1357 */ 1348 1358 function bp_get_root_blog_id() { 1349 global $bp; 1350 1351 return (int) apply_filters( 'bp_get_root_blog_id', (int) $bp->root_blog_id ); 1359 return (int) apply_filters( 'bp_get_root_blog_id', (int) buddypress()->root_blog_id ); 1352 1360 } 1353 1361 … … 1433 1441 1434 1442 /** 1435 * Set the $bp->is_directory global. 1436 * 1437 * @global BuddyPress $bp The one true BuddyPress instance. 1443 * Set the "is_directory" global. 1438 1444 * 1439 1445 * @param bool $is_directory Optional. Default: false. … … 1442 1448 */ 1443 1449 function bp_update_is_directory( $is_directory = false, $component = '' ) { 1444 global $bp; 1445 1446 if ( empty( $component ) ) 1450 1451 if ( empty( $component ) ) { 1447 1452 $component = bp_current_component(); 1448 1449 $bp->is_directory = apply_filters( 'bp_update_is_directory', $is_directory, $component ); 1450 } 1451 1452 /** 1453 * Set the $bp->is_item_admin global. 1454 * 1455 * @global BuddyPress $bp The one true BuddyPress instance. 1453 } 1454 1455 buddypress()->is_directory = apply_filters( 'bp_update_is_directory', $is_directory, $component ); 1456 } 1457 1458 /** 1459 * Set the "is_item_admin" global. 1456 1460 * 1457 1461 * @param bool $is_item_admin Optional. Default: false. 1458 * @param string $component .Optional. Component name. Default: the current1462 * @param string $component Optional. Component name. Default: the current 1459 1463 * component. 1460 1464 */ 1461 1465 function bp_update_is_item_admin( $is_item_admin = false, $component = '' ) { 1462 global $bp; 1463 1464 if ( empty( $component ) ) 1466 1467 if ( empty( $component ) ) { 1465 1468 $component = bp_current_component(); 1466 1467 $bp->is_item_admin = apply_filters( 'bp_update_is_item_admin', $is_item_admin, $component ); 1468 } 1469 1470 /** 1471 * Set the $bp->is_item_mod global. 1472 * 1473 * @global BuddyPress $bp The one true BuddyPress instance. 1469 } 1470 1471 buddypress()->is_item_admin = apply_filters( 'bp_update_is_item_admin', $is_item_admin, $component ); 1472 } 1473 1474 /** 1475 * Set the "is_item_mod" global. 1474 1476 * 1475 1477 * @param bool $is_item_mod Optional. Default: false. 1476 * @param string $component .Optional. Component name. Default: the current1478 * @param string $component Optional. Component name. Default: the current 1477 1479 * component. 1478 1480 */ 1479 1481 function bp_update_is_item_mod( $is_item_mod = false, $component = '' ) { 1480 global $bp; 1481 1482 if ( empty( $component ) ) 1482 1483 if ( empty( $component ) ) { 1483 1484 $component = bp_current_component(); 1484 1485 $bp->is_item_mod = apply_filters( 'bp_update_is_item_mod', $is_item_mod, $component ); 1485 } 1486 1487 buddypress()->is_item_mod = apply_filters( 'bp_update_is_item_mod', $is_item_mod, $component ); 1486 1488 } 1487 1489 … … 1505 1507 nocache_headers(); 1506 1508 1507 if ( 'remove_canonical_direct' == $redirect )1509 if ( 'remove_canonical_direct' === $redirect ) { 1508 1510 remove_action( 'template_redirect', 'redirect_canonical' ); 1511 } 1509 1512 } 1510 1513
Note: See TracChangeset
for help on using the changeset viewer.