Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter paullee357

    (@paullee357)

    Not sure why it is now fixed or the consequences of doing this but in the get_avatar function I set the field to $alt = false

    hi,

    i have the same problem, where exactly did paste $alt=false

    function get_avatar( $avatar, $id_or_email, $size, $default='', $alt ) {
    
    		if ( is_numeric( $id_or_email ) ) {
    			$email = get_userdata( $id_or_email )->user_email;
    			$user_id = (int) $id_or_email;
    		}
    		elseif ( is_object( $id_or_email ) ) {
    			$email = $id_or_email->comment_author_email;
    			$user_id = (int) $id_or_email->user_id;
    		}
    		elseif ( is_string( $id_or_email ) && ( $user = get_user_by( 'email', $id_or_email ) ) ) {
    			$email = $id_or_email;
    			$user_id = $user->ID;
    		}
    
    		// special exception for our 10up friends
    		// http://wordpress.org/extend/plugins/simple-local-avatars/
    		// (and check hook suffix while we're at it, if the current user has a simple_local_avatar, it'll throw the list off)
    		$local_avatars = get_user_meta( $user_id, 'simple_local_avatar', true );
    		if ( ! empty( $local_avatars ) && ( isset( $GLOBALS['hook_suffix'] ) && $GLOBALS['hook_suffix'] != 'options-discussion.php' ) ) {
    			remove_filter( 'get_avatar', array( &$this, 'get_avatar' ), 88, 5 );
    			return $avatar;
    		}
    
    		// since we're hooking directly into get_avatar,
    		// we need to make sure another avatar hasn't been selected
    		/* Once upon a time was needed for Mr WordPress. Do we care?
    		$direct = get_option('avatar_default');
    		if ( strpos( $default, $direct ) !== false ) {
    			$email = empty( $email ) ? 'nobody' : md5( $email );
    
    			// in rare cases were there is no email associated with the comment (like Mr WordPress)
    			// we have to work around a bit to insert the custom avatar
    			// 'www' version for WP2.9 and older
    			if ( strpos( $default, 'http://0.gravatar.com/avatar/') === 0 || strpos( $default, 'http://www.gravatar.com/avatar/') === 0 )
    				$avatar = str_replace( $default, $direct, $avatar );
    
    		}
    		*/
    		// hack the correct size parameter back in, if necessary
    		$avatar = str_replace( '%size%', $size, $avatar );
    		$avatar = str_replace( urlencode('%size%'), $size, $avatar );
    		return $avatar;
    	}

    hi,

    answering myself for google

    in the declaration’s function

    function get_avatar( $avatar, $id_or_email, $size, $default='', $alt )

    simply change to

    function get_avatar( $avatar, $id_or_email, $size, $default='', $alt='false' )

    Gone!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Missing argument 5 for Add_New_Default_Avatar::get_avatar()’ is closed to new replies.