get_global_forum_topic_count_extra_sql
Filters the portion of the SQL related to global count of forum topics in public groups.
Description
apply_filters( 'get_global_forum_topic_count_extra_sql', (string) $bp_groups_filter_sql, (string) $type );
See https://buddypress
.trac.wordpress.org/ticket/4306.
Parameters (2)
- 0. $bp_groups_filter_sql (string)
- SQL portion for the query.
- 1. $type (string)
- Type of forum topics to query for.
Usage
- To run the hook, copy the example below.
- $bp_groups_filter_sql = apply_filters( 'get_global_forum_topic_count_extra_sql', $bp_groups_filter_sql, $type );
- if ( !empty( $bp_groups_filter_sql ) ) {
- // everything has led up to this point...
- }
- The following example is for adding a hook callback.
- // define the get_global_forum_topic_count_extra_sql callback
- function filter_get_global_forum_topic_count_extra_sql( $bp_groups_filter_sql, $type ) {
- // make filter magic happen here...
- return $bp_groups_filter_sql;
- };
- // add the filter
- add_filter( 'get_global_forum_topic_count_extra_sql', 'filter_get_global_forum_topic_count_extra_sql', 10, 2 );
- To remove a hook callback, use the example below.
- // remove the filter
- remove_filter( 'get_global_forum_topic_count_extra_sql', 'filter_get_global_forum_topic_count_extra_sql', 10, 2 );
Defined (1)
The filter is defined in the following location(s).
- /bp-groups/classes/class-bp-groups-group.php
- $extra_sql = apply_filters( 'get_global_forum_topic_count_extra_sql', $bp->groups->filter_sql, $type );