Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
08/10/2016 11:40:14 AM (8 years ago)
Author:
djpaul
Message:

Core: prevent DB query for WP's main loop on single item pages.

As of WordPress 4.6, it is possible to bypass the main WP_Query entirely.
This saves us one unnecessary database query.

Fixes #7120

Props r-a-y, DJPaul

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/bp-core-filters.php

    r10941 r11007  
    7575// Turn comments off for BuddyPress pages.
    7676add_filter( 'comments_open', 'bp_comments_open', 10, 2 );
     77
     78// Prevent DB query for WP's main loop.
     79add_filter( 'posts_pre_query', 'bp_core_filter_wp_query', 10, 2 );
    7780
    7881/**
Note: See TracChangeset for help on using the changeset viewer.