Changeset 6827 for trunk/src/includes/topics/functions.php
- Timestamp:
- 07/05/2018 06:03:38 AM (7 years ago)
- File:
-
- 1 edited
-
trunk/src/includes/topics/functions.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/topics/functions.php
r6793 r6827 2471 2471 2472 2472 // Get replies of topic if not passed 2473 if ( empty( $reply_count ) ) { 2474 $reply_count = bbp_get_public_child_count( $topic_id, bbp_get_reply_post_type() ); 2475 } 2476 2477 $reply_count = (int) $reply_count; 2473 $reply_count = empty( $reply_count ) 2474 ? bbp_get_public_child_count( $topic_id, bbp_get_reply_post_type() ) 2475 : (int) $reply_count; 2478 2476 2479 2477 update_post_meta( $topic_id, '_bbp_reply_count', $reply_count ); … … 2501 2499 2502 2500 // Get replies of topic 2503 if ( empty( $reply_count ) ) { 2504 $statuses = bbp_get_non_public_topic_statuses(); 2505 $post_status = "'" . implode( "','", $statuses ) . "'"; 2506 $bbp_db = bbp_db(); 2507 $query = $bbp_db->prepare( "SELECT COUNT(ID) FROM {$bbp_db->posts} WHERE post_parent = %d AND post_status IN ( {$post_status} ) AND post_type = %s", $topic_id, bbp_get_reply_post_type() ); 2508 $reply_count = $bbp_db->get_var( $query ); 2509 } 2510 2511 $reply_count = (int) $reply_count; 2501 $reply_count = empty( $reply_count ) 2502 ? bbp_get_non_public_child_count( $topic_id, 'reply' ) 2503 : (int) $reply_count; 2512 2504 2513 2505 update_post_meta( $topic_id, '_bbp_reply_count_hidden', $reply_count );
Note: See TracChangeset
for help on using the changeset viewer.