bp_forums_add_replied_join_sql

Filter the get_topics_join portion of the Forums sql when on a user's Replied To page.

Description

(string) bp_forums_add_replied_join_sql( (string) $sql ); 

This filter is added in bp_has_forum_topics().

Returns (string)

$sql SQL statement.

Parameters (1)

0. $sql (string)
SQL statement.

Usage

  1. if ( !function_exists( 'bp_forums_add_replied_join_sql' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-forums/bp-forums-filters.php'; 
  3.  
  4. // SQL statement. 
  5. $sql = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = bp_forums_add_replied_join_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_join_sql( $sql ) { 
  2. global $bbdb; 
  3.  
  4. $sql .= " LEFT JOIN {$bbdb->posts} p ON p.topic_id = t.topic_id "; 
  5.  
  6. return $sql;