bp_forums_add_replied_distinct_sql

Filter the get_topics_distinct portion of the Forums SQL when on a user's Replied To page.

Description

(string) bp_forums_add_replied_distinct_sql( (string) $sql ); 

This filter is added in bp_has_forum_topics().

Returns (string)

$sql SQL fragment of the form "DISTINCT t.topic_id, ".

Parameters (1)

0. $sql (string)
SQL fragment.

Usage

  1. if ( !function_exists( 'bp_forums_add_replied_distinct_sql' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-forums/bp-forums-filters.php'; 
  3.  
  4. // SQL fragment. 
  5. $sql = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = bp_forums_add_replied_distinct_sql($sql); 
  9.  

Defined (1)

The function is defined in the following location(s).

/bp-forums/bp-forums-filters.php  
  1. function bp_forums_add_replied_distinct_sql( $sql ) { 
  2. $sql = "DISTINCT t.topic_id, "; 
  3.  
  4. return $sql;