Changeset 8682
- Timestamp:
- 07/23/2014 07:42:14 PM (10 years ago)
- Location:
- trunk/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-activity/bp-activity-screens.php
r8090 r8682 386 386 'post_date' => 0, 387 387 'post_content' => '', 388 'post_type' => ' bp_activity',388 'post_type' => 'page', 389 389 'post_status' => 'publish', 390 390 'is_page' => true, … … 439 439 'post_date' => 0, 440 440 'post_content' => '', 441 'post_type' => ' bp_activity',441 'post_type' => 'page', 442 442 'post_status' => 'publish', 443 443 'is_page' => true, -
trunk/src/bp-blogs/bp-blogs-screens.php
r8090 r8682 150 150 'post_date' => 0, 151 151 'post_content' => '', 152 'post_type' => ' bp_blogs',152 'post_type' => 'page', 153 153 'post_status' => 'publish', 154 154 'is_page' => true, … … 213 213 'post_date' => 0, 214 214 'post_content' => '', 215 'post_type' => ' bp_group',215 'post_type' => 'page', 216 216 'post_status' => 'publish', 217 217 'is_page' => true, -
trunk/src/bp-core/bp-core-template.php
r8677 r8682 2462 2462 2463 2463 /** 2464 * Customizes the post CSS class according to BuddyPress content. 2465 * 2466 * Hooked to the 'post_class' filter. 2467 * 2468 * @since BuddyPress (2.1.0) 2469 * 2470 * @param array $wp_classes The post classes coming from WordPress. 2471 * @return array 2472 */ 2473 function bp_get_the_post_class( $wp_classes = array() ) { 2474 // don't do anything if we're not on a BP page 2475 if ( ! is_buddypress() ) { 2476 return $wp_classes; 2477 } 2478 2479 $bp_classes = array(); 2480 2481 if ( bp_is_user() || bp_is_single_activity() ) { 2482 $bp_classes[] = 'bp_members'; 2483 2484 } elseif ( bp_is_group() ) { 2485 $bp_classes[] = 'bp_group'; 2486 2487 } elseif ( bp_is_activity_component() ) { 2488 $bp_classes[] = 'bp_activity'; 2489 2490 } elseif ( bp_is_blogs_component() ) { 2491 $bp_classes[] = 'bp_blogs'; 2492 2493 } elseif ( bp_is_register_page() ) { 2494 $bp_classes[] = 'bp_register'; 2495 2496 } elseif ( bp_is_activation_page() ) { 2497 $bp_classes[] = 'bp_activate'; 2498 2499 } elseif ( bp_is_forums_component() && bp_is_directory() ) { 2500 $bp_classes[] = 'bp_forum'; 2501 } 2502 2503 if ( empty( $bp_classes ) ) { 2504 return $wp_classes; 2505 } 2506 2507 // emulate post type css class 2508 foreach ( $bp_classes as $bp_class ) { 2509 $bp_classes[] = "type-{$bp_class}"; 2510 } 2511 2512 // removes the 'page' and 'type-page' post classes 2513 // we need to remove these classes since they did not exist before we switched 2514 // theme compat to use the 'page' post type 2515 $page_key = array_search( 'page', $wp_classes ); 2516 $page_type_key = array_search( 'type-page', $wp_classes ); 2517 unset( $wp_classes[$page_key], $wp_classes[$page_type_key] ); 2518 2519 // okay let's merge! 2520 return array_unique( array_merge( $bp_classes, $wp_classes ) ); 2521 } 2522 add_filter( 'post_class', 'bp_get_the_post_class' ); 2523 2524 /** 2464 2525 * Sort BuddyPress nav menu items by their position property. 2465 2526 * -
trunk/src/bp-forums/bp-forums-screens.php
r7736 r8682 217 217 'post_date' => 0, 218 218 'post_content' => '', 219 'post_type' => ' bp_forum',219 'post_type' => 'page', 220 220 'post_status' => 'publish', 221 221 'is_page' => true, -
trunk/src/bp-groups/bp-groups-screens.php
r8678 r8682 1072 1072 'post_date' => 0, 1073 1073 'post_content' => '', 1074 'post_type' => ' bp_group',1074 'post_type' => 'page', 1075 1075 'post_status' => 'publish', 1076 1076 'is_page' => true, … … 1128 1128 'post_date' => 0, 1129 1129 'post_content' => '', 1130 'post_type' => ' bp_group',1130 'post_type' => 'page', 1131 1131 'post_status' => 'publish', 1132 1132 'is_page' => true, … … 1188 1188 'post_date' => 0, 1189 1189 'post_content' => '', 1190 'post_type' => ' bp_group',1190 'post_type' => 'page', 1191 1191 'post_status' => 'publish', 1192 1192 'is_page' => true, -
trunk/src/bp-members/bp-members-screens.php
r8658 r8682 359 359 'post_date' => 0, 360 360 'post_content' => '', 361 'post_type' => ' bp_members',361 'post_type' => 'page', 362 362 'post_status' => 'publish', 363 363 'is_page' => true, … … 421 421 'post_date' => 0, 422 422 'post_content' => '', 423 'post_type' => ' bp_members',423 'post_type' => 'page', 424 424 'post_status' => 'publish', 425 425 'is_page' => true, … … 530 530 } 531 531 532 $post_type = bp_is_register_page() ? 'bp_register' : 'bp_activate';533 534 532 bp_theme_compat_reset_post( array( 535 533 'ID' => 0, … … 538 536 'post_date' => 0, 539 537 'post_content' => '', 540 'post_type' => $post_type,538 'post_type' => 'page', 541 539 'post_status' => 'publish', 542 540 'is_page' => true,
Note: See TracChangeset
for help on using the changeset viewer.