Ticket #5418: 5418.03.patch
File 5418.03.patch, 6.1 KB (added by , 11 years ago) |
---|
-
src/bp-activity/bp-activity-screens.php
385 385 'post_author' => 0, 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, 391 391 'comment_status' => 'closed' … … 438 438 'post_author' => 0, 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, 444 444 'comment_status' => 'closed' -
src/bp-blogs/bp-blogs-screens.php
149 149 'post_author' => 0, 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, 155 155 'comment_status' => 'closed' … … 212 212 'post_author' => 0, 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, 218 218 'comment_status' => 'closed' -
src/bp-core/bp-core-template.php
2458 2458 add_filter( 'body_class', 'bp_get_the_body_class', 10, 2 ); 2459 2459 2460 2460 /** 2461 * Customizes the post CSS class according to BuddyPress content. 2462 * 2463 * Hooked to the 'post_class' filter. 2464 * 2465 * @since BuddyPress (2.1.0) 2466 * 2467 * @param array $wp_classes The post classes coming from WordPress. 2468 * @return array 2469 */ 2470 function bp_get_the_post_class( $wp_classes = array() ) { 2471 // don't do anything if we're not on a BP page 2472 if ( ! is_buddypress() ) { 2473 return $wp_classes; 2474 } 2475 2476 $bp_classes = array(); 2477 2478 if ( bp_is_user() || bp_is_single_activity() ) { 2479 $bp_classes[] = 'bp_members'; 2480 2481 } elseif ( bp_is_group() ) { 2482 $bp_classes[] = 'bp_group'; 2483 2484 } elseif ( bp_is_activity_component() ) { 2485 $bp_classes[] = 'bp_activity'; 2486 2487 } elseif ( bp_is_blogs_component() ) { 2488 $bp_classes[] = 'bp_blogs'; 2489 2490 } elseif ( bp_is_register_page() ) { 2491 $bp_classes[] = 'bp_register'; 2492 2493 } elseif ( bp_is_activation_page() ) { 2494 $bp_classes[] = 'bp_activate'; 2495 2496 } elseif ( bp_is_forums_component() && bp_is_directory() ) { 2497 $bp_classes[] = 'bp_forum'; 2498 } 2499 2500 if ( empty( $bp_classes ) ) { 2501 return $wp_classes; 2502 } 2503 2504 // emulate post type css class 2505 foreach ( $bp_classes as $bp_class ) { 2506 $bp_classes[] = "type-{$bp_class}"; 2507 } 2508 2509 // removes the 'page' and 'type-page' post classes 2510 // we need to remove these classes since they did not exist before we switched 2511 // theme compat to use the 'page' post type 2512 $page_key = array_search( 'page', $wp_classes ); 2513 $page_type_key = array_search( 'type-page', $wp_classes ); 2514 unset( $wp_classes[$page_key], $wp_classes[$page_type_key] ); 2515 2516 // okay let's merge! 2517 return array_unique( array_merge( $bp_classes, $wp_classes ) ); 2518 } 2519 add_filter( 'post_class', 'bp_get_the_post_class' ); 2520 2521 /** 2461 2522 * Sort BuddyPress nav menu items by their position property. 2462 2523 * 2463 2524 * This is an internal convenience function and it will probably be removed in -
src/bp-forums/bp-forums-screens.php
216 216 'post_author' => 0, 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, 222 222 'comment_status' => 'closed' -
src/bp-groups/bp-groups-screens.php
1071 1071 'post_author' => 0, 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, 1077 1077 'comment_status' => 'closed' … … 1127 1127 'post_author' => 0, 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, 1133 1133 'comment_status' => 'closed' … … 1187 1187 'post_author' => 0, 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, 1193 1193 'comment_status' => 'closed' -
src/bp-members/bp-members-screens.php
358 358 'post_author' => 0, 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, 364 364 'comment_status' => 'closed' … … 420 420 'post_author' => 0, 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, 426 426 'comment_status' => 'closed' … … 529 529 } 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, 536 534 'post_title' => $title, 537 535 'post_author' => 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, 543 541 'comment_status' => 'closed'