Plugin Directory

Changeset 1299338


Ignore:
Timestamp:
12/02/2015 09:41:27 PM (10 years ago)
Author:
Dev49.net
Message:

Version 2.2.1:

  • Fixed problem with filter priority value
Location:
wp-first-letter-avatar
Files:
365 added
2 edited

Legend:

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

    r1298423 r1299338  
    11=== WP First Letter Avatar ===
    22Plugin Name: WP First Letter Avatar
    3 Version: 2.2
     3Version: 2.2.1
    44Plugin URI: http://dev49.net
    55Contributors: Dev49.net, DanielAGW
     
    7878== Changelog ==
    7979
     80= 2.2.1 =
     81* Fixed problem with filter priority value
     82
    8083= 2.2 =
    8184* Added support for numbers
     
    149152== Upgrade Notice ==
    150153
     154= 2.2.1 =
     155Fixed filter priority issue. Update strongly recommended.
     156
    151157= 2.2 =
    152158Added support for numbers and Cyrillic script. Update not necessary.
  • wp-first-letter-avatar/trunk/wp-first-letter-avatar.php

    r1298004 r1299338  
    66 * Contributors: Dev49.net, DanielAGW
    77 * Description: Set custom avatars for users with no Gravatar. The avatar will be the first (or any other) letter of the user's name on a colorful background.
    8  * Version: 2.2
     8 * Version: 2.2.1
    99 * Author: Dev49.net
    1010 * Author URI: http://dev49.net
     
    5555
    5656
    57     public function __construct(){
    58 
    59         /* --------------- WP HOOKS --------------- */
    60        
    61         // add Settings link to plugins page:
    62         add_filter('plugin_action_links_' . plugin_basename(__FILE__), array($this, 'add_settings_link'));
    63 
    64         // add plugin activation hook:
    65         register_activation_hook(__FILE__, array($this, 'plugin_activate'));
    66 
    67         // add stylesheets/scripts:
    68         add_action('wp_enqueue_scripts', function(){
    69             wp_enqueue_style('wpfla-style-handle', plugins_url('css/style.css', __FILE__));
    70         });     
    71 
    72         // add filter to get_avatar:
    73         add_filter('get_avatar', array($this, 'set_comment_avatar'), $this->filter_priority, 5);
    74 
    75         // add additional filter for userbar avatar, but only when not in admin:
    76         if (!is_admin()){
    77             add_action('admin_bar_menu', array($this, 'admin_bar_menu_action'), 0);
    78         } else { // when in admin, make sure first letter avatars are not displayed on discussion settings page
    79             global $pagenow;
    80             if ($pagenow == 'options-discussion.php'){
    81                 remove_filter('get_avatar', array($this, 'set_comment_avatar'), $this->filter_priority);
    82             }
    83         }
    84        
     57    public function __construct(){     
    8558
    8659        /* --------------- CONFIGURATION --------------- */
     
    10982            $this->image_unknown = (array_key_exists('wpfla_unknown_image', $options) ? (string)$options['wpfla_unknown_image'] : self::IMAGE_UNKNOWN);
    11083            $this->filter_priority = (array_key_exists('wpfla_filter_priority', $options) ? (int)$options['wpfla_filter_priority'] : self::FILTER_PRIORITY);       
     84        }
     85       
     86
     87        /* --------------- WP HOOKS --------------- */
     88       
     89        // add Settings link to plugins page:
     90        add_filter('plugin_action_links_' . plugin_basename(__FILE__), array($this, 'add_settings_link'));
     91
     92        // add plugin activation hook:
     93        register_activation_hook(__FILE__, array($this, 'plugin_activate'));
     94
     95        // add stylesheets/scripts:
     96        add_action('wp_enqueue_scripts', function(){
     97            wp_enqueue_style('wpfla-style-handle', plugins_url('css/style.css', __FILE__));
     98        });     
     99
     100        // add filter to get_avatar:
     101        add_filter('get_avatar', array($this, 'set_comment_avatar'), $this->filter_priority, 5);
     102
     103        // add additional filter for userbar avatar, but only when not in admin:
     104        if (!is_admin()){
     105            add_action('admin_bar_menu', array($this, 'admin_bar_menu_action'), 0);
     106        } else { // when in admin, make sure first letter avatars are not displayed on discussion settings page
     107            global $pagenow;
     108            if ($pagenow == 'options-discussion.php'){
     109                remove_filter('get_avatar', array($this, 'set_comment_avatar'), $this->filter_priority);
     110            }
    111111        }
    112112
Note: See TracChangeset for help on using the changeset viewer.