Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
01/05/2011 10:03:41 PM (14 years ago)
Author:
djpaul
Message:

Speed up forum directory's "last active" bbPress SQL query to stop it fetching information we aren't using. Helps fix #2421

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-groups/bp-groups-filters.php

    r3369 r3660  
    106106add_filter( 'bb_current_user_can', 'groups_filter_bbpress_caps', 10, 3 );
    107107
     108/**
     109 * Amends the forum directory's "last active" bbPress SQL query to stop it fetching
     110 * information we aren't going to use. This speeds up the query.
     111 *
     112 * @see BB_Query::_filter_sql()
     113 * @since 1.3
     114 */
     115function groups_filter_forums_root_page_sql( $sql ) {
     116    return apply_filters( 'groups_filter_bbpress_root_page_sql', 't.topic_id' );
     117}
     118add_filter( 'get_latest_topics_fields', 'groups_filter_forums_root_page_sql' );
    108119?>
Note: See TracChangeset for help on using the changeset viewer.