Skip to:
Content

BuddyPress.org

Changeset 5668


Ignore:
Timestamp:
01/29/2012 05:30:10 AM (15 years ago)
Author:
johnjamesjacoby
Message:

Remove unreferenced globals and prevent debug notices in bp-core-template.php.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core/bp-core-template.php

    r5602 r5668  
    11<?php
     2
    23// Exit if accessed directly
    34if ( !defined( 'ABSPATH' ) ) exit;
    … …  
    244245 * Generates the basic search form as used in BP-Default's header.
    245246 *
    246  * @global object $bp BuddyPress global settings
    247247 * @return string HTML <select> element
    248248 * @since 1.0
    249249 */
    250250function bp_search_form_type_select() {
    251         global $bp;
    252251
    253252        $options = array();
    … …  
    406405
    407406        // Remove shortcodes if necessary
    408         if ( $filter_shortcodes )
     407        if ( !empty( $filter_shortcodes ) )
    409408                $text = strip_shortcodes( $text );
    410409
    411410        // When $html is true, the excerpt should be created without including HTML tags in the
    412411        // excerpt length
    413         if ( $html ) {
     412        if ( !empty( $html ) ) {
    414413                // The text is short enough. No need to truncate
    415414                if ( mb_strlen( preg_replace( '/<.*?>/', '', $text ) ) <= $length ) {
    … …  
    471470
    472471        // If $exact is false, we can't break on words
    473         if ( !$exact ) {
     472        if ( empty( $exact ) ) {
    474473                $spacepos = mb_strrpos( $truncate, ' ' );
    475474                if ( isset( $spacepos ) ) {
    … …  
    981980 */
    982981function bp_is_blog_page() {
    983         global $wp_query;
    984982
    985983        $is_blog_page = false;
    … …  
    10921090
    10931091function bp_is_my_profile() {
    1094         global $bp;
    1095 
    10961092        if ( is_user_logged_in() && bp_loggedin_user_id() == bp_displayed_user_id() )
    10971093                $my_profile = true;
    … …  
    11031099
    11041100function bp_is_user() {
    1105         global $bp;
    1106 
    11071101        if ( bp_displayed_user_id() )
    11081102                return true;
Note: See TracChangeset for help on using the changeset viewer.