Changeset 3566 for branches/plugin/bbp-includes/bbp-core-compatibility.php
- Timestamp:
- 10/31/2011 12:38:06 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/plugin/bbp-includes/bbp-core-compatibility.php
r3550 r3566 516 516 517 517 /** 518 * Get the forum edit template 519 * 520 * @since bbPress (r3566) 521 * 522 * @uses bbp_get_topic_post_type() 523 * @uses apply_filters() 524 * 525 * @return array 526 */ 527 function bbp_get_forum_edit_template() { 528 529 $post_type = bbp_get_forum_post_type(); 530 $templates = array( 531 532 // Single Topic Edit 533 'single-' . $post_type . '-edit.php', 534 'bbpress/single-' . $post_type . '-edit.php', 535 'forums/single-' . $post_type . '-edit.php', 536 537 // Single Action Edit Topic 538 'single-action-edit-' . $post_type . '.php', 539 'bbpress/single-action-edit-' . $post_type . '.php', 540 'forums/single-action-edit-' . $post_type . '.php', 541 542 // Single Action Edit 543 'single-action-edit.php', 544 'bbpress/single-action-edit.php', 545 'forums/single-action-edit.php', 546 547 // Action Edit 548 'action-edit.php', 549 'bbpress/action-edit.php', 550 'forums/action-edit.php', 551 552 // Single Topic 553 'single-' . $post_type . '.php', 554 'forums/single-' . $post_type . '.php', 555 'bbpress/single-' . $post_type . '.php', 556 ); 557 558 $templates = apply_filters( 'bbp_get_forum_edit_template', $templates ); 559 $templates = bbp_set_theme_compat_templates( $templates ); 560 561 $template = locate_template( $templates, false, false ); 562 $template = bbp_set_theme_compat_template( $template ); 563 564 return $template; 565 } 566 567 /** 518 568 * Get the topic edit template 519 569 * … … 809 859 * @uses bbp_is_single_view() To check if page is single view 810 860 * @uses bbp_get_single_view_template() To get view template 861 * @uses bbp_is_forum_edit() To check if page is forum edit 862 * @uses bbp_get_forum_edit_template() To get forum edit template 811 863 * @uses bbp_is_topic_merge() To check if page is topic merge 812 864 * @uses bbp_get_topic_merge_template() To get topic merge template … … 835 887 elseif ( bbp_is_single_view() && ( $new_template = bbp_get_single_view_template() ) ) : 836 888 889 // Topic edit 890 elseif ( bbp_is_forum_edit() && ( $new_template = bbp_get_forum_edit_template() ) ) : 891 837 892 // Topic merge 838 893 elseif ( bbp_is_topic_merge() && ( $new_template = bbp_get_topic_merge_template() ) ) : … … 881 936 882 937 /** Forums ************************************************************/ 938 939 // Single forum edit 940 } elseif ( bbp_is_forum_edit() ) { 941 942 // Reset post 943 bbp_theme_compat_reset_post( array( 944 'ID' => bbp_get_forum_id(), 945 'post_title' => bbp_get_forum_title(), 946 //'post_author' => bbp_get_forum_author_id(), 947 'post_date' => 0, 948 'post_content' => get_post_field( 'post_content', bbp_get_forum_id() ), 949 'post_type' => bbp_get_forum_post_type(), 950 'post_status' => bbp_get_forum_status(), 951 'is_single' => true 952 ) ); 883 953 884 954 // Forum archive … … 1091 1161 1092 1162 /** Forums ************************************************************/ 1163 1164 // Reply Edit 1165 } elseif ( bbp_is_forum_edit() ) { 1166 $new_content = $bbp->shortcodes->display_forum_form(); 1093 1167 1094 1168 // Forum archive … … 1635 1709 } elseif ( !empty( $is_edit ) ) { 1636 1710 1637 // We are editing a forum 1638 if ( $posts_query->get( 'post_type' ) == bbp_get_forum_post_type() ) { 1639 $posts_query->bbp_is_forum_edit = true; 1640 1641 // We are editing a topic 1642 } elseif ( $posts_query->get( 'post_type' ) == bbp_get_topic_post_type() ) { 1643 $posts_query->bbp_is_topic_edit = true; 1644 1645 // We are editing a reply 1646 } elseif ( $posts_query->get( 'post_type' ) == bbp_get_reply_post_type() ) { 1647 $posts_query->bbp_is_reply_edit = true; 1711 // Get the post type from the main query loop 1712 $post_type = $posts_query->get( 'post_type' ); 1713 1714 // Check which post_type we are editing, if any 1715 if ( !empty( $post_type ) ) { 1716 switch( $post_type ) { 1717 1718 // We are editing a forum 1719 case bbp_get_forum_post_type() : 1720 $posts_query->bbp_is_forum_edit = true; 1721 break; 1722 1723 // We are editing a topic 1724 case bbp_get_topic_post_type() : 1725 $posts_query->bbp_is_topic_edit = true; 1726 break; 1727 1728 // We are editing a reply 1729 case bbp_get_reply_post_type() : 1730 $posts_query->bbp_is_reply_edit = true; 1731 break; 1732 } 1648 1733 1649 1734 // We are editing a topic tag
Note: See TracChangeset
for help on using the changeset viewer.