WordPress.org

Plugin Directory

Changeset 1459906


Ignore:
Timestamp:
07/24/16 20:07:50 (11 months ago)
Author:
Dev49.net
Message:

Version 2.2.6.2:

  • Fixed group avatars issue
Location:
buddypress-first-letter-avatar
Files:
535 added
2 edited

Legend:

Unmodified
Added
Removed
  • buddypress-first-letter-avatar/trunk/buddypress-first-letter-avatar.php

    r1421630 r1459906  
    88 * Contributors: Dev49.net, DanielAGW 
    99 * Description: Set custom avatars for BuddyPress users. The avatar will be the first (or any other) letter of the user's name on a colorful background. 
    10  * Version: 2.2.6.1 
     10 * Version: 2.2.6.2 
    1111 * Author: Dev49.net 
    1212 * Author URI: http://dev49.net 
    1313 * Tags: avatars, comments, buddypress, custom avatar, discussion, change avatar, avatar, custom wordpress avatar, first letter avatar, comment change avatar, wordpress new avatar, avatar, initial avatar 
    14  * Requires at least: 4.4 
    15  * Tested up to: 4.5.2 
     14 * Requires at least: 4.5 
     15 * Tested up to: 4.5.3 
    1616 * Stable tag: trunk 
    1717 * License: GPLv2 or later 
     
    390390        } 
    391391 
     392        $original_image_url = ''; // define variable before loop 
    392393        foreach ($image as $image_data){ // we are using foreach, but in fact there should be only one image 
     394            /* @var $image_data DOMNodeList */ 
    393395            $original_image_url = $image_data->getAttribute('src'); // url of the original image 
    394396            break; // this foreach loop should be exectued only once no matter what, since there is only one img tag, but just to be safe we are going to use break here 
     
    406408            // if there is no gravatar URL, it means that user has set his own profile avatar, 
    407409            // so we're gonna see if we should be using it (user avatar); 
    408             // if we should, just return the input data and leave the avatar as it was: 
     410            // if we should, just return the input data and leave the avatar as it was 
     411            // (2nd condition explanation -> check 'group' case) 
    409412            if ($this->use_profile_avatar == true){ 
    410                 if (stripos($original_image_url, 'gravatar.com/avatar') === false){ // we need to specifically check for false (hence '===') 
     413                if ((stripos($original_image_url, 'gravatar.com/avatar') === false) && // we need to specifically check for false (hence '===') 
     414                    (stripos($original_image_url, 'bp-core/images/mystery-man') === false)){ // no extension specified just in case 
    411415                    return $html_data; 
    412416                } 
     
    459463            // if there is no gravatar URL, it means that group has their own avatar, 
    460464            // so we're gonna see if we should be using it (user/group avatar); 
    461             // if we should, just return the input data and leave the avatar as it was: 
     465            // if we should, just return the input data and leave the avatar as it was. 
     466            // it is also possible that group's mystery avatar is stored locally, so 
     467            // we need to check that as well 
    462468            if ($this->use_profile_avatar == true){ 
    463                 if (stripos($original_image_url, 'gravatar.com/avatar') === false){ // we need to specifically check for false (hence '===') 
     469                if ((stripos($original_image_url, 'gravatar.com/avatar') === false) && // we need to specifically check for false (hence '===') 
     470                    (stripos($original_image_url, 'bp-core/images/mystery-group') === false)){ // no extension specified just in case 
    464471                    return $html_data; 
    465472                } 
  • buddypress-first-letter-avatar/trunk/readme.txt

    r1421630 r1459906  
    11=== BuddyPress First Letter Avatar === 
    22Plugin Name: BuddyPress First Letter Avatar 
    3 Version: 2.2.6.1 
     3Version: 2.2.6.2 
    44Plugin URI: http://dev49.net 
    55Contributors: Dev49.net, DanielAGW 
    66Tags: avatars, comments, buddypress, custom avatar, discussion, change avatar, avatar, custom wordpress avatar, first letter avatar, comment change avatar, wordpress new avatar, avatar, initial avatar 
    7 Requires at least: 4.4 
    8 Tested up to: 4.5.2 
     7Requires at least: 4.5 
     8Tested up to: 4.5.3 
    99Stable tag: trunk 
    1010Author: Dev49.net 
     
    8383== Changelog == 
    8484 
     85= 2.2.6.2 = 
     86* Fixed group avatars issue 
     87 
    8588= 2.2.6.1 = 
    8689* Fixed minor avatar issue (added bp_core_fetch_avatar_url filter callback) 
     
    9598 
    9699= 2.2.4 = 
    97 * Added fallback for Polish letters (thanks Micha³!) 
     100* Added fallback for Polish letters (thanks Micha!) 
    98101* Plugin prepared for translations (contributors are welcome!) 
    99102 
     
    166169== Upgrade Notice == 
    167170 
     171= 2.2.6.2 = 
     172Fixed group avatars issue, update recommended. 
     173 
    168174= 2.2.6.1 = 
    169175Fixed minor avatar issue, update not necessary unless you are experiencing problems. 
Note: See TracChangeset for help on using the changeset viewer.