WP User Avatar - Version 2.2.10

Version Description

  • Fixed: Warning: Missing argument 2 for WP_User_Avatar.
  • Re-added support for hook implementation eg on wp frontend.
Download this release

Release Info

Developer Collizo4sky
Plugin Icon 128x128 WP User Avatar
Version 2.2.10
Comparing to
See all releases

Code changes from version 2.2.9 to 2.2.10

includes/class-wp-user-avatar.php CHANGED
@@ -26,14 +26,24 @@ class WP_User_Avatar {
26
  // Add WPUA to profile for users with permission
27
  if($this->wpua_is_author_or_above() || ((bool) $wpua_allow_upload == 1 && is_user_logged_in())) {
28
  // Profile functions and scripts
29
- //add_action('show_user_profile', array('wp_user_avatar', 'wpua_action_show_user_profile'));
 
 
 
 
 
 
 
 
 
30
  add_action('personal_options_update', array($this, 'wpua_action_process_option_update'));
31
- //add_action('edit_user_profile', array('wp_user_avatar', 'wpua_action_show_user_profile'));
32
  add_action('edit_user_profile_update', array($this, 'wpua_action_process_option_update'));
33
  add_action('user_new_form', array($this, 'wpua_action_show_user_profile'));
34
  add_action('user_register', array($this, 'wpua_action_process_option_update'));
35
 
36
- add_filter('user_profile_picture_description', function ($description, $profileuser) {
 
 
37
  ob_start();
38
  echo '<style>.user-profile-picture > td > .avatar {display: none;}</style>';
39
  self::wpua_core_show_user_profile($profileuser);
26
  // Add WPUA to profile for users with permission
27
  if($this->wpua_is_author_or_above() || ((bool) $wpua_allow_upload == 1 && is_user_logged_in())) {
28
  // Profile functions and scripts
29
+ add_action('show_user_profile', function($user) {
30
+ if(is_admin()) return;
31
+ $this->wpua_action_show_user_profile($user);
32
+ });
33
+
34
+ add_action('edit_user_profile', function($user) {
35
+ if(is_admin()) return;
36
+ $this->wpua_action_show_user_profile($user);
37
+ });
38
+
39
  add_action('personal_options_update', array($this, 'wpua_action_process_option_update'));
 
40
  add_action('edit_user_profile_update', array($this, 'wpua_action_process_option_update'));
41
  add_action('user_new_form', array($this, 'wpua_action_show_user_profile'));
42
  add_action('user_register', array($this, 'wpua_action_process_option_update'));
43
 
44
+ // setting defaults for the filter callback fixes an error like https://wordpress.org/support/topic/error-missing-argument-2-for-wp_user_avatarclosure
45
+ // see https://stackoverflow.com/questions/37779680/missing-argument-2-for-a-custom-function
46
+ add_filter('user_profile_picture_description', function ($description = '', $profileuser = null) {
47
  ob_start();
48
  echo '<style>.user-profile-picture > td > .avatar {display: none;}</style>';
49
  self::wpua_core_show_user_profile($profileuser);
readme.txt CHANGED
@@ -4,7 +4,7 @@ Contributors: properfraction, collizo4sky
4
  Tags: user profile, avatar, gravatar, author image, author photo, author avatar, bbPress, profile avatar, profile image, user avatar, user image, user photo, widget
5
  Requires at least: 4.0
6
  Tested up to: 5.6
7
- Stable tag: 2.2.9
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -370,6 +370,10 @@ This would output:
370
 
371
  == Changelog ==
372
 
 
 
 
 
373
  = 2.2.9 =
374
  * Fixed PHP Notice: Trying to get property 'ID' of non-object.
375
  * Fixed Fatal Error: Cannot use string offset as an array.
4
  Tags: user profile, avatar, gravatar, author image, author photo, author avatar, bbPress, profile avatar, profile image, user avatar, user image, user photo, widget
5
  Requires at least: 4.0
6
  Tested up to: 5.6
7
+ Stable tag: 2.2.10
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
370
 
371
  == Changelog ==
372
 
373
+ = 2.2.10 =
374
+ * Fixed: Warning: Missing argument 2 for WP_User_Avatar.
375
+ * Re-added support for hook implementation eg on wp frontend.
376
+
377
  = 2.2.9 =
378
  * Fixed PHP Notice: Trying to get property 'ID' of non-object.
379
  * Fixed Fatal Error: Cannot use string offset as an array.
wp-user-avatar.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://wordpress.org/plugins/wp-user-avatar/
5
  Description: Use any image from your WordPress Media Library as a custom user avatar. Add your own Default Avatar.
6
  Author: ProfilePress
7
  Author URI: https://profilepress.net/
8
- Version: 2.2.9
9
  Text Domain: wp-user-avatar
10
  Domain Path: /lang/
11
  */
@@ -33,7 +33,7 @@ class WP_User_Avatar_Setup {
33
  * @since 1.9.2
34
  */
35
  private function _define_constants() {
36
- define('WPUA_VERSION', '2.2.9');
37
  define('WPUA_FOLDER', basename(dirname(__FILE__)));
38
  define('WPUA_DIR', plugin_dir_path(__FILE__));
39
  define('WPUA_INC', WPUA_DIR.'includes'.'/');
5
  Description: Use any image from your WordPress Media Library as a custom user avatar. Add your own Default Avatar.
6
  Author: ProfilePress
7
  Author URI: https://profilepress.net/
8
+ Version: 2.2.10
9
  Text Domain: wp-user-avatar
10
  Domain Path: /lang/
11
  */
33
  * @since 1.9.2
34
  */
35
  private function _define_constants() {
36
+ define('WPUA_VERSION', '2.2.10');
37
  define('WPUA_FOLDER', basename(dirname(__FILE__)));
38
  define('WPUA_DIR', plugin_dir_path(__FILE__));
39
  define('WPUA_INC', WPUA_DIR.'includes'.'/');