Changeset 5080
- Timestamp:
- 08/19/2013 07:47:49 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/includes/core/theme-compat.php
r5043 r5080 475 475 // Page exists where this archive should be 476 476 $page = bbp_get_page_by_path( bbp_get_root_slug() ); 477 if ( !empty( $page ) ) { 477 478 // Should we replace the content... 479 if ( empty( $page->post_content ) ) { 480 481 // Use the topics archive 482 if ( 'topics' === bbp_show_on_root() ) { 483 $new_content = $bbp_shortcodes->display_topic_index(); 484 485 // No page so show the archive 486 } else { 487 $new_content = $bbp_shortcodes->display_forum_index(); 488 } 489 490 // ...or use the existing page content? 491 } else { 478 492 $new_content = apply_filters( 'the_content', $page->post_content ); 479 $new_title = apply_filters( 'the_title', $page->post_title ); 480 481 // Use the topics archive 482 } elseif ( 'topics' === bbp_show_on_root() ) { 483 $new_content = $bbp_shortcodes->display_topic_index(); 484 $new_title = bbp_get_topic_archive_title(); 485 486 // No page so show the archive 493 } 494 495 // Should we replace the title... 496 if ( empty( $page->post_title ) ) { 497 498 // Use the topics archive 499 if ( 'topics' === bbp_show_on_root() ) { 500 $new_title = bbp_get_topic_archive_title(); 501 502 // No page so show the archive 503 } else { 504 $new_title = bbp_get_forum_archive_title(); 505 } 506 507 // ...or use the existing page title? 487 508 } else { 488 $new_content = $bbp_shortcodes->display_forum_index(); 489 $new_title = bbp_get_forum_archive_title(); 509 $new_title = apply_filters( 'the_title', $page->post_title ); 490 510 } 491 511 492 512 // Reset post 493 513 bbp_theme_compat_reset_post( array( 494 'ID' => 0,514 'ID' => !empty( $page->ID ) ? $page->ID : 0, 495 515 'post_title' => $new_title, 496 516 'post_author' => 0, … … 541 561 // Page exists where this archive should be 542 562 $page = bbp_get_page_by_path( bbp_get_topic_archive_slug() ); 543 if ( !empty( $page ) ) { 563 564 // Should we replace the content... 565 if ( empty( $page->post_content ) ) { 566 $new_content = $bbp_shortcodes->display_topic_index(); 567 568 // ...or use the existing page content? 569 } else { 544 570 $new_content = apply_filters( 'the_content', $page->post_content ); 545 546 // No page so show the archive 571 } 572 573 // Should we replace the title... 574 if ( empty( $page->post_title ) ) { 575 $new_title = bbp_get_topic_archive_title(); 576 577 // ...or use the existing page title? 547 578 } else { 548 $new_ content = $bbp_shortcodes->display_topic_index();579 $new_title = apply_filters( 'the_title', $page->post_title ); 549 580 } 550 581 551 582 // Reset post 552 583 bbp_theme_compat_reset_post( array( 553 'ID' => 0,584 'ID' => !empty( $page->ID ) ? $page->ID : 0, 554 585 'post_title' => bbp_get_topic_archive_title(), 555 586 'post_author' => 0,
Note: See TracChangeset
for help on using the changeset viewer.