Changeset 6153
- Timestamp:
- 06/29/2012 10:01:17 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-groups/bp-groups-classes.php
r6119 r6153 646 646 $bp->groups->filter_sql = ' AND t.topic_posts = 1'; 647 647 648 $extra_sql = apply_filters( 'groups_total_public_forum_topic_count', $bp->groups->filter_sql, $type ); 648 /** 649 * Provide backward-compatibility for the groups_total_public_forum_topic_count SQL filter. 650 * Developers: DO NOT use this filter. It will be removed in BP 1.7. Instead, use 651 * get_global_forum_topic_count_extra_sql. See https://buddypress.trac.wordpress.org/ticket/4306 652 */ 653 $maybe_extra_sql = apply_filters( 'groups_total_public_forum_topic_count', $bp->groups->filter_sql, $type ); 654 655 if ( is_int( $maybe_extra_sql ) ) 656 $extra_sql = $bp->groups->filter_sql; 657 else 658 $extra_sql = $maybe_extra_sql; 659 660 // Developers: use this filter instead 661 $extra_sql = apply_filters( 'get_global_forum_topic_count_extra_sql', $bp->groups->filter_sql, $type ); 662 663 // Make sure the $extra_sql begins with an AND 664 if ( 'AND' != substr( trim( strtoupper( $extra_sql ) ), 0, 3 ) ) 665 $extra_sql = ' AND ' . $extra_sql; 649 666 650 667 return $wpdb->get_var( "SELECT COUNT(t.topic_id) FROM {$bbdb->topics} AS t, {$bp->groups->table_name} AS g LEFT JOIN {$bp->groups->table_name_groupmeta} AS gm ON g.id = gm.group_id WHERE (gm.meta_key = 'forum_id' AND gm.meta_value = t.forum_id) AND g.status = 'public' AND t.topic_status = '0' AND t.topic_sticky != '2' {$extra_sql} " );
Note: See TracChangeset
for help on using the changeset viewer.