Support » Plugin: WP User Avatar | User Profile Picture » Default avatar option is missing

  • Resolved Ariel


    Hi guys

    I am the author of the plugin Leira Letter Avatar. My plugin adds a new option to the default wordpress settings page in “Settings” > “Discussion” > “Avatar” > “Default Avatar” to allow the user to select the option to show a custom letter avatar.
    However, while checking how well my plugin integrates with yours I found that WP User Avatar does not shows the option my plugin adds.

    I check the code and I found the problem.

    In your file /wp-user-avatar/includes/class-wp-user-avatar-admin.php method “wpua_add_default_avatar” line 240 right after the “$avatar_defaults” array instantiation you should make a call to the filter “avatar_defaults”, just to ensure all default avatars are correctly set.
    If you check wp core file “/wp-admin/options-discussion.php” line will notice that right after $avatar_defaults there is a call to the “avatar_defaults” filter.

    The code should look like this in order to fix the problem:

    // Set avatar defaults
        $avatar_defaults = array(
          'mystery' => __('Mystery Man','wp-user-avatar'),
          'blank' => __('Blank','wp-user-avatar'),
          'gravatar_default' => __('Gravatar Logo','wp-user-avatar'),
          'identicon' => __('Identicon (Generated)','wp-user-avatar'),
          'wavatar' => __('Wavatar (Generated)','wp-user-avatar'),
          'monsterid' => __('MonsterID (Generated)','wp-user-avatar'),
          'retro' => __('Retro (Generated)','wp-user-avatar')
        $avatar_defaults = apply_filters( 'avatar_defaults', $avatar_defaults );

    You can find more documentation about it in the wp core file “/wp-admin/options-discussion.php” line 274

    Kind regards

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.