diff --git src/includes/common/functions.php src/includes/common/functions.php
index e1c0ba90..9bcf1c26 100644
|
|
function bbp_get_public_child_count( $parent_id = 0, $post_type = 'post' ) { |
1527 | 1527 | |
1528 | 1528 | // Maybe change these later |
1529 | 1529 | 'posts_per_page' => -1, |
| 1530 | 'nopaging' => true, |
1530 | 1531 | 'update_post_term_cache' => false, |
1531 | 1532 | 'update_post_meta_cache' => false, |
1532 | 1533 | 'ignore_sticky_posts' => true, |
diff --git src/includes/common/widgets.php src/includes/common/widgets.php
index 186a2ac2..b29cf6d3 100644
|
|
class BBP_Forums_Widget extends WP_Widget { |
523 | 523 | // Performance |
524 | 524 | 'ignore_sticky_posts' => true, |
525 | 525 | 'no_found_rows' => true, |
526 | | 'nopaging' => true, |
527 | 526 | 'update_post_term_cache' => false, |
528 | 527 | 'update_post_meta_cache' => false |
529 | 528 | ) ); |
… |
… |
class BBP_Topics_Widget extends WP_Widget { |
703 | 702 | // Performance |
704 | 703 | 'ignore_sticky_posts' => true, |
705 | 704 | 'no_found_rows' => true, |
706 | | 'nopaging' => true, |
707 | 705 | 'update_post_term_cache' => false, |
708 | 706 | 'update_post_meta_cache' => false |
709 | 707 | ); |
… |
… |
class BBP_Topics_Widget extends WP_Widget { |
730 | 728 | // Performance |
731 | 729 | 'ignore_sticky_posts' => true, |
732 | 730 | 'no_found_rows' => true, |
733 | | 'nopaging' => true, |
734 | 731 | 'update_post_term_cache' => false, |
735 | 732 | 'update_post_meta_cache' => false |
736 | 733 | ); |
… |
… |
class BBP_Topics_Widget extends WP_Widget { |
754 | 751 | // Performance |
755 | 752 | 'ignore_sticky_posts' => true, |
756 | 753 | 'no_found_rows' => true, |
757 | | 'nopaging' => true, |
758 | 754 | 'update_post_term_cache' => false, |
759 | 755 | 'update_post_meta_cache' => false |
760 | 756 | ); |
… |
… |
class BBP_Replies_Widget extends WP_Widget { |
1089 | 1085 | // Performance |
1090 | 1086 | 'ignore_sticky_posts' => true, |
1091 | 1087 | 'no_found_rows' => true, |
1092 | | 'nopaging' => true, |
1093 | 1088 | 'update_post_term_cache' => false, |
1094 | 1089 | 'update_post_meta_cache' => false |
1095 | 1090 | ) ); |
diff --git src/includes/forums/capabilities.php src/includes/forums/capabilities.php
index a0130d54..b03c0451 100644
|
|
function bbp_map_forum_meta_caps( $caps = array(), $cap = '', $user_id = 0, $arg |
229 | 229 | function bbp_get_moderator_forum_ids( $user_id = 0 ) { |
230 | 230 | $user_id = bbp_get_user_id( $user_id ); |
231 | 231 | $forums = new WP_Query( array( |
232 | | 'fields' => 'ids', |
233 | | 'post_type' => bbp_get_forum_post_type(), |
234 | | 'nopaging' => true, |
235 | | 'no_found_rows' => true, |
236 | | 'meta_query' => array( array( |
| 232 | 'fields' => 'ids', |
| 233 | 'post_type' => bbp_get_forum_post_type(), |
| 234 | 'posts_per_page' => -1, |
| 235 | 'nopaging' => true, |
| 236 | 'no_found_rows' => true, |
| 237 | 'meta_query' => array( array( |
237 | 238 | 'key' => '_bbp_moderator_id', |
238 | 239 | 'value' => $user_id, |
239 | 240 | 'compare' => 'NUMERIC' |
diff --git src/includes/forums/functions.php src/includes/forums/functions.php
index ae74ffff..2929c0e1 100644
|
|
function bbp_update_forum_subforum_count( $forum_id = 0, $subforums = 0 ) { |
1602 | 1602 | * is a topic or a forum. If it's a topic, its parent, |
1603 | 1603 | * i.e. the forum is automatically retrieved. |
1604 | 1604 | * @param bool $total_count Optional. To return the total count or normal count? |
1605 | | |
| 1605 | |
1606 | 1606 | * @return int Forum topic count |
1607 | 1607 | */ |
1608 | 1608 | function bbp_update_forum_topic_count( $forum_id = 0 ) { |
… |
… |
function bbp_forum_query_last_reply_id( $forum_id = 0, $topic_ids = 0 ) { |
2137 | 2137 | 'update_post_meta_cache' => false, |
2138 | 2138 | 'ignore_sticky_posts' => true, |
2139 | 2139 | 'no_found_rows' => true, |
2140 | | 'nopaging' => true |
2141 | 2140 | ) ); |
2142 | 2141 | $reply_id = array_shift( $query->posts ); |
2143 | 2142 | unset( $query ); |
diff --git src/includes/users/engagements.php src/includes/users/engagements.php
index df9f82e9..2f06ace7 100644
|
|
function bbp_get_user_engagements( $user_id = 0 ) { |
241 | 241 | function bbp_get_user_engaged_topic_ids( $user_id = 0 ) { |
242 | 242 | $user_id = bbp_get_user_id( $user_id ); |
243 | 243 | $engagements = new WP_Query( array( |
244 | | 'fields' => 'ids', |
245 | | 'post_type' => bbp_get_topic_post_type(), |
246 | | 'nopaging' => true, |
247 | | 'no_found_rows' => true, |
248 | | 'meta_query' => array( array( |
| 244 | 'fields' => 'ids', |
| 245 | 'post_type' => bbp_get_topic_post_type(), |
| 246 | 'posts_per_page' => -1, |
| 247 | 'nopaging' => true, |
| 248 | 'no_found_rows' => true, |
| 249 | 'meta_query' => array( array( |
249 | 250 | 'key' => '_bbp_engagement', |
250 | 251 | 'value' => $user_id, |
251 | 252 | 'compare' => 'NUMERIC' |
… |
… |
function bbp_subscriptions_handler( $action = '' ) { |
938 | 939 | function bbp_get_user_favorites_topic_ids( $user_id = 0 ) { |
939 | 940 | $user_id = bbp_get_user_id( $user_id ); |
940 | 941 | $favorites = new WP_Query( array( |
941 | | 'fields' => 'ids', |
942 | | 'post_type' => bbp_get_topic_post_type(), |
943 | | 'nopaging' => true, |
944 | | 'no_found_rows' => true, |
945 | | 'meta_query' => array( array( |
| 942 | 'fields' => 'ids', |
| 943 | 'post_type' => bbp_get_topic_post_type(), |
| 944 | 'posts_per_page' => -1, |
| 945 | 'nopaging' => true, |
| 946 | 'no_found_rows' => array( array( |
946 | 947 | 'key' => '_bbp_favorite', |
947 | 948 | 'value' => $user_id, |
948 | 949 | 'compare' => 'NUMERIC' |
… |
… |
function bbp_get_user_favorites_topic_ids( $user_id = 0 ) { |
966 | 967 | function bbp_get_user_subscribed_forum_ids( $user_id = 0 ) { |
967 | 968 | $user_id = bbp_get_user_id( $user_id ); |
968 | 969 | $subscriptions = new WP_Query( array( |
969 | | 'fields' => 'ids', |
970 | | 'post_type' => bbp_get_forum_post_type(), |
971 | | 'nopaging' => true, |
972 | | 'no_found_rows' => true, |
973 | | 'meta_query' => array( array( |
| 970 | 'fields' => 'ids', |
| 971 | 'post_type' => bbp_get_forum_post_type(), |
| 972 | 'posts_per_page' => -1, |
| 973 | 'nopaging' => true, |
| 974 | 'no_found_rows' => true, |
| 975 | 'meta_query' => array( array( |
974 | 976 | 'key' => '_bbp_subscription', |
975 | 977 | 'value' => $user_id, |
976 | 978 | 'compare' => 'NUMERIC' |
… |
… |
function bbp_get_user_subscribed_forum_ids( $user_id = 0 ) { |
993 | 995 | function bbp_get_user_subscribed_topic_ids( $user_id = 0 ) { |
994 | 996 | $user_id = bbp_get_user_id( $user_id ); |
995 | 997 | $subscriptions = new WP_Query( array( |
996 | | 'fields' => 'ids', |
997 | | 'post_type' => bbp_get_topic_post_type(), |
998 | | 'nopaging' => true, |
999 | | 'no_found_rows' => true, |
1000 | | 'meta_query' => array( array( |
| 998 | 'fields' => 'ids', |
| 999 | 'post_type' => bbp_get_topic_post_type(), |
| 1000 | 'posts_per_page' => -1, |
| 1001 | 'nopaging' => true, |
| 1002 | 'no_found_rows' => true, |
| 1003 | 'meta_query' => array( array( |
1001 | 1004 | 'key' => '_bbp_subscription', |
1002 | 1005 | 'value' => $user_id, |
1003 | 1006 | 'compare' => 'NUMERIC' |