Changeset 5502
- Timestamp:
- 09/11/2014 02:41:33 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/forums/functions.php
r5466 r5502 950 950 delete_option( '_bbp_private_forums' ); 951 951 delete_option( '_bbp_hidden_forums' ); 952 952 953 953 /** 954 954 * Don't search for both private/hidden statuses. Since 'pre_get_posts' is an 955 * action, it's not removed by suppress_filters. We need to make sure that 955 * action, it's not removed by suppress_filters. We need to make sure that 956 956 * we're only searching for the supplied post_status. 957 957 * … … 975 975 'fields' => 'ids' 976 976 ) ); 977 977 978 978 // Enable forum visibilty normalization 979 979 add_action( 'pre_get_posts', 'bbp_pre_get_posts_normalize_forum_visibility', 4 ); … … 1097 1097 * @param int $difference Optional. Default 1 1098 1098 * @uses bbp_get_forum_id() To get the forum id 1099 * @uses bbp_get_forum_topic_count_hidden To get the forum's hidden topic count 1099 1100 * @uses update_post_meta() To update the forum's topic count meta 1100 1101 * @uses apply_filters() Calls 'bbp_bump_forum_topic_count_hidden' with the … … 1463 1464 1464 1465 /** 1465 * Adjust the total hidden topic count of a forum (hidden includes trashed and spammed topics) 1466 * Adjust the total hidden topic count of a forum (hidden includes trashed, 1467 * spammed and pending topics) 1466 1468 * 1467 1469 * @since bbPress (r2888) … … 1473 1475 * @uses bbp_get_topic_forum_id() To get the topic forum id 1474 1476 * @uses bbp_get_forum_id() To get the forum id 1477 * @uses bbp_get_trash_status_id() To get the trash status id 1478 * @uses bbp_get_spam_status_id() To get the spam status id 1479 * @uses bbp_get_pending_status_id() To get the pending status id 1475 1480 * @uses wpdb::prepare() To prepare our sql query 1476 * @uses wpdb::get_ col() To execute our query and get the columnback1481 * @uses wpdb::get_var() To execute our query and get the var back 1477 1482 * @uses update_post_meta() To update the forum hidden topic count meta 1478 1483 * @uses apply_filters() Calls 'bbp_update_forum_topic_count_hidden' with the … … 1494 1499 1495 1500 // Can't update what isn't there 1496 if ( ! empty( $forum_id ) ) {1501 if ( ! empty( $forum_id ) ) { 1497 1502 1498 1503 // Get topics of forum 1499 1504 if ( empty( $topic_count ) ) { 1500 $post_status = "'" . implode( "','", array( bbp_get_trash_status_id(), bbp_get_spam_status_id() ) ) . "'";1505 $post_status = "'" . implode( "','", array( bbp_get_trash_status_id(), bbp_get_spam_status_id(), bbp_get_pending_status_id() ) ) . "'"; 1501 1506 $topic_count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(ID) FROM {$wpdb->posts} WHERE post_parent = %d AND post_status IN ( {$post_status} ) AND post_type = '%s';", $forum_id, bbp_get_topic_post_type() ) ); 1502 1507 }
Note: See TracChangeset
for help on using the changeset viewer.