Skip to:
Content

BuddyPress.org

Changeset 12536


Ignore:
Timestamp:
01/25/2020 06:18:04 AM (4 years ago)
Author:
imath
Message:

Prevent errors when get_avatar() is used before BP Globals are set

In this case we need to make sure the buddypress()->avatar object is set before checking its show_avatars property into the function used to filter get_avatar().

Props shanebp

Fixes #8177

File:
1 edited

Legend:

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

    r12507 r12536  
    194194
    195195    // If avatars are disabled for the root site, obey that request and bail.
    196     if ( ! $bp->avatar->show_avatars ) {
     196    if ( ! $bp->avatar || ! $bp->avatar->show_avatars ) {
    197197        return;
    198198    }
Note: See TracChangeset for help on using the changeset viewer.