Changeset 3589 for branches/plugin/bbp-includes/bbp-core-compatibility.php
- Timestamp:
- 11/04/2011 08:36:45 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/plugin/bbp-includes/bbp-core-compatibility.php
r3585 r3589 931 931 // Reset post 932 932 bbp_theme_compat_reset_post( array( 933 'post_title' => esc_attr( bbp_get_displayed_user_field( 'display_name' ) ) 933 'post_title' => esc_attr( bbp_get_displayed_user_field( 'display_name' ) ), 934 'comment_status' => 'closed' 934 935 ) ); 935 936 … … 941 942 // Reset post 942 943 bbp_theme_compat_reset_post( array( 943 'ID' => bbp_get_forum_id(),944 'post_title' => bbp_get_forum_title(),944 'ID' => bbp_get_forum_id(), 945 'post_title' => bbp_get_forum_title(), 945 946 //'post_author' => bbp_get_forum_author_id(), 946 'post_date' => 0, 947 'post_content' => get_post_field( 'post_content', bbp_get_forum_id() ), 948 'post_type' => bbp_get_forum_post_type(), 949 'post_status' => bbp_get_forum_status(), 950 'is_single' => true 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 'comment_status' => 'closed' 951 953 ) ); 952 954 … … 956 958 // Reset post 957 959 bbp_theme_compat_reset_post( array( 958 'ID' => 0, 959 'post_title' => bbp_get_forum_archive_title(), 960 'post_author' => 0, 961 'post_date' => 0, 962 'post_content' => '', 963 'post_type' => bbp_get_forum_post_type(), 964 'post_status' => bbp_get_public_status_id(), 965 'is_archive' => true 960 'ID' => 0, 961 'post_title' => bbp_get_forum_archive_title(), 962 'post_author' => 0, 963 'post_date' => 0, 964 'post_content' => '', 965 'post_type' => bbp_get_forum_post_type(), 966 'post_status' => bbp_get_public_status_id(), 967 'is_archive' => true, 968 'comment_status' => 'closed' 966 969 ) ); 967 970 … … 973 976 // Reset post 974 977 bbp_theme_compat_reset_post( array( 975 'ID' => 0, 976 'post_title' => bbp_get_topic_archive_title(), 977 'post_author' => 0, 978 'post_date' => 0, 979 'post_content' => '', 980 'post_type' => bbp_get_topic_post_type(), 981 'post_status' => bbp_get_public_status_id(), 982 'is_archive' => true 978 'ID' => 0, 979 'post_title' => bbp_get_topic_archive_title(), 980 'post_author' => 0, 981 'post_date' => 0, 982 'post_content' => '', 983 'post_type' => bbp_get_topic_post_type(), 984 'post_status' => bbp_get_public_status_id(), 985 'is_archive' => true, 986 'comment_status' => 'closed' 983 987 ) ); 984 988 … … 988 992 // Reset post 989 993 bbp_theme_compat_reset_post( array( 990 'ID' => bbp_get_topic_id(), 991 'post_title' => bbp_get_topic_title(), 992 'post_author' => bbp_get_topic_author_id(), 993 'post_date' => 0, 994 'post_content' => get_post_field( 'post_content', bbp_get_topic_id() ), 995 'post_type' => bbp_get_topic_post_type(), 996 'post_status' => bbp_get_topic_status(), 997 'is_single' => true 994 'ID' => bbp_get_topic_id(), 995 'post_title' => bbp_get_topic_title(), 996 'post_author' => bbp_get_topic_author_id(), 997 'post_date' => 0, 998 'post_content' => get_post_field( 'post_content', bbp_get_topic_id() ), 999 'post_type' => bbp_get_topic_post_type(), 1000 'post_status' => bbp_get_topic_status(), 1001 'is_single' => true, 1002 'comment_status' => 'closed' 998 1003 ) ); 999 1004 … … 1005 1010 // Reset post 1006 1011 bbp_theme_compat_reset_post( array( 1007 'ID' => 0, 1008 'post_title' => __( 'Replies', 'bbpress' ), 1009 'post_author' => 0, 1010 'post_date' => 0, 1011 'post_content' => '', 1012 'post_type' => bbp_get_reply_post_type(), 1013 'post_status' => bbp_get_public_status_id() 1012 'ID' => 0, 1013 'post_title' => __( 'Replies', 'bbpress' ), 1014 'post_author' => 0, 1015 'post_date' => 0, 1016 'post_content' => '', 1017 'post_type' => bbp_get_reply_post_type(), 1018 'post_status' => bbp_get_public_status_id(), 1019 'comment_status' => 'closed' 1014 1020 ) ); 1015 1021 … … 1019 1025 // Reset post 1020 1026 bbp_theme_compat_reset_post( array( 1021 'ID' => bbp_get_reply_id(), 1022 'post_title' => bbp_get_reply_title(), 1023 'post_author' => bbp_get_reply_author_id(), 1024 'post_date' => 0, 1025 'post_content' => get_post_field( 'post_content', bbp_get_reply_id() ), 1026 'post_type' => bbp_get_reply_post_type(), 1027 'post_status' => bbp_get_reply_status() 1027 'ID' => bbp_get_reply_id(), 1028 'post_title' => bbp_get_reply_title(), 1029 'post_author' => bbp_get_reply_author_id(), 1030 'post_date' => 0, 1031 'post_content' => get_post_field( 'post_content', bbp_get_reply_id() ), 1032 'post_type' => bbp_get_reply_post_type(), 1033 'post_status' => bbp_get_reply_status(), 1034 'comment_status' => 'closed' 1028 1035 ) ); 1029 1036 … … 1034 1041 // Reset post 1035 1042 bbp_theme_compat_reset_post( array( 1036 'ID' => 0, 1037 'post_title' => bbp_get_view_title(), 1038 'post_author' => 0, 1039 'post_date' => 0, 1040 'post_content' => '', 1041 'post_type' => '', 1042 'post_status' => bbp_get_public_status_id() 1043 'ID' => 0, 1044 'post_title' => bbp_get_view_title(), 1045 'post_author' => 0, 1046 'post_date' => 0, 1047 'post_content' => '', 1048 'post_type' => '', 1049 'post_status' => bbp_get_public_status_id(), 1050 'comment_status' => 'closed' 1043 1051 ) ); 1044 1052 … … 1556 1564 1557 1565 /** 1566 * Force comments_status to 'closed' for bbPress post types 1567 * 1568 * @since bbPress (r3589) 1569 * 1570 * @param bool $open True if open, false if closed 1571 * @param int $post_id ID of the post to check 1572 * @return bool True if open, false if closed 1573 */ 1574 function bbp_force_comment_status( $open, $post_id = 0 ) { 1575 1576 // Get the post type of the post ID 1577 $post_type = get_post_type( $post_id ); 1578 1579 // Default return value is what is passed in $open 1580 $retval = $open; 1581 1582 // Only force for bbPress post types 1583 switch ( $post_type ) { 1584 case bbp_get_forum_post_type() : 1585 case bbp_get_topic_post_type() : 1586 case bbp_get_reply_post_type() : 1587 $retval = false; 1588 break; 1589 } 1590 1591 // Allow override of the override 1592 return apply_filters( 'bbp_force_comment_status', $retval, $open, $post_id, $post_type ); 1593 } 1594 1595 /** 1558 1596 * Add checks for view page, user page, user edit, topic edit and reply edit 1559 1597 * pages.
Note: See TracChangeset
for help on using the changeset viewer.