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/search/functions.php

    r5770 r5827  
    1616 * Run the search query
    1717 *
    18  * @since bbPress (r4579) 
     18 * @since bbPress (r4579)
    1919 *
    2020 * @param mixed $new_args New arguments
     
    2626function bbp_search_query( $new_args = array() ) {
    2727
    28     // Existing arguments 
     28    // Existing arguments
    2929    $query_args = bbp_get_search_query_args();
    3030
     
    5959 *
    6060 * @since bbPress (r4928)
     61 *
    6162 * @return If a redirect is not needed
    6263 */
    6364function bbp_search_results_redirect() {
    64     global $wp_rewrite;
    65    
     65
    6666    // Bail if not a search request action
    6767    if ( empty( $_GET['action'] ) || ( 'bbp-search-request' !== $_GET['action'] ) ) {
     
    7070
    7171    // Bail if not using pretty permalinks
    72     if ( ! $wp_rewrite->using_permalinks() ) {
     72    if ( ! bbp_use_pretty_urls() ) {
    7373        return;
    7474    }
Note: See TracChangeset for help on using the changeset viewer.