Plugin Directory

Changeset 1299329


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

Version 2.2.1:

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

Legend:

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

    r1298037 r1299329  
    66 * Contributors: Dev49.net, DanielAGW
    77 * 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.
    8  * Version: 2.2
     8 * Version: 2.2.1
    99 * Author: Dev49.net
    1010 * Author URI: http://dev49.net
     
    5757
    5858
    59     public function __construct(){
    60 
    61         /* --------------- WP HOOKS --------------- */
    62 
    63         // add Settings link to plugins page:
    64         add_filter('plugin_action_links_' . plugin_basename(__FILE__), array($this, 'add_settings_link'));
    65 
    66         // add plugin activation hook:
    67         register_activation_hook(__FILE__, array($this, 'plugin_activate'));
    68 
    69         // add stylesheets/scripts:
    70         add_action('wp_enqueue_scripts', function(){
    71             wp_enqueue_style('bpfla-style-handle', plugins_url('css/style.css', __FILE__));
    72         });
    73 
    74         // add filter to get_avatar:
    75         add_filter('get_avatar', array($this, 'set_comment_avatar'), $this->filter_priority, 5); // this will only be used for anonymous WordPress comments (from non-users)
    76 
    77         // add filter to bp_core_fetch_avatar:
    78         add_filter('bp_core_fetch_avatar', array($this, 'set_buddypress_avatar'), $this->filter_priority, 2); // this is used for every avatar call except the anonymous comment posters
    79 
    80         // when in admin, make sure first letter avatars are not displayed on discussion settings page:
    81         if (is_admin()){
    82             global $pagenow;
    83             if ($pagenow == 'options-discussion.php'){
    84                 remove_filter('get_avatar', array($this, 'set_comment_avatar'), $this->filter_priority);
    85             }
    86         }
    87        
     59    public function __construct(){     
    8860
    8961        /* --------------- CONFIGURATION --------------- */
     
    11486            $this->image_unknown = (array_key_exists('bpfla_unknown_image', $options) ? (string)$options['bpfla_unknown_image'] : self::IMAGE_UNKNOWN);
    11587            $this->filter_priority = (array_key_exists('bpfla_filter_priority', $options) ? (int)$options['bpfla_filter_priority'] : self::FILTER_PRIORITY);               
     88        }
     89   
     90
     91        /* --------------- WP HOOKS --------------- */
     92
     93        // add Settings link to plugins page:
     94        add_filter('plugin_action_links_' . plugin_basename(__FILE__), array($this, 'add_settings_link'));
     95
     96        // add plugin activation hook:
     97        register_activation_hook(__FILE__, array($this, 'plugin_activate'));
     98
     99        // add stylesheets/scripts:
     100        add_action('wp_enqueue_scripts', function(){
     101            wp_enqueue_style('bpfla-style-handle', plugins_url('css/style.css', __FILE__));
     102        });
     103
     104        // add filter to get_avatar:
     105        add_filter('get_avatar', array($this, 'set_comment_avatar'), $this->filter_priority, 5); // this will only be used for anonymous WordPress comments (from non-users)
     106
     107        // add filter to bp_core_fetch_avatar:
     108        add_filter('bp_core_fetch_avatar', array($this, 'set_buddypress_avatar'), $this->filter_priority, 2); // this is used for every avatar call except the anonymous comment posters
     109
     110        // when in admin, make sure first letter avatars are not displayed on discussion settings page:
     111        if (is_admin()){
     112            global $pagenow;
     113            if ($pagenow == 'options-discussion.php'){
     114                remove_filter('get_avatar', array($this, 'set_comment_avatar'), $this->filter_priority);
     115            }
    116116        }
    117117
  • buddypress-first-letter-avatar/trunk/readme.txt

    r1298424 r1299329  
    11=== BuddyPress First Letter Avatar ===
    22Plugin Name: BuddyPress First Letter Avatar
    3 Version: 2.2
     3Version: 2.2.1
    44Plugin URI: http://dev49.net
    55Contributors: Dev49.net, DanielAGW
     
    7979== Changelog ==
    8080
     81= 2.2.1 =
     82* Fixed problem with filter priority value
     83
    8184= 2.2 =
    8285* Added support for numbers
     
    136139== Upgrade Notice ==
    137140
     141= 2.2.1 =
     142Fixed filter priority issue. Update strongly recommended.
     143
    138144= 2.2 =
    139145Added support for numbers and improved performance. Update recommended.
Note: See TracChangeset for help on using the changeset viewer.