ap_is_avatar_exists( integer $user_id )

Description #

Check if avatar exists already.

Parameters #

  • $user_id
    integer (Required) User ID or name.

Source #

File: addons/avatar/avatar.php

function ap_is_avatar_exists( $user_id ) {
	$filename   = md5( $user_id );
	$upload_dir = wp_upload_dir();
	$avatar_dir = $upload_dir['basedir'] . '/ap_avatars';

	return file_exists( $avatar_dir . $filename . '.jpg' );
}

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Add your comment