Skip to:
Content

bbPress.org

Changeset 6545


Ignore:
Timestamp:
06/14/2017 09:47:48 PM (5 years ago)
Author:
johnjamesjacoby
Message:

Forums: Use no_found_rows by default in bbp_has_forums()

Forums do not currently support pagination, so the total number of rows is not traditionally useful for this loop. In cases where it is, it can be explicitly overloaded in the $args array.

This results in 1 less database query per page where a forums list is shown, and a speed improvement overall.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/forums/template.php

    r6544 r6545  
    147147        'post_status'         => bbp_get_public_status_id(),
    148148        'posts_per_page'      => get_option( '_bbp_forums_per_page', 50 ),
    149         'ignore_sticky_posts' => true,
    150149        'orderby'             => 'menu_order title',
    151         'order'               => 'ASC'
     150        'order'               => 'ASC',
     151        'no_found_rows'       => true,
     152        'ignore_sticky_posts' => true
    152153    ), 'has_forums' );
    153154
     
    472473
    473474/**
    474  * Allow forum rows to have adminstrative actions
     475 * Allow forum rows to have administrative actions
    475476 *
    476477 * @since 2.1.0 bbPress (r3653)
Note: See TracChangeset for help on using the changeset viewer.