Plugin Directory

Changeset 1108525


Ignore:
Timestamp:
03/09/2015 04:02:32 AM (11 years ago)
Author:
DanielAGW
Message:

Version 1.2.5:

  • Fixed common PHP warning
  • Fixed avatar presentation of logged-in users in their userbars
Location:
wp-first-letter-avatar
Files:
149 added
2 edited

Legend:

Unmodified
Added
Removed
  • wp-first-letter-avatar/trunk/readme.txt

    r1106489 r1108525  
    11=== WP First Letter Avatar ===
    22Plugin Name: WP First Letter Avatar
    3 Version: 1.2.4
     3Version: 1.2.5
    44Plugin URI: https://github.com/DanielAGW/wp-first-letter-avatar
    55Contributors: DanielAGW
     
    7373== Changelog ==
    7474
     75= 1.2.5 =
     76* Fixed common PHP warning
     77* Fixed avatar presentation of logged-in users in their userbars
     78
    7579= 1.2.4 =
    7680* Fixed couple of small technical issues
     
    98102== Upgrade Notice ==
    99103
     104= 1.2.5 =
     105This version fixes annoying PHP warning. Update recommended.
     106
    100107= 1.2.4 =
    101108This version fixes couple of small technical issues. No need to update unless you have experienced any problems with the plugin.
  • wp-first-letter-avatar/trunk/wp-first-letter-avatar.php

    r1106485 r1108525  
    55 * Contributors: DanielAGW
    66 * Description: Set custom avatars for users with no Gravatar. The avatar will be a first (or any other) letter of the users's name.
    7  * Version: 1.2.4
     7 * Version: 1.2.5
    88 * Author: Daniel Wroblewski
    99 * Author URI: https://github.com/DanielAGW
     
    5050        add_action('wp_enqueue_scripts', array($this, 'wpfla_add_scripts'));
    5151
    52         // add filter to get_avatar but only when not in admin panel:
    53         if (!is_admin()){
    54             add_filter('get_avatar', array($this, 'set_comment_avatar'), 10, 5);
    55         }
    56         // use different function for top user/admin bar and remove it after it's been rendered:
    57         add_action('admin_bar_menu', function(){
    58             add_filter('get_avatar', array($this, 'set_userbar_avatar'), 10, 5);
    59         },0);
    60         add_action('wp_after_admin_bar_render', function(){
    61             remove_filter('get_avatar', array($this, 'set_userbar_avatar'), 10);
    62         });
     52        // add filter to get_avatar:
     53        add_filter('get_avatar', array($this, 'set_comment_avatar'), 10, 5);
     54
     55        // add additional filter for userbar avatar, but only when not in admin:
     56        if (!is_admin()) {
     57            add_action('admin_bar_menu', array($this, 'add_set_userbar_avatar_filter'), 0);
     58        }
    6359
    6460
     
    202198
    203199
     200    public function add_set_userbar_avatar_filter(){
     201
     202        add_filter('get_avatar', array($this, 'set_userbar_avatar'), 10, 5);
     203
     204    }
     205
     206
     207
    204208    public function set_userbar_avatar($avatar, $id_or_email, $size = '96', $default, $alt = ''){ // only size and alt arguments are used
    205209
Note: See TracChangeset for help on using the changeset viewer.