Skip to:
Content

BuddyPress.org

Changeset 6884


Ignore:
Timestamp:
04/02/2013 09:07:04 PM (11 years ago)
Author:
boonebgorges
Message:

Introduces BP_SHOW_AVATARS constant

This constant allows admins of advanced MS setups to avoid a potentially
costly call to bp_get_option( 'show_avatar' )

Fixes #4908

Props wpdennis

File:
1 edited

Legend:

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

    r6882 r6884  
    4444    if ( !defined( 'BP_AVATAR_DEFAULT_THUMB' ) )
    4545        define( 'BP_AVATAR_DEFAULT_THUMB', BP_PLUGIN_URL . 'bp-core/images/mystery-man-50.jpg' );
     46
     47    if ( ! defined( 'BP_SHOW_AVATARS' ) ) {
     48        define( 'BP_SHOW_AVATARS', bp_get_option( 'show_avatars' ) );
     49    }
    4650}
    4751add_action( 'bp_init', 'bp_core_set_avatar_constants', 3 );
     
    7478    // Cache the root blog's show_avatars setting, to avoid unnecessary
    7579    // calls to switch_to_blog()
    76     $bp->avatar->show_avatars = (bool) bp_get_option( 'show_avatars' );
     80    $bp->avatar->show_avatars = (bool) BP_SHOW_AVATARS;
    7781
    7882    // Backpat for pre-1.5
Note: See TracChangeset for help on using the changeset viewer.