Skip to:
Content

bbPress.org


Ignore:
Timestamp:
07/14/2015 12:31:42 AM (11 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/common/template.php

    r5770 r5827  
    20582058     */
    20592059    function bbp_get_view_url( $view = false ) {
    2060         global $wp_rewrite;
    20612060
    20622061        $view = bbp_get_view_id( $view );
     
    20662065
    20672066        // Pretty permalinks
    2068         if ( $wp_rewrite->using_permalinks() ) {
    2069             $url = $wp_rewrite->root . bbp_get_view_slug() . '/' . $view;
    2070             $url = home_url( user_trailingslashit( $url ) );
     2067        if ( bbp_use_pretty_urls() ) {
     2068            $url = trailingslashit( bbp_get_root_url() . bbp_get_view_slug() ) . $view;
     2069            $url = user_trailingslashit( $url );
     2070            $url = home_url( $url );
    20712071
    20722072        // Unpretty permalinks
    20732073        } else {
    2074             $url = add_query_arg( array( bbp_get_view_rewrite_id() => $view ), home_url( '/' ) );
     2074            $url = add_query_arg( array(
     2075                bbp_get_view_rewrite_id() => $view
     2076            ), home_url( '/' ) );
    20752077        }
    20762078
Note: See TracChangeset for help on using the changeset viewer.