Changeset 6607 for trunk/src/includes/forums/functions.php
- Timestamp:
- 07/02/2017 04:39:49 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/forums/functions.php
r6585 r6607 963 963 // Query for private forums 964 964 $private_forums = new WP_Query( array( 965 'fields' => 'ids', 966 'suppress_filters' => true, 967 'post_type' => bbp_get_forum_post_type(), 968 'post_status' => bbp_get_private_status_id(), 969 'posts_per_page' => -1, 965 'fields' => 'ids', 966 'post_type' => bbp_get_forum_post_type(), 967 'post_status' => bbp_get_private_status_id(), 968 'posts_per_page' => -1, 970 969 971 970 // Performance 971 'nopaging' => true, 972 'suppress_filters' => true, 973 'update_post_term_cache' => false, 974 'update_post_meta_cache' => false, 972 975 'ignore_sticky_posts' => true, 973 'no_found_rows' => true, 974 'nopaging' => true, 975 'update_post_term_cache' => false, 976 'update_post_meta_cache' => false 976 'no_found_rows' => true 977 977 ) ); 978 978 … … 986 986 987 987 // Performance 988 'nopaging' => true, 989 'suppress_filters' => true, 990 'update_post_term_cache' => false, 991 'update_post_meta_cache' => false, 988 992 'ignore_sticky_posts' => true, 989 'no_found_rows' => true, 990 'nopaging' => true, 991 'update_post_term_cache' => false, 992 'update_post_meta_cache' => false 993 'no_found_rows' => true 993 994 ) ); 994 995 … … 1603 1604 * i.e. the forum is automatically retrieved. 1604 1605 * @param bool $total_count Optional. To return the total count or normal count? 1605 1606 1606 * @return int Forum topic count 1607 1607 */ … … 1662 1662 if ( empty( $topic_count ) ) { 1663 1663 $query = new WP_Query( array( 1664 'fields' => 'ids', 1665 'suppress_filters' => true, 1666 'post_parent' => $forum_id, 1667 'post_status' => array( bbp_get_trash_status_id(), bbp_get_spam_status_id(), bbp_get_pending_status_id() ), 1668 'post_type' => bbp_get_topic_post_type(), 1669 'posts_per_page' => -1, 1664 'fields' => 'ids', 1665 'post_parent' => $forum_id, 1666 'post_status' => array( bbp_get_trash_status_id(), bbp_get_spam_status_id(), bbp_get_pending_status_id() ), 1667 'post_type' => bbp_get_topic_post_type(), 1668 'posts_per_page' => -1, 1670 1669 1671 1670 // Performance 1671 'nopaging' => true, 1672 'suppress_filters' => true, 1672 1673 'update_post_term_cache' => false, 1673 1674 'update_post_meta_cache' => false, 1674 1675 'ignore_sticky_posts' => true, 1675 'no_found_rows' => true, 1676 'nopaging' => true 1676 'no_found_rows' => true 1677 1677 ) ); 1678 1678 $topic_count = $query->post_count; … … 1720 1720 if ( ! empty( $topic_ids ) ) { 1721 1721 $query = new WP_Query( array( 1722 'fields' => 'ids', 1723 'suppress_filters' => true, 1724 'post_parent__in' => $topic_ids, 1725 'post_status' => bbp_get_public_status_id(), 1726 'post_type' => bbp_get_reply_post_type(), 1727 'posts_per_page' => -1, 1722 'fields' => 'ids', 1723 'post_parent__in' => $topic_ids, 1724 'post_status' => bbp_get_public_status_id(), 1725 'post_type' => bbp_get_reply_post_type(), 1726 'posts_per_page' => -1, 1728 1727 1729 1728 // Performance 1729 'nopaging' => true, 1730 'suppress_filters' => true, 1730 1731 'update_post_term_cache' => false, 1731 1732 'update_post_meta_cache' => false, 1732 1733 'ignore_sticky_posts' => true, 1733 'no_found_rows' => true, 1734 'nopaging' => true 1734 'no_found_rows' => true 1735 1735 ) ); 1736 1736 $reply_count = ! empty( $query->posts ) ? count( $query->posts ) : 0; … … 2137 2137 'update_post_meta_cache' => false, 2138 2138 'ignore_sticky_posts' => true, 2139 'no_found_rows' => true, 2140 'nopaging' => true 2139 'no_found_rows' => true 2141 2140 ) ); 2142 2141 $reply_id = array_shift( $query->posts ); … … 2273 2272 // Note that we get all post statuses here 2274 2273 $topics = new WP_Query( array( 2275 'fields' => 'id=>parent', 2276 'suppress_filters' => true, 2277 2278 // What and how 2279 'post_type' => bbp_get_topic_post_type(), 2280 'post_parent' => $forum_id, 2281 'post_status' => array_keys( get_post_stati() ), 2282 'posts_per_page' => -1, 2274 'fields' => 'id=>parent', 2275 'post_type' => bbp_get_topic_post_type(), 2276 'post_parent' => $forum_id, 2277 'post_status' => array_keys( get_post_stati() ), 2278 'posts_per_page' => -1, 2283 2279 2284 2280 // Performance 2281 'nopaging' => true, 2282 'suppress_filters' => true, 2283 'update_post_term_cache' => false, 2284 'update_post_meta_cache' => false, 2285 2285 'ignore_sticky_posts' => true, 2286 'no_found_rows' => true, 2287 'nopaging' => true, 2288 'update_post_term_cache' => false, 2289 'update_post_meta_cache' => false 2286 'no_found_rows' => true 2290 2287 ) ); 2291 2288 … … 2330 2327 // Forum is being trashed, so its topics (and replies) are trashed too 2331 2328 $topics = new WP_Query( array( 2332 'fields' => 'id=>parent', 2333 'suppress_filters' => true, 2334 'post_type' => bbp_get_topic_post_type(), 2335 'post_parent' => $forum_id, 2336 'post_status' => $post_stati, 2337 'posts_per_page' => -1, 2329 'fields' => 'id=>parent', 2330 'post_type' => bbp_get_topic_post_type(), 2331 'post_parent' => $forum_id, 2332 'post_status' => $post_stati, 2333 'posts_per_page' => -1, 2338 2334 2339 2335 // Performance 2336 'nopaging' => true, 2337 'suppress_filters' => true, 2338 'update_post_term_cache' => false, 2339 'update_post_meta_cache' => false, 2340 2340 'ignore_sticky_posts' => true, 2341 'no_found_rows' => true, 2342 'nopaging' => true, 2343 'update_post_term_cache' => false, 2344 'update_post_meta_cache' => false 2341 'no_found_rows' => true 2345 2342 ) ); 2346 2343
Note: See TracChangeset
for help on using the changeset viewer.