Skip to:
Content

bbPress.org


Ignore:
Timestamp:
07/14/2015 12:31:42 AM (10 years ago)
Author:
johnjamesjacoby
Message:

Abstraction: Use bbp_db(), bbp_rewrite() & friends, introduced in r5823 & r5826.

This commit improves the stability of bbPress in the WordPress environment by reducing global variable exposure. It also comes with minimal opcode improvements in some circumstances where $GLOBALS is preferred over defining via global statements.

Some additional surrounding cleanup directly related to functions & methods being altered is also being performed here.

Fixes #2786.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/core/theme-compat.php

    r5770 r5827  
    804804 *
    805805 * @since bbPress (r2628)
     806 *
    806807 * @param string $redirect_url Redirect url
    807  * @uses WP_Rewrite::using_permalinks() To check if the blog is using permalinks
     808 * @uses bbp_use_pretty_urls() To check if the blog is using permalinks
    808809 * @uses bbp_get_paged() To get the current page number
    809810 * @uses bbp_is_single_topic() To check if it's a topic page
    810811 * @uses bbp_is_single_forum() To check if it's a forum page
     812 *
    811813 * @return bool|string False if it's a topic/forum and their first page,
    812814 *                      otherwise the redirect url
    813815 */
    814816function bbp_redirect_canonical( $redirect_url ) {
    815     global $wp_rewrite;
    816817
    817818    // Canonical is for the beautiful
    818     if ( $wp_rewrite->using_permalinks() ) {
     819    if ( bbp_use_pretty_urls() ) {
    819820
    820821        // If viewing beyond page 1 of several
Note: See TracChangeset for help on using the changeset viewer.